@ocxp/client 0.2.7 → 0.2.9
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/dist/index.cjs +493 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2190 -136
- package/dist/index.d.ts +2190 -136
- package/dist/index.js +477 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -983,6 +983,13 @@ var removeLinkedRepo = (options) => (options.client ?? client).delete({
|
|
|
983
983
|
url: "/ocxp/project/{project_id}/repos/{repo_id}",
|
|
984
984
|
...options
|
|
985
985
|
});
|
|
986
|
+
var cleanupDeadRepos = (options) => (options?.client ?? client).post(
|
|
987
|
+
{
|
|
988
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
989
|
+
url: "/ocxp/project/cleanup-dead-repos",
|
|
990
|
+
...options
|
|
991
|
+
}
|
|
992
|
+
);
|
|
986
993
|
var setDefaultRepo = (options) => (options.client ?? client).put({
|
|
987
994
|
security: [{ scheme: "bearer", type: "http" }],
|
|
988
995
|
url: "/ocxp/project/{project_id}/default-repo",
|
|
@@ -1039,6 +1046,39 @@ var setDefaultDatabase = (options) => (options.client ?? client).put({
|
|
|
1039
1046
|
...options.headers
|
|
1040
1047
|
}
|
|
1041
1048
|
});
|
|
1049
|
+
var deleteCredentials = (options) => (options.client ?? client).delete({
|
|
1050
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1051
|
+
url: "/ocxp/project/{project_id}/credentials",
|
|
1052
|
+
...options
|
|
1053
|
+
});
|
|
1054
|
+
var getCredentials = (options) => (options.client ?? client).get({
|
|
1055
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1056
|
+
url: "/ocxp/project/{project_id}/credentials",
|
|
1057
|
+
...options
|
|
1058
|
+
});
|
|
1059
|
+
var updateCredentials = (options) => (options.client ?? client).patch({
|
|
1060
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1061
|
+
url: "/ocxp/project/{project_id}/credentials",
|
|
1062
|
+
...options,
|
|
1063
|
+
headers: {
|
|
1064
|
+
"Content-Type": "application/json",
|
|
1065
|
+
...options.headers
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
var saveCredentials = (options) => (options.client ?? client).post({
|
|
1069
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1070
|
+
url: "/ocxp/project/{project_id}/credentials",
|
|
1071
|
+
...options,
|
|
1072
|
+
headers: {
|
|
1073
|
+
"Content-Type": "application/json",
|
|
1074
|
+
...options.headers
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
var testCredentials = (options) => (options.client ?? client).post({
|
|
1078
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1079
|
+
url: "/ocxp/project/{project_id}/credentials/test",
|
|
1080
|
+
...options
|
|
1081
|
+
});
|
|
1042
1082
|
var listMissions = (options) => (options?.client ?? client).get({
|
|
1043
1083
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1044
1084
|
url: "/ocxp/mission",
|
|
@@ -1095,6 +1135,20 @@ var regenerateMission = (options) => (options.client ?? client).post({
|
|
|
1095
1135
|
...options.headers
|
|
1096
1136
|
}
|
|
1097
1137
|
});
|
|
1138
|
+
var getKbStatus = (options) => (options?.client ?? client).get({
|
|
1139
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1140
|
+
url: "/ocxp/kb/status",
|
|
1141
|
+
...options
|
|
1142
|
+
});
|
|
1143
|
+
var triggerKbSync = (options) => (options.client ?? client).post({
|
|
1144
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1145
|
+
url: "/ocxp/kb/sync",
|
|
1146
|
+
...options,
|
|
1147
|
+
headers: {
|
|
1148
|
+
"Content-Type": "application/json",
|
|
1149
|
+
...options.headers
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1098
1152
|
var queryKnowledgeBase = (options) => (options.client ?? client).post({
|
|
1099
1153
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1100
1154
|
url: "/ocxp/kb/query",
|
|
@@ -1161,6 +1215,77 @@ var ignoreMemo = (options) => (options.client ?? client).post({
|
|
|
1161
1215
|
url: "/ocxp/memo/{memo_id}/ignore",
|
|
1162
1216
|
...options
|
|
1163
1217
|
});
|
|
1218
|
+
var listWorkflows = (options) => (options.client ?? client).get({
|
|
1219
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1220
|
+
url: "/ocxp/workflow",
|
|
1221
|
+
...options
|
|
1222
|
+
});
|
|
1223
|
+
var createWorkflow = (options) => (options.client ?? client).post({
|
|
1224
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1225
|
+
url: "/ocxp/workflow",
|
|
1226
|
+
...options,
|
|
1227
|
+
headers: {
|
|
1228
|
+
"Content-Type": "application/json",
|
|
1229
|
+
...options.headers
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1232
|
+
var deleteWorkflow = (options) => (options.client ?? client).delete({
|
|
1233
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1234
|
+
url: "/ocxp/workflow/{workflow_id}",
|
|
1235
|
+
...options
|
|
1236
|
+
});
|
|
1237
|
+
var getWorkflow = (options) => (options.client ?? client).get({
|
|
1238
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1239
|
+
url: "/ocxp/workflow/{workflow_id}",
|
|
1240
|
+
...options
|
|
1241
|
+
});
|
|
1242
|
+
var startWorkflow = (options) => (options.client ?? client).post({
|
|
1243
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1244
|
+
url: "/ocxp/workflow/{workflow_id}/start",
|
|
1245
|
+
...options
|
|
1246
|
+
});
|
|
1247
|
+
var listTasks = (options) => (options.client ?? client).get({
|
|
1248
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1249
|
+
url: "/ocxp/workflow/{workflow_id}/tasks",
|
|
1250
|
+
...options
|
|
1251
|
+
});
|
|
1252
|
+
var addTask = (options) => (options.client ?? client).post({
|
|
1253
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1254
|
+
url: "/ocxp/workflow/{workflow_id}/tasks",
|
|
1255
|
+
...options,
|
|
1256
|
+
headers: {
|
|
1257
|
+
"Content-Type": "application/json",
|
|
1258
|
+
...options.headers
|
|
1259
|
+
}
|
|
1260
|
+
});
|
|
1261
|
+
var bulkUpdateTasks = (options) => (options.client ?? client).patch({
|
|
1262
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1263
|
+
url: "/ocxp/workflow/{workflow_id}/tasks/bulk",
|
|
1264
|
+
...options,
|
|
1265
|
+
headers: {
|
|
1266
|
+
"Content-Type": "application/json",
|
|
1267
|
+
...options.headers
|
|
1268
|
+
}
|
|
1269
|
+
});
|
|
1270
|
+
var deleteTask = (options) => (options.client ?? client).delete({
|
|
1271
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1272
|
+
url: "/ocxp/workflow/{workflow_id}/tasks/{task_id}",
|
|
1273
|
+
...options
|
|
1274
|
+
});
|
|
1275
|
+
var getTask = (options) => (options.client ?? client).get({
|
|
1276
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1277
|
+
url: "/ocxp/workflow/{workflow_id}/tasks/{task_id}",
|
|
1278
|
+
...options
|
|
1279
|
+
});
|
|
1280
|
+
var updateTask = (options) => (options.client ?? client).patch({
|
|
1281
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1282
|
+
url: "/ocxp/workflow/{workflow_id}/tasks/{task_id}",
|
|
1283
|
+
...options,
|
|
1284
|
+
headers: {
|
|
1285
|
+
"Content-Type": "application/json",
|
|
1286
|
+
...options.headers
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1164
1289
|
var downloadRepository = (options) => (options.client ?? client).post({
|
|
1165
1290
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1166
1291
|
url: "/ocxp/repo/download",
|
|
@@ -1293,6 +1418,11 @@ var listContextDatabases = (options) => (options?.client ?? client).get({
|
|
|
1293
1418
|
url: "/ocxp/context/database/databases",
|
|
1294
1419
|
...options
|
|
1295
1420
|
});
|
|
1421
|
+
var getDatabaseDiagram = (options) => (options?.client ?? client).get({
|
|
1422
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1423
|
+
url: "/ocxp/context/database/diagram",
|
|
1424
|
+
...options
|
|
1425
|
+
});
|
|
1296
1426
|
var getContentTypes = (options) => (options?.client ?? client).get({
|
|
1297
1427
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1298
1428
|
url: "/ocxp/context/types",
|
|
@@ -1723,19 +1853,54 @@ var OCXPClient = class {
|
|
|
1723
1853
|
});
|
|
1724
1854
|
return extractData(response);
|
|
1725
1855
|
}
|
|
1856
|
+
// ============== KB Status Operations ==============
|
|
1857
|
+
/**
|
|
1858
|
+
* Get status of all Knowledge Bases (code, docs, visual)
|
|
1859
|
+
*/
|
|
1860
|
+
async kbStatus() {
|
|
1861
|
+
const headers = await this.getHeaders();
|
|
1862
|
+
const response = await getKbStatus({
|
|
1863
|
+
client: this.client,
|
|
1864
|
+
headers
|
|
1865
|
+
});
|
|
1866
|
+
return extractData(response);
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* Trigger KB re-indexing
|
|
1870
|
+
*/
|
|
1871
|
+
async kbSync(options) {
|
|
1872
|
+
const headers = await this.getHeaders();
|
|
1873
|
+
const response = await triggerKbSync({
|
|
1874
|
+
client: this.client,
|
|
1875
|
+
body: {
|
|
1876
|
+
kb_type: options?.kbType ?? null,
|
|
1877
|
+
force: options?.force ?? false
|
|
1878
|
+
},
|
|
1879
|
+
headers
|
|
1880
|
+
});
|
|
1881
|
+
return extractData(response);
|
|
1882
|
+
}
|
|
1726
1883
|
// ============== Mission Operations ==============
|
|
1727
1884
|
/**
|
|
1728
|
-
* List all missions in workspace
|
|
1885
|
+
* List all missions in workspace with pagination support
|
|
1886
|
+
* @param options - Filtering, pagination, and sorting options
|
|
1887
|
+
* @returns Paginated mission list with total count
|
|
1729
1888
|
*/
|
|
1730
1889
|
async listMissions(options) {
|
|
1731
1890
|
const headers = await this.getHeaders();
|
|
1891
|
+
const query = {
|
|
1892
|
+
project_id: options?.projectId,
|
|
1893
|
+
status: options?.status,
|
|
1894
|
+
limit: options?.limit,
|
|
1895
|
+
offset: options?.offset,
|
|
1896
|
+
order_by: options?.orderBy,
|
|
1897
|
+
order_dir: options?.orderDir,
|
|
1898
|
+
mission_ids: options?.missionIds,
|
|
1899
|
+
include_metadata: options?.includeMetadata
|
|
1900
|
+
};
|
|
1732
1901
|
const response = await listMissions({
|
|
1733
1902
|
client: this.client,
|
|
1734
|
-
query
|
|
1735
|
-
project_id: options?.projectId,
|
|
1736
|
-
status: options?.status,
|
|
1737
|
-
limit: options?.limit
|
|
1738
|
-
},
|
|
1903
|
+
query,
|
|
1739
1904
|
headers
|
|
1740
1905
|
});
|
|
1741
1906
|
return extractData(response);
|
|
@@ -2159,6 +2324,23 @@ var OCXPClient = class {
|
|
|
2159
2324
|
});
|
|
2160
2325
|
return extractData(response);
|
|
2161
2326
|
}
|
|
2327
|
+
/**
|
|
2328
|
+
* Get database ER diagram in Mermaid syntax
|
|
2329
|
+
*/
|
|
2330
|
+
async getDatabaseDiagram(databaseId, tables, includeMockData, mockRows) {
|
|
2331
|
+
const headers = await this.getHeaders();
|
|
2332
|
+
const response = await getDatabaseDiagram({
|
|
2333
|
+
client: this.client,
|
|
2334
|
+
query: {
|
|
2335
|
+
database_id: databaseId,
|
|
2336
|
+
tables,
|
|
2337
|
+
include_mock_data: includeMockData,
|
|
2338
|
+
mock_rows: mockRows
|
|
2339
|
+
},
|
|
2340
|
+
headers
|
|
2341
|
+
});
|
|
2342
|
+
return extractData(response);
|
|
2343
|
+
}
|
|
2162
2344
|
/**
|
|
2163
2345
|
* List all tables in database
|
|
2164
2346
|
*/
|
|
@@ -2246,7 +2428,8 @@ var OCXPClient = class {
|
|
|
2246
2428
|
category: options?.category,
|
|
2247
2429
|
priority: options?.priority,
|
|
2248
2430
|
auto_include: options?.autoInclude,
|
|
2249
|
-
branch: options?.branch
|
|
2431
|
+
branch: options?.branch,
|
|
2432
|
+
prompt: options?.prompt
|
|
2250
2433
|
};
|
|
2251
2434
|
const response = await addLinkedRepo({
|
|
2252
2435
|
client: this.client,
|
|
@@ -2268,6 +2451,72 @@ var OCXPClient = class {
|
|
|
2268
2451
|
});
|
|
2269
2452
|
return extractData(response);
|
|
2270
2453
|
}
|
|
2454
|
+
/**
|
|
2455
|
+
* Link a database to a project
|
|
2456
|
+
*/
|
|
2457
|
+
async addProjectDatabase(projectId, databaseId, options) {
|
|
2458
|
+
const headers = await this.getHeaders();
|
|
2459
|
+
const response = await addDatabase({
|
|
2460
|
+
client: this.client,
|
|
2461
|
+
path: { project_id: projectId },
|
|
2462
|
+
headers,
|
|
2463
|
+
body: {
|
|
2464
|
+
database_id: databaseId,
|
|
2465
|
+
priority: options?.priority ?? 50,
|
|
2466
|
+
auto_include: options?.autoInclude ?? true,
|
|
2467
|
+
prompt: options?.prompt
|
|
2468
|
+
}
|
|
2469
|
+
});
|
|
2470
|
+
return extractData(response);
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Remove a database from a project
|
|
2474
|
+
*/
|
|
2475
|
+
async removeProjectDatabase(projectId, databaseId) {
|
|
2476
|
+
const headers = await this.getHeaders();
|
|
2477
|
+
const response = await removeDatabase({
|
|
2478
|
+
client: this.client,
|
|
2479
|
+
path: { project_id: projectId, database_id: databaseId },
|
|
2480
|
+
headers
|
|
2481
|
+
});
|
|
2482
|
+
return extractData(response);
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Set the default database for a project
|
|
2486
|
+
*/
|
|
2487
|
+
async setProjectDefaultDatabase(projectId, databaseId) {
|
|
2488
|
+
const headers = await this.getHeaders();
|
|
2489
|
+
const response = await setDefaultDatabase({
|
|
2490
|
+
client: this.client,
|
|
2491
|
+
path: { project_id: projectId },
|
|
2492
|
+
headers,
|
|
2493
|
+
body: { database_id: databaseId }
|
|
2494
|
+
});
|
|
2495
|
+
return extractData(response);
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2498
|
+
* Get all databases linked to a project
|
|
2499
|
+
*/
|
|
2500
|
+
async getProjectDatabases(projectId) {
|
|
2501
|
+
const headers = await this.getHeaders();
|
|
2502
|
+
const response = await getProjectDatabases({
|
|
2503
|
+
client: this.client,
|
|
2504
|
+
path: { project_id: projectId },
|
|
2505
|
+
headers
|
|
2506
|
+
});
|
|
2507
|
+
return extractData(response);
|
|
2508
|
+
}
|
|
2509
|
+
/**
|
|
2510
|
+
* Scan all projects and remove links to repos that no longer exist in the index
|
|
2511
|
+
*/
|
|
2512
|
+
async cleanupDeadRepos() {
|
|
2513
|
+
const headers = await this.getHeaders();
|
|
2514
|
+
const response = await cleanupDeadRepos({
|
|
2515
|
+
client: this.client,
|
|
2516
|
+
headers
|
|
2517
|
+
});
|
|
2518
|
+
return extractData(response);
|
|
2519
|
+
}
|
|
2271
2520
|
/**
|
|
2272
2521
|
* Set default repository for project
|
|
2273
2522
|
*/
|
|
@@ -2627,29 +2876,66 @@ var OCXPClient = class {
|
|
|
2627
2876
|
*/
|
|
2628
2877
|
async getProjectCredentials(projectId) {
|
|
2629
2878
|
const headers = await this.getHeaders();
|
|
2630
|
-
const response = await
|
|
2631
|
-
|
|
2632
|
-
|
|
2879
|
+
const response = await getCredentials({
|
|
2880
|
+
client: this.client,
|
|
2881
|
+
path: { project_id: projectId },
|
|
2633
2882
|
headers
|
|
2634
2883
|
});
|
|
2635
2884
|
if (response.error) {
|
|
2636
2885
|
throw new Error(`Failed to get credentials: ${JSON.stringify(response.error)}`);
|
|
2637
2886
|
}
|
|
2887
|
+
const data = response.data;
|
|
2888
|
+
if (!data.data) {
|
|
2889
|
+
throw new Error("No credentials found");
|
|
2890
|
+
}
|
|
2891
|
+
return data.data;
|
|
2892
|
+
}
|
|
2893
|
+
/**
|
|
2894
|
+
* Save project credentials for frontend authentication
|
|
2895
|
+
* @param projectId - Project ID
|
|
2896
|
+
* @param credentials - Credentials to save (url, username, password)
|
|
2897
|
+
* @returns Success response
|
|
2898
|
+
*/
|
|
2899
|
+
async saveProjectCredentials(projectId, credentials) {
|
|
2900
|
+
const headers = await this.getHeaders();
|
|
2901
|
+
const body = {
|
|
2902
|
+
url: credentials.url,
|
|
2903
|
+
username: credentials.username,
|
|
2904
|
+
password: credentials.password,
|
|
2905
|
+
login_instructions: credentials.login_instructions || "",
|
|
2906
|
+
workspace: this.workspace
|
|
2907
|
+
};
|
|
2908
|
+
const response = await saveCredentials({
|
|
2909
|
+
client: this.client,
|
|
2910
|
+
path: { project_id: projectId },
|
|
2911
|
+
headers,
|
|
2912
|
+
body
|
|
2913
|
+
});
|
|
2914
|
+
if (response.error) {
|
|
2915
|
+
throw new Error(`Failed to save credentials: ${JSON.stringify(response.error)}`);
|
|
2916
|
+
}
|
|
2638
2917
|
return response.data;
|
|
2639
2918
|
}
|
|
2640
2919
|
/**
|
|
2641
2920
|
* Update project credentials for frontend authentication
|
|
2642
2921
|
* @param projectId - Project ID
|
|
2643
2922
|
* @param updates - Partial credential updates
|
|
2644
|
-
* @returns
|
|
2923
|
+
* @returns Success response
|
|
2645
2924
|
*/
|
|
2646
2925
|
async updateProjectCredentials(projectId, updates) {
|
|
2647
2926
|
const headers = await this.getHeaders();
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2650
|
-
|
|
2927
|
+
const body = {
|
|
2928
|
+
url: updates.url ?? void 0,
|
|
2929
|
+
username: updates.username ?? void 0,
|
|
2930
|
+
password: updates.password ?? void 0,
|
|
2931
|
+
login_instructions: updates.login_instructions ?? void 0,
|
|
2932
|
+
workspace: updates.workspace ?? void 0
|
|
2933
|
+
};
|
|
2934
|
+
const response = await updateCredentials({
|
|
2935
|
+
client: this.client,
|
|
2936
|
+
path: { project_id: projectId },
|
|
2651
2937
|
headers,
|
|
2652
|
-
body
|
|
2938
|
+
body
|
|
2653
2939
|
});
|
|
2654
2940
|
if (response.error) {
|
|
2655
2941
|
throw new Error(`Failed to update credentials: ${JSON.stringify(response.error)}`);
|
|
@@ -2663,19 +2949,15 @@ var OCXPClient = class {
|
|
|
2663
2949
|
*/
|
|
2664
2950
|
async testProjectCredentials(projectId) {
|
|
2665
2951
|
const headers = await this.getHeaders();
|
|
2666
|
-
const response = await
|
|
2667
|
-
|
|
2668
|
-
|
|
2952
|
+
const response = await testCredentials({
|
|
2953
|
+
client: this.client,
|
|
2954
|
+
path: { project_id: projectId },
|
|
2669
2955
|
headers
|
|
2670
2956
|
});
|
|
2671
2957
|
if (response.error) {
|
|
2672
2958
|
throw new Error(`Failed to test credentials: ${JSON.stringify(response.error)}`);
|
|
2673
2959
|
}
|
|
2674
|
-
|
|
2675
|
-
if (data && typeof data === "object" && "success" in data) {
|
|
2676
|
-
return data;
|
|
2677
|
-
}
|
|
2678
|
-
return { success: false };
|
|
2960
|
+
return response.data;
|
|
2679
2961
|
}
|
|
2680
2962
|
/**
|
|
2681
2963
|
* Delete project credentials
|
|
@@ -2684,15 +2966,44 @@ var OCXPClient = class {
|
|
|
2684
2966
|
*/
|
|
2685
2967
|
async deleteProjectCredentials(projectId) {
|
|
2686
2968
|
const headers = await this.getHeaders();
|
|
2687
|
-
const response = await
|
|
2688
|
-
|
|
2689
|
-
|
|
2969
|
+
const response = await deleteCredentials({
|
|
2970
|
+
client: this.client,
|
|
2971
|
+
path: { project_id: projectId },
|
|
2690
2972
|
headers
|
|
2691
2973
|
});
|
|
2692
2974
|
if (response.error) {
|
|
2693
2975
|
throw new Error(`Failed to delete credentials: ${JSON.stringify(response.error)}`);
|
|
2694
2976
|
}
|
|
2695
2977
|
}
|
|
2978
|
+
// ============== Document Generation (Workflow-based) ==============
|
|
2979
|
+
/**
|
|
2980
|
+
* Generate mission output by creating a workflow with doc tasks.
|
|
2981
|
+
* Returns the workflow_id so the client can open WorkflowDetailView
|
|
2982
|
+
* for real-time progress tracking.
|
|
2983
|
+
*
|
|
2984
|
+
* @param missionId - Mission UUID
|
|
2985
|
+
* @param outputType - Type of output: 'documents', 'report', 'summary', etc.
|
|
2986
|
+
* @param options - Output options (doc_types, strategy, etc.)
|
|
2987
|
+
* @returns OutputGenerationResponse with workflow_id for tracking
|
|
2988
|
+
*/
|
|
2989
|
+
async generateMissionOutput(missionId, outputType, options) {
|
|
2990
|
+
const headers = await this.getHeaders();
|
|
2991
|
+
const response = await this.client.request({
|
|
2992
|
+
method: "POST",
|
|
2993
|
+
url: `/ocxp/mission/${missionId}/output`,
|
|
2994
|
+
headers,
|
|
2995
|
+
body: {
|
|
2996
|
+
output_type: outputType,
|
|
2997
|
+
doc_types: options?.doc_types,
|
|
2998
|
+
strategy: options?.strategy || "generate_all",
|
|
2999
|
+
session_id: options?.session_id
|
|
3000
|
+
}
|
|
3001
|
+
});
|
|
3002
|
+
if (response.error) {
|
|
3003
|
+
throw new Error(`Failed to generate output: ${JSON.stringify(response.error)}`);
|
|
3004
|
+
}
|
|
3005
|
+
return response.data;
|
|
3006
|
+
}
|
|
2696
3007
|
// ============== Namespaced Accessors ==============
|
|
2697
3008
|
_mission;
|
|
2698
3009
|
_project;
|
|
@@ -2750,13 +3061,61 @@ var OCXPClient = class {
|
|
|
2750
3061
|
return this._prototype;
|
|
2751
3062
|
}
|
|
2752
3063
|
};
|
|
3064
|
+
var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
|
|
3065
|
+
DocumentType2["IMPLEMENTATION_GUIDE"] = "implementation_guide";
|
|
3066
|
+
DocumentType2["PRD"] = "prd";
|
|
3067
|
+
DocumentType2["ARCHITECTURE_DECISIONS"] = "architecture_decisions";
|
|
3068
|
+
DocumentType2["DATABASE_SCHEMA"] = "database_schema";
|
|
3069
|
+
DocumentType2["DEPLOYMENT_GUIDE"] = "deployment_guide";
|
|
3070
|
+
DocumentType2["TESTING_STRATEGY"] = "testing_strategy";
|
|
3071
|
+
DocumentType2["API_REFERENCE"] = "api_reference";
|
|
3072
|
+
return DocumentType2;
|
|
3073
|
+
})(DocumentType || {});
|
|
3074
|
+
var DOCUMENT_TYPE_INFO = {
|
|
3075
|
+
["implementation_guide" /* IMPLEMENTATION_GUIDE */]: {
|
|
3076
|
+
name: "Implementation Guide",
|
|
3077
|
+
description: "Step-by-step development guide",
|
|
3078
|
+
icon: "book"
|
|
3079
|
+
},
|
|
3080
|
+
["prd" /* PRD */]: {
|
|
3081
|
+
name: "PRD",
|
|
3082
|
+
description: "Product requirements document",
|
|
3083
|
+
icon: "file-text"
|
|
3084
|
+
},
|
|
3085
|
+
["architecture_decisions" /* ARCHITECTURE_DECISIONS */]: {
|
|
3086
|
+
name: "Architecture Decisions",
|
|
3087
|
+
description: "ADRs and design rationale",
|
|
3088
|
+
icon: "layers"
|
|
3089
|
+
},
|
|
3090
|
+
["database_schema" /* DATABASE_SCHEMA */]: {
|
|
3091
|
+
name: "Database Schema",
|
|
3092
|
+
description: "Data model and schema design",
|
|
3093
|
+
icon: "database"
|
|
3094
|
+
},
|
|
3095
|
+
["deployment_guide" /* DEPLOYMENT_GUIDE */]: {
|
|
3096
|
+
name: "Deployment Guide",
|
|
3097
|
+
description: "Deployment and infrastructure setup",
|
|
3098
|
+
icon: "cloud"
|
|
3099
|
+
},
|
|
3100
|
+
["testing_strategy" /* TESTING_STRATEGY */]: {
|
|
3101
|
+
name: "Testing Strategy",
|
|
3102
|
+
description: "Test plan and coverage strategy",
|
|
3103
|
+
icon: "check-square"
|
|
3104
|
+
},
|
|
3105
|
+
["api_reference" /* API_REFERENCE */]: {
|
|
3106
|
+
name: "API Reference",
|
|
3107
|
+
description: "API endpoints and contracts",
|
|
3108
|
+
icon: "code"
|
|
3109
|
+
}
|
|
3110
|
+
};
|
|
2753
3111
|
var MissionNamespace = class {
|
|
2754
3112
|
constructor(client2) {
|
|
2755
3113
|
this.client = client2;
|
|
2756
3114
|
}
|
|
2757
3115
|
/**
|
|
2758
|
-
* List missions with optional filtering
|
|
3116
|
+
* List missions with optional filtering and pagination
|
|
2759
3117
|
* @example ocxp.mission.list({ status: 'active', limit: 10 })
|
|
3118
|
+
* @example ocxp.mission.list({ limit: 20, offset: 40, orderBy: 'created_at', orderDir: 'desc' })
|
|
2760
3119
|
*/
|
|
2761
3120
|
async list(options) {
|
|
2762
3121
|
return this.client.listMissions(options);
|
|
@@ -2828,6 +3187,24 @@ var MissionNamespace = class {
|
|
|
2828
3187
|
async tree(path, depth, includeVersions) {
|
|
2829
3188
|
return this.client.tree("mission", path, depth, includeVersions);
|
|
2830
3189
|
}
|
|
3190
|
+
/**
|
|
3191
|
+
* Generate mission output by creating a workflow.
|
|
3192
|
+
* Returns workflow_id for tracking via WorkflowDetailView.
|
|
3193
|
+
*
|
|
3194
|
+
* @param missionId - Mission UUID
|
|
3195
|
+
* @param outputType - Type of output: 'documents', 'report', 'summary', etc.
|
|
3196
|
+
* @param options - Output options (doc_types, strategy, etc.)
|
|
3197
|
+
* @returns OutputGenerationResponse with workflow_id
|
|
3198
|
+
*
|
|
3199
|
+
* @example
|
|
3200
|
+
* const result = await ocxp.mission.generateOutput('mission-id', 'documents', {
|
|
3201
|
+
* doc_types: ['implementation-guide', 'prd'],
|
|
3202
|
+
* });
|
|
3203
|
+
* // Open WorkflowDetailView with result.workflow_id
|
|
3204
|
+
*/
|
|
3205
|
+
async generateOutput(missionId, outputType, options) {
|
|
3206
|
+
return this.client.generateMissionOutput(missionId, outputType, options);
|
|
3207
|
+
}
|
|
2831
3208
|
};
|
|
2832
3209
|
var ProjectNamespace = class {
|
|
2833
3210
|
constructor(client2) {
|
|
@@ -2878,6 +3255,12 @@ var ProjectNamespace = class {
|
|
|
2878
3255
|
async removeRepo(projectId, repoId) {
|
|
2879
3256
|
return this.client.removeProjectRepo(projectId, repoId);
|
|
2880
3257
|
}
|
|
3258
|
+
/**
|
|
3259
|
+
* Remove dead repo links from all projects in the workspace
|
|
3260
|
+
*/
|
|
3261
|
+
async cleanupDeadRepos() {
|
|
3262
|
+
return this.client.cleanupDeadRepos();
|
|
3263
|
+
}
|
|
2881
3264
|
/**
|
|
2882
3265
|
* Set the default repository for a project
|
|
2883
3266
|
*/
|
|
@@ -2902,6 +3285,30 @@ var ProjectNamespace = class {
|
|
|
2902
3285
|
async removeMission(projectId, missionId) {
|
|
2903
3286
|
return this.client.removeProjectMission(projectId, missionId);
|
|
2904
3287
|
}
|
|
3288
|
+
/**
|
|
3289
|
+
* Link a database to a project
|
|
3290
|
+
*/
|
|
3291
|
+
async addDatabase(projectId, databaseId, options) {
|
|
3292
|
+
return this.client.addProjectDatabase(projectId, databaseId, options);
|
|
3293
|
+
}
|
|
3294
|
+
/**
|
|
3295
|
+
* Remove a database from a project
|
|
3296
|
+
*/
|
|
3297
|
+
async removeDatabase(projectId, databaseId) {
|
|
3298
|
+
return this.client.removeProjectDatabase(projectId, databaseId);
|
|
3299
|
+
}
|
|
3300
|
+
/**
|
|
3301
|
+
* Set the default database for a project
|
|
3302
|
+
*/
|
|
3303
|
+
async setDefaultDatabase(projectId, databaseId) {
|
|
3304
|
+
return this.client.setProjectDefaultDatabase(projectId, databaseId);
|
|
3305
|
+
}
|
|
3306
|
+
/**
|
|
3307
|
+
* Get all databases linked to a project
|
|
3308
|
+
*/
|
|
3309
|
+
async getProjectDatabases(projectId) {
|
|
3310
|
+
return this.client.getProjectDatabases(projectId);
|
|
3311
|
+
}
|
|
2905
3312
|
/**
|
|
2906
3313
|
* Get project content tree structure from S3
|
|
2907
3314
|
* @param includeVersions - If true, includes S3 version IDs for files
|
|
@@ -2968,6 +3375,20 @@ var KBNamespace = class {
|
|
|
2968
3375
|
async rag(query, sessionId) {
|
|
2969
3376
|
return this.client.kbRag(query, sessionId);
|
|
2970
3377
|
}
|
|
3378
|
+
/**
|
|
3379
|
+
* Get status of all Knowledge Bases (code, docs, visual)
|
|
3380
|
+
* @example ocxp.kb.status()
|
|
3381
|
+
*/
|
|
3382
|
+
async status() {
|
|
3383
|
+
return this.client.kbStatus();
|
|
3384
|
+
}
|
|
3385
|
+
/**
|
|
3386
|
+
* Trigger KB re-indexing
|
|
3387
|
+
* @example ocxp.kb.sync({ kbType: 'code' })
|
|
3388
|
+
*/
|
|
3389
|
+
async sync(options) {
|
|
3390
|
+
return this.client.kbSync(options);
|
|
3391
|
+
}
|
|
2971
3392
|
};
|
|
2972
3393
|
var PrototypeNamespace = class {
|
|
2973
3394
|
constructor(client2) {
|
|
@@ -3463,6 +3884,12 @@ var WebSocketService = class {
|
|
|
3463
3884
|
onPrototypeSyncComplete(handler) {
|
|
3464
3885
|
return this.on("prototype_sync_complete", handler);
|
|
3465
3886
|
}
|
|
3887
|
+
/**
|
|
3888
|
+
* Subscribe to KB indexing status updates
|
|
3889
|
+
*/
|
|
3890
|
+
onKBIndexingStatus(handler) {
|
|
3891
|
+
return this.on("kb_indexing_status", handler);
|
|
3892
|
+
}
|
|
3466
3893
|
/**
|
|
3467
3894
|
* Subscribe to connection state changes
|
|
3468
3895
|
*/
|
|
@@ -3735,6 +4162,28 @@ var PaginationSchema = z.object({
|
|
|
3735
4162
|
hasMore: z.boolean(),
|
|
3736
4163
|
total: z.number()
|
|
3737
4164
|
});
|
|
4165
|
+
var PaginationParamsSchema = z.object({
|
|
4166
|
+
/** Items per page (default: 50, max: 100) */
|
|
4167
|
+
limit: z.number().min(1).max(100).default(50),
|
|
4168
|
+
/** Skip first N items (for offset pagination) */
|
|
4169
|
+
offset: z.number().min(0).default(0),
|
|
4170
|
+
/** Cursor token (for cursor pagination, alternative to offset) */
|
|
4171
|
+
cursor: z.string().nullable().optional(),
|
|
4172
|
+
/** Sort field */
|
|
4173
|
+
orderBy: z.string().optional(),
|
|
4174
|
+
/** Sort direction: asc | desc */
|
|
4175
|
+
orderDir: z.enum(["asc", "desc"]).default("desc")
|
|
4176
|
+
});
|
|
4177
|
+
function createPaginatedResponseSchema(itemSchema) {
|
|
4178
|
+
return z.object({
|
|
4179
|
+
items: z.array(itemSchema),
|
|
4180
|
+
total: z.number(),
|
|
4181
|
+
limit: z.number(),
|
|
4182
|
+
offset: z.number(),
|
|
4183
|
+
cursor: z.string().nullable().optional(),
|
|
4184
|
+
hasMore: z.boolean()
|
|
4185
|
+
});
|
|
4186
|
+
}
|
|
3738
4187
|
var ContentTypeSchema = z.enum([
|
|
3739
4188
|
"mission",
|
|
3740
4189
|
"project",
|
|
@@ -4317,6 +4766,6 @@ var GithubCommitsDataSchema = z.object({
|
|
|
4317
4766
|
});
|
|
4318
4767
|
var GithubCommitsResponseSchema = createResponseSchema(GithubCommitsDataSchema);
|
|
4319
4768
|
|
|
4320
|
-
export { AddProjectRepoDataSchema, AddProjectRepoResponseSchema, AuthTokenDataSchema, AuthTokenResponseSchema, AuthUserInfoResponseSchema, AuthUserInfoSchema, AuthValidateDataSchema, AuthValidateResponseSchema, ContentTypeInfoSchema, ContentTypeSchema, ContentTypesDataSchema, ContentTypesResponseSchema, ContextReposDataSchema, ContextReposResponseSchema, CreateProjectDataSchema, CreateProjectResponseSchema, CreateSessionDataSchema, CreateSessionResponseSchema, DeleteDataSchema, DeleteProjectDataSchema, DeleteProjectResponseSchema, DeleteResponseSchema, DiscoveryDataSchema, DiscoveryEndpointSchema, DiscoveryResponseSchema, ErrorResponseSchema, ForkSessionDataSchema, ForkSessionResponseSchema, GetProjectDataSchema, GetProjectResponseSchema, GetSessionMessagesDataSchema, GetSessionMessagesResponseSchema, GithubBranchInfoSchema, GithubBranchesDataSchema, GithubBranchesResponseSchema, GithubCommitInfoSchema, GithubCommitsDataSchema, GithubCommitsResponseSchema, GithubDirectoryDataSchema, GithubDirectoryResponseSchema, GithubFileDataSchema, GithubFileInfoSchema, GithubFileResponseSchema, GithubRepoDataSchema, GithubRepoInfoSchema, GithubRepoResponseSchema, IngestionJobResponseSchema, IngestionJobSchema, KBDocumentSchema, KBIngestDataSchema, KBIngestResponseSchema, KBListDataSchema, KBListResponseSchema, KBNamespace, ListDataSchema, ListEntrySchema, ListProjectsDataSchema, ListProjectsResponseSchema, ListResponseSchema, ListSessionsDataSchema, ListSessionsResponseSchema, MetaSchema, MissionNamespace, OCXPAuthError, OCXPClient, OCXPConflictError, OCXPError, OCXPErrorCode, OCXPNetworkError, OCXPNotFoundError, OCXPPathService, OCXPRateLimitError, OCXPResponseSchema, OCXPTimeoutError, OCXPValidationError, PaginationSchema, PresignedUrlDataSchema, PresignedUrlResponseSchema, ProjectMissionSchema, ProjectNamespace, ProjectRepoSchema, ProjectSchema, PrototypeNamespace, QueryDataSchema, QueryFilterSchema, QueryResponseSchema, ReadDataSchema, ReadResponseSchema, RepoDeleteDataSchema, RepoDeleteResponseSchema, RepoDownloadDataSchema, RepoDownloadRequestSchema, RepoDownloadResponseSchema, RepoExistsDataSchema, RepoExistsResponseSchema, RepoListDataSchema, RepoListItemSchema, RepoListResponseSchema, RepoStatusDataSchema, RepoStatusEnum, RepoStatusResponseSchema, SearchDataSchema, SearchResponseSchema, SearchResultItemSchema, SessionMessageSchema, SessionNamespace, SessionSchema, StatsDataSchema, StatsResponseSchema, TreeDataSchema, TreeNodeSchema, TreeResponseSchema, UpdateProjectDataSchema, UpdateProjectResponseSchema, UpdateSessionMetadataDataSchema, UpdateSessionMetadataResponseSchema, VALID_CONTENT_TYPES, VectorSearchDataSchema, VectorSearchResponseSchema, WSBaseMessageSchema, WSChatMessageSchema, WSChatResponseSchema, WSConnectedSchema, WSErrorMessageSchema, WSMessageSchema, WSMessageTypeSchema, WSPingPongSchema, WSStatusSchema, WSStreamChunkSchema, WSStreamEndSchema, WSStreamStartSchema, WebSocketService, WriteDataSchema, WriteResponseSchema, acknowledgeMemo, addDatabase, addLinkedRepo, addMission, archiveSession, buildPath, bulkDeleteContent, bulkReadContent, bulkWriteContent, createClient, createConfig, createDatabase, createMemo, createOCXPClient, createPathService, createProject, createResponseSchema, createWebSocketService, deleteContent, deleteDatabase, deleteMemo, deleteProject, deleteRepo, downloadRepository, forkSession, getAuthConfig, getCanonicalType, getContentStats, getContentTree, getContentTypes, getContextRepos, getCurrentUser, getDatabase, getMemo, getMemoForSource, getMissionContext, getProject, getProjectDatabases, getPrototypeChat, getRepoCommits, getRepoDownloadStatus, getSample, getSchema, getSessionMessages, getStoredVersions, getSyncStatus, githubCheckAccess, githubGetContents, githubListBranches, ignoreMemo, isOCXPAuthError, isOCXPConflictError, isOCXPError, isOCXPNetworkError, isOCXPNotFoundError, isOCXPRateLimitError, isOCXPTimeoutError, isOCXPValidationError, isValidContentType, linkPrototypeChat, listContent, listContextDatabases, listDatabases, listDownloadedRepos, listMemos, listProjects, listPrototypeChats, listSessions, listTables, listWorkspaces, lockContent, login, loginForAccessToken, mapHttpError, moveContent, normalizePath, parsePath, parseWSMessage, previewPrototypeChat, queryContent, queryKnowledgeBase, ragKnowledgeBase, readContent, refreshTokens, regenerateMission, removeDatabase, removeLinkedRepo, removeMission, resolveMemo, safeParseWSMessage, searchContent, setDefaultDatabase, setDefaultRepo, syncAllRepos, syncPrototypeChat, syncPrototypeChatAsync, syncRepo, testDatabaseConnection, toolCreateMission, toolUpdateMission, unlockContent, updateDatabase, updateProject, updateSessionMetadata, writeContent };
|
|
4769
|
+
export { AddProjectRepoDataSchema, AddProjectRepoResponseSchema, AuthTokenDataSchema, AuthTokenResponseSchema, AuthUserInfoResponseSchema, AuthUserInfoSchema, AuthValidateDataSchema, AuthValidateResponseSchema, ContentTypeInfoSchema, ContentTypeSchema, ContentTypesDataSchema, ContentTypesResponseSchema, ContextReposDataSchema, ContextReposResponseSchema, CreateProjectDataSchema, CreateProjectResponseSchema, CreateSessionDataSchema, CreateSessionResponseSchema, DOCUMENT_TYPE_INFO, DeleteDataSchema, DeleteProjectDataSchema, DeleteProjectResponseSchema, DeleteResponseSchema, DiscoveryDataSchema, DiscoveryEndpointSchema, DiscoveryResponseSchema, DocumentType, ErrorResponseSchema, ForkSessionDataSchema, ForkSessionResponseSchema, GetProjectDataSchema, GetProjectResponseSchema, GetSessionMessagesDataSchema, GetSessionMessagesResponseSchema, GithubBranchInfoSchema, GithubBranchesDataSchema, GithubBranchesResponseSchema, GithubCommitInfoSchema, GithubCommitsDataSchema, GithubCommitsResponseSchema, GithubDirectoryDataSchema, GithubDirectoryResponseSchema, GithubFileDataSchema, GithubFileInfoSchema, GithubFileResponseSchema, GithubRepoDataSchema, GithubRepoInfoSchema, GithubRepoResponseSchema, IngestionJobResponseSchema, IngestionJobSchema, KBDocumentSchema, KBIngestDataSchema, KBIngestResponseSchema, KBListDataSchema, KBListResponseSchema, KBNamespace, ListDataSchema, ListEntrySchema, ListProjectsDataSchema, ListProjectsResponseSchema, ListResponseSchema, ListSessionsDataSchema, ListSessionsResponseSchema, MetaSchema, MissionNamespace, OCXPAuthError, OCXPClient, OCXPConflictError, OCXPError, OCXPErrorCode, OCXPNetworkError, OCXPNotFoundError, OCXPPathService, OCXPRateLimitError, OCXPResponseSchema, OCXPTimeoutError, OCXPValidationError, PaginationParamsSchema, PaginationSchema, PresignedUrlDataSchema, PresignedUrlResponseSchema, ProjectMissionSchema, ProjectNamespace, ProjectRepoSchema, ProjectSchema, PrototypeNamespace, QueryDataSchema, QueryFilterSchema, QueryResponseSchema, ReadDataSchema, ReadResponseSchema, RepoDeleteDataSchema, RepoDeleteResponseSchema, RepoDownloadDataSchema, RepoDownloadRequestSchema, RepoDownloadResponseSchema, RepoExistsDataSchema, RepoExistsResponseSchema, RepoListDataSchema, RepoListItemSchema, RepoListResponseSchema, RepoStatusDataSchema, RepoStatusEnum, RepoStatusResponseSchema, SearchDataSchema, SearchResponseSchema, SearchResultItemSchema, SessionMessageSchema, SessionNamespace, SessionSchema, StatsDataSchema, StatsResponseSchema, TreeDataSchema, TreeNodeSchema, TreeResponseSchema, UpdateProjectDataSchema, UpdateProjectResponseSchema, UpdateSessionMetadataDataSchema, UpdateSessionMetadataResponseSchema, VALID_CONTENT_TYPES, VectorSearchDataSchema, VectorSearchResponseSchema, WSBaseMessageSchema, WSChatMessageSchema, WSChatResponseSchema, WSConnectedSchema, WSErrorMessageSchema, WSMessageSchema, WSMessageTypeSchema, WSPingPongSchema, WSStatusSchema, WSStreamChunkSchema, WSStreamEndSchema, WSStreamStartSchema, WebSocketService, WriteDataSchema, WriteResponseSchema, acknowledgeMemo, addDatabase, addLinkedRepo, addMission, addTask, archiveSession, buildPath, bulkDeleteContent, bulkReadContent, bulkUpdateTasks, bulkWriteContent, createClient, createConfig, createDatabase, createMemo, createOCXPClient, createPaginatedResponseSchema, createPathService, createProject, createResponseSchema, createWebSocketService, createWorkflow, deleteContent, deleteDatabase, deleteMemo, deleteProject, deleteRepo, deleteTask, deleteWorkflow, downloadRepository, forkSession, getAuthConfig, getCanonicalType, getContentStats, getContentTree, getContentTypes, getContextRepos, getCurrentUser, getDatabase, getKbStatus, getMemo, getMemoForSource, getMissionContext, getProject, getProjectDatabases, getPrototypeChat, getRepoCommits, getRepoDownloadStatus, getSample, getSchema, getSessionMessages, getStoredVersions, getSyncStatus, getTask, getWorkflow, githubCheckAccess, githubGetContents, githubListBranches, ignoreMemo, isOCXPAuthError, isOCXPConflictError, isOCXPError, isOCXPNetworkError, isOCXPNotFoundError, isOCXPRateLimitError, isOCXPTimeoutError, isOCXPValidationError, isValidContentType, linkPrototypeChat, listContent, listContextDatabases, listDatabases, listDownloadedRepos, listMemos, listProjects, listPrototypeChats, listSessions, listTables, listTasks, listWorkflows, listWorkspaces, lockContent, login, loginForAccessToken, mapHttpError, moveContent, normalizePath, parsePath, parseWSMessage, previewPrototypeChat, queryContent, queryKnowledgeBase, ragKnowledgeBase, readContent, refreshTokens, regenerateMission, removeDatabase, removeLinkedRepo, removeMission, resolveMemo, safeParseWSMessage, searchContent, setDefaultDatabase, setDefaultRepo, startWorkflow, syncAllRepos, syncPrototypeChat, syncPrototypeChatAsync, syncRepo, testDatabaseConnection, toolCreateMission, toolUpdateMission, triggerKbSync, unlockContent, updateDatabase, updateProject, updateSessionMetadata, updateTask, writeContent };
|
|
4321
4770
|
//# sourceMappingURL=index.js.map
|
|
4322
4771
|
//# sourceMappingURL=index.js.map
|