@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.cjs
CHANGED
|
@@ -985,6 +985,13 @@ var removeLinkedRepo = (options) => (options.client ?? client).delete({
|
|
|
985
985
|
url: "/ocxp/project/{project_id}/repos/{repo_id}",
|
|
986
986
|
...options
|
|
987
987
|
});
|
|
988
|
+
var cleanupDeadRepos = (options) => (options?.client ?? client).post(
|
|
989
|
+
{
|
|
990
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
991
|
+
url: "/ocxp/project/cleanup-dead-repos",
|
|
992
|
+
...options
|
|
993
|
+
}
|
|
994
|
+
);
|
|
988
995
|
var setDefaultRepo = (options) => (options.client ?? client).put({
|
|
989
996
|
security: [{ scheme: "bearer", type: "http" }],
|
|
990
997
|
url: "/ocxp/project/{project_id}/default-repo",
|
|
@@ -1041,6 +1048,39 @@ var setDefaultDatabase = (options) => (options.client ?? client).put({
|
|
|
1041
1048
|
...options.headers
|
|
1042
1049
|
}
|
|
1043
1050
|
});
|
|
1051
|
+
var deleteCredentials = (options) => (options.client ?? client).delete({
|
|
1052
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1053
|
+
url: "/ocxp/project/{project_id}/credentials",
|
|
1054
|
+
...options
|
|
1055
|
+
});
|
|
1056
|
+
var getCredentials = (options) => (options.client ?? client).get({
|
|
1057
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1058
|
+
url: "/ocxp/project/{project_id}/credentials",
|
|
1059
|
+
...options
|
|
1060
|
+
});
|
|
1061
|
+
var updateCredentials = (options) => (options.client ?? client).patch({
|
|
1062
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1063
|
+
url: "/ocxp/project/{project_id}/credentials",
|
|
1064
|
+
...options,
|
|
1065
|
+
headers: {
|
|
1066
|
+
"Content-Type": "application/json",
|
|
1067
|
+
...options.headers
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
var saveCredentials = (options) => (options.client ?? client).post({
|
|
1071
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1072
|
+
url: "/ocxp/project/{project_id}/credentials",
|
|
1073
|
+
...options,
|
|
1074
|
+
headers: {
|
|
1075
|
+
"Content-Type": "application/json",
|
|
1076
|
+
...options.headers
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
var testCredentials = (options) => (options.client ?? client).post({
|
|
1080
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1081
|
+
url: "/ocxp/project/{project_id}/credentials/test",
|
|
1082
|
+
...options
|
|
1083
|
+
});
|
|
1044
1084
|
var listMissions = (options) => (options?.client ?? client).get({
|
|
1045
1085
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1046
1086
|
url: "/ocxp/mission",
|
|
@@ -1097,6 +1137,20 @@ var regenerateMission = (options) => (options.client ?? client).post({
|
|
|
1097
1137
|
...options.headers
|
|
1098
1138
|
}
|
|
1099
1139
|
});
|
|
1140
|
+
var getKbStatus = (options) => (options?.client ?? client).get({
|
|
1141
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1142
|
+
url: "/ocxp/kb/status",
|
|
1143
|
+
...options
|
|
1144
|
+
});
|
|
1145
|
+
var triggerKbSync = (options) => (options.client ?? client).post({
|
|
1146
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1147
|
+
url: "/ocxp/kb/sync",
|
|
1148
|
+
...options,
|
|
1149
|
+
headers: {
|
|
1150
|
+
"Content-Type": "application/json",
|
|
1151
|
+
...options.headers
|
|
1152
|
+
}
|
|
1153
|
+
});
|
|
1100
1154
|
var queryKnowledgeBase = (options) => (options.client ?? client).post({
|
|
1101
1155
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1102
1156
|
url: "/ocxp/kb/query",
|
|
@@ -1163,6 +1217,77 @@ var ignoreMemo = (options) => (options.client ?? client).post({
|
|
|
1163
1217
|
url: "/ocxp/memo/{memo_id}/ignore",
|
|
1164
1218
|
...options
|
|
1165
1219
|
});
|
|
1220
|
+
var listWorkflows = (options) => (options.client ?? client).get({
|
|
1221
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1222
|
+
url: "/ocxp/workflow",
|
|
1223
|
+
...options
|
|
1224
|
+
});
|
|
1225
|
+
var createWorkflow = (options) => (options.client ?? client).post({
|
|
1226
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1227
|
+
url: "/ocxp/workflow",
|
|
1228
|
+
...options,
|
|
1229
|
+
headers: {
|
|
1230
|
+
"Content-Type": "application/json",
|
|
1231
|
+
...options.headers
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
var deleteWorkflow = (options) => (options.client ?? client).delete({
|
|
1235
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1236
|
+
url: "/ocxp/workflow/{workflow_id}",
|
|
1237
|
+
...options
|
|
1238
|
+
});
|
|
1239
|
+
var getWorkflow = (options) => (options.client ?? client).get({
|
|
1240
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1241
|
+
url: "/ocxp/workflow/{workflow_id}",
|
|
1242
|
+
...options
|
|
1243
|
+
});
|
|
1244
|
+
var startWorkflow = (options) => (options.client ?? client).post({
|
|
1245
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1246
|
+
url: "/ocxp/workflow/{workflow_id}/start",
|
|
1247
|
+
...options
|
|
1248
|
+
});
|
|
1249
|
+
var listTasks = (options) => (options.client ?? client).get({
|
|
1250
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1251
|
+
url: "/ocxp/workflow/{workflow_id}/tasks",
|
|
1252
|
+
...options
|
|
1253
|
+
});
|
|
1254
|
+
var addTask = (options) => (options.client ?? client).post({
|
|
1255
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1256
|
+
url: "/ocxp/workflow/{workflow_id}/tasks",
|
|
1257
|
+
...options,
|
|
1258
|
+
headers: {
|
|
1259
|
+
"Content-Type": "application/json",
|
|
1260
|
+
...options.headers
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
var bulkUpdateTasks = (options) => (options.client ?? client).patch({
|
|
1264
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1265
|
+
url: "/ocxp/workflow/{workflow_id}/tasks/bulk",
|
|
1266
|
+
...options,
|
|
1267
|
+
headers: {
|
|
1268
|
+
"Content-Type": "application/json",
|
|
1269
|
+
...options.headers
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
var deleteTask = (options) => (options.client ?? client).delete({
|
|
1273
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1274
|
+
url: "/ocxp/workflow/{workflow_id}/tasks/{task_id}",
|
|
1275
|
+
...options
|
|
1276
|
+
});
|
|
1277
|
+
var getTask = (options) => (options.client ?? client).get({
|
|
1278
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1279
|
+
url: "/ocxp/workflow/{workflow_id}/tasks/{task_id}",
|
|
1280
|
+
...options
|
|
1281
|
+
});
|
|
1282
|
+
var updateTask = (options) => (options.client ?? client).patch({
|
|
1283
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1284
|
+
url: "/ocxp/workflow/{workflow_id}/tasks/{task_id}",
|
|
1285
|
+
...options,
|
|
1286
|
+
headers: {
|
|
1287
|
+
"Content-Type": "application/json",
|
|
1288
|
+
...options.headers
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1166
1291
|
var downloadRepository = (options) => (options.client ?? client).post({
|
|
1167
1292
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1168
1293
|
url: "/ocxp/repo/download",
|
|
@@ -1295,6 +1420,11 @@ var listContextDatabases = (options) => (options?.client ?? client).get({
|
|
|
1295
1420
|
url: "/ocxp/context/database/databases",
|
|
1296
1421
|
...options
|
|
1297
1422
|
});
|
|
1423
|
+
var getDatabaseDiagram = (options) => (options?.client ?? client).get({
|
|
1424
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1425
|
+
url: "/ocxp/context/database/diagram",
|
|
1426
|
+
...options
|
|
1427
|
+
});
|
|
1298
1428
|
var getContentTypes = (options) => (options?.client ?? client).get({
|
|
1299
1429
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1300
1430
|
url: "/ocxp/context/types",
|
|
@@ -1725,19 +1855,54 @@ var OCXPClient = class {
|
|
|
1725
1855
|
});
|
|
1726
1856
|
return extractData(response);
|
|
1727
1857
|
}
|
|
1858
|
+
// ============== KB Status Operations ==============
|
|
1859
|
+
/**
|
|
1860
|
+
* Get status of all Knowledge Bases (code, docs, visual)
|
|
1861
|
+
*/
|
|
1862
|
+
async kbStatus() {
|
|
1863
|
+
const headers = await this.getHeaders();
|
|
1864
|
+
const response = await getKbStatus({
|
|
1865
|
+
client: this.client,
|
|
1866
|
+
headers
|
|
1867
|
+
});
|
|
1868
|
+
return extractData(response);
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Trigger KB re-indexing
|
|
1872
|
+
*/
|
|
1873
|
+
async kbSync(options) {
|
|
1874
|
+
const headers = await this.getHeaders();
|
|
1875
|
+
const response = await triggerKbSync({
|
|
1876
|
+
client: this.client,
|
|
1877
|
+
body: {
|
|
1878
|
+
kb_type: options?.kbType ?? null,
|
|
1879
|
+
force: options?.force ?? false
|
|
1880
|
+
},
|
|
1881
|
+
headers
|
|
1882
|
+
});
|
|
1883
|
+
return extractData(response);
|
|
1884
|
+
}
|
|
1728
1885
|
// ============== Mission Operations ==============
|
|
1729
1886
|
/**
|
|
1730
|
-
* List all missions in workspace
|
|
1887
|
+
* List all missions in workspace with pagination support
|
|
1888
|
+
* @param options - Filtering, pagination, and sorting options
|
|
1889
|
+
* @returns Paginated mission list with total count
|
|
1731
1890
|
*/
|
|
1732
1891
|
async listMissions(options) {
|
|
1733
1892
|
const headers = await this.getHeaders();
|
|
1893
|
+
const query = {
|
|
1894
|
+
project_id: options?.projectId,
|
|
1895
|
+
status: options?.status,
|
|
1896
|
+
limit: options?.limit,
|
|
1897
|
+
offset: options?.offset,
|
|
1898
|
+
order_by: options?.orderBy,
|
|
1899
|
+
order_dir: options?.orderDir,
|
|
1900
|
+
mission_ids: options?.missionIds,
|
|
1901
|
+
include_metadata: options?.includeMetadata
|
|
1902
|
+
};
|
|
1734
1903
|
const response = await listMissions({
|
|
1735
1904
|
client: this.client,
|
|
1736
|
-
query
|
|
1737
|
-
project_id: options?.projectId,
|
|
1738
|
-
status: options?.status,
|
|
1739
|
-
limit: options?.limit
|
|
1740
|
-
},
|
|
1905
|
+
query,
|
|
1741
1906
|
headers
|
|
1742
1907
|
});
|
|
1743
1908
|
return extractData(response);
|
|
@@ -2161,6 +2326,23 @@ var OCXPClient = class {
|
|
|
2161
2326
|
});
|
|
2162
2327
|
return extractData(response);
|
|
2163
2328
|
}
|
|
2329
|
+
/**
|
|
2330
|
+
* Get database ER diagram in Mermaid syntax
|
|
2331
|
+
*/
|
|
2332
|
+
async getDatabaseDiagram(databaseId, tables, includeMockData, mockRows) {
|
|
2333
|
+
const headers = await this.getHeaders();
|
|
2334
|
+
const response = await getDatabaseDiagram({
|
|
2335
|
+
client: this.client,
|
|
2336
|
+
query: {
|
|
2337
|
+
database_id: databaseId,
|
|
2338
|
+
tables,
|
|
2339
|
+
include_mock_data: includeMockData,
|
|
2340
|
+
mock_rows: mockRows
|
|
2341
|
+
},
|
|
2342
|
+
headers
|
|
2343
|
+
});
|
|
2344
|
+
return extractData(response);
|
|
2345
|
+
}
|
|
2164
2346
|
/**
|
|
2165
2347
|
* List all tables in database
|
|
2166
2348
|
*/
|
|
@@ -2248,7 +2430,8 @@ var OCXPClient = class {
|
|
|
2248
2430
|
category: options?.category,
|
|
2249
2431
|
priority: options?.priority,
|
|
2250
2432
|
auto_include: options?.autoInclude,
|
|
2251
|
-
branch: options?.branch
|
|
2433
|
+
branch: options?.branch,
|
|
2434
|
+
prompt: options?.prompt
|
|
2252
2435
|
};
|
|
2253
2436
|
const response = await addLinkedRepo({
|
|
2254
2437
|
client: this.client,
|
|
@@ -2270,6 +2453,72 @@ var OCXPClient = class {
|
|
|
2270
2453
|
});
|
|
2271
2454
|
return extractData(response);
|
|
2272
2455
|
}
|
|
2456
|
+
/**
|
|
2457
|
+
* Link a database to a project
|
|
2458
|
+
*/
|
|
2459
|
+
async addProjectDatabase(projectId, databaseId, options) {
|
|
2460
|
+
const headers = await this.getHeaders();
|
|
2461
|
+
const response = await addDatabase({
|
|
2462
|
+
client: this.client,
|
|
2463
|
+
path: { project_id: projectId },
|
|
2464
|
+
headers,
|
|
2465
|
+
body: {
|
|
2466
|
+
database_id: databaseId,
|
|
2467
|
+
priority: options?.priority ?? 50,
|
|
2468
|
+
auto_include: options?.autoInclude ?? true,
|
|
2469
|
+
prompt: options?.prompt
|
|
2470
|
+
}
|
|
2471
|
+
});
|
|
2472
|
+
return extractData(response);
|
|
2473
|
+
}
|
|
2474
|
+
/**
|
|
2475
|
+
* Remove a database from a project
|
|
2476
|
+
*/
|
|
2477
|
+
async removeProjectDatabase(projectId, databaseId) {
|
|
2478
|
+
const headers = await this.getHeaders();
|
|
2479
|
+
const response = await removeDatabase({
|
|
2480
|
+
client: this.client,
|
|
2481
|
+
path: { project_id: projectId, database_id: databaseId },
|
|
2482
|
+
headers
|
|
2483
|
+
});
|
|
2484
|
+
return extractData(response);
|
|
2485
|
+
}
|
|
2486
|
+
/**
|
|
2487
|
+
* Set the default database for a project
|
|
2488
|
+
*/
|
|
2489
|
+
async setProjectDefaultDatabase(projectId, databaseId) {
|
|
2490
|
+
const headers = await this.getHeaders();
|
|
2491
|
+
const response = await setDefaultDatabase({
|
|
2492
|
+
client: this.client,
|
|
2493
|
+
path: { project_id: projectId },
|
|
2494
|
+
headers,
|
|
2495
|
+
body: { database_id: databaseId }
|
|
2496
|
+
});
|
|
2497
|
+
return extractData(response);
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* Get all databases linked to a project
|
|
2501
|
+
*/
|
|
2502
|
+
async getProjectDatabases(projectId) {
|
|
2503
|
+
const headers = await this.getHeaders();
|
|
2504
|
+
const response = await getProjectDatabases({
|
|
2505
|
+
client: this.client,
|
|
2506
|
+
path: { project_id: projectId },
|
|
2507
|
+
headers
|
|
2508
|
+
});
|
|
2509
|
+
return extractData(response);
|
|
2510
|
+
}
|
|
2511
|
+
/**
|
|
2512
|
+
* Scan all projects and remove links to repos that no longer exist in the index
|
|
2513
|
+
*/
|
|
2514
|
+
async cleanupDeadRepos() {
|
|
2515
|
+
const headers = await this.getHeaders();
|
|
2516
|
+
const response = await cleanupDeadRepos({
|
|
2517
|
+
client: this.client,
|
|
2518
|
+
headers
|
|
2519
|
+
});
|
|
2520
|
+
return extractData(response);
|
|
2521
|
+
}
|
|
2273
2522
|
/**
|
|
2274
2523
|
* Set default repository for project
|
|
2275
2524
|
*/
|
|
@@ -2629,29 +2878,66 @@ var OCXPClient = class {
|
|
|
2629
2878
|
*/
|
|
2630
2879
|
async getProjectCredentials(projectId) {
|
|
2631
2880
|
const headers = await this.getHeaders();
|
|
2632
|
-
const response = await
|
|
2633
|
-
|
|
2634
|
-
|
|
2881
|
+
const response = await getCredentials({
|
|
2882
|
+
client: this.client,
|
|
2883
|
+
path: { project_id: projectId },
|
|
2635
2884
|
headers
|
|
2636
2885
|
});
|
|
2637
2886
|
if (response.error) {
|
|
2638
2887
|
throw new Error(`Failed to get credentials: ${JSON.stringify(response.error)}`);
|
|
2639
2888
|
}
|
|
2889
|
+
const data = response.data;
|
|
2890
|
+
if (!data.data) {
|
|
2891
|
+
throw new Error("No credentials found");
|
|
2892
|
+
}
|
|
2893
|
+
return data.data;
|
|
2894
|
+
}
|
|
2895
|
+
/**
|
|
2896
|
+
* Save project credentials for frontend authentication
|
|
2897
|
+
* @param projectId - Project ID
|
|
2898
|
+
* @param credentials - Credentials to save (url, username, password)
|
|
2899
|
+
* @returns Success response
|
|
2900
|
+
*/
|
|
2901
|
+
async saveProjectCredentials(projectId, credentials) {
|
|
2902
|
+
const headers = await this.getHeaders();
|
|
2903
|
+
const body = {
|
|
2904
|
+
url: credentials.url,
|
|
2905
|
+
username: credentials.username,
|
|
2906
|
+
password: credentials.password,
|
|
2907
|
+
login_instructions: credentials.login_instructions || "",
|
|
2908
|
+
workspace: this.workspace
|
|
2909
|
+
};
|
|
2910
|
+
const response = await saveCredentials({
|
|
2911
|
+
client: this.client,
|
|
2912
|
+
path: { project_id: projectId },
|
|
2913
|
+
headers,
|
|
2914
|
+
body
|
|
2915
|
+
});
|
|
2916
|
+
if (response.error) {
|
|
2917
|
+
throw new Error(`Failed to save credentials: ${JSON.stringify(response.error)}`);
|
|
2918
|
+
}
|
|
2640
2919
|
return response.data;
|
|
2641
2920
|
}
|
|
2642
2921
|
/**
|
|
2643
2922
|
* Update project credentials for frontend authentication
|
|
2644
2923
|
* @param projectId - Project ID
|
|
2645
2924
|
* @param updates - Partial credential updates
|
|
2646
|
-
* @returns
|
|
2925
|
+
* @returns Success response
|
|
2647
2926
|
*/
|
|
2648
2927
|
async updateProjectCredentials(projectId, updates) {
|
|
2649
2928
|
const headers = await this.getHeaders();
|
|
2650
|
-
const
|
|
2651
|
-
|
|
2652
|
-
|
|
2929
|
+
const body = {
|
|
2930
|
+
url: updates.url ?? void 0,
|
|
2931
|
+
username: updates.username ?? void 0,
|
|
2932
|
+
password: updates.password ?? void 0,
|
|
2933
|
+
login_instructions: updates.login_instructions ?? void 0,
|
|
2934
|
+
workspace: updates.workspace ?? void 0
|
|
2935
|
+
};
|
|
2936
|
+
const response = await updateCredentials({
|
|
2937
|
+
client: this.client,
|
|
2938
|
+
path: { project_id: projectId },
|
|
2653
2939
|
headers,
|
|
2654
|
-
body
|
|
2940
|
+
body
|
|
2655
2941
|
});
|
|
2656
2942
|
if (response.error) {
|
|
2657
2943
|
throw new Error(`Failed to update credentials: ${JSON.stringify(response.error)}`);
|
|
@@ -2665,19 +2951,15 @@ var OCXPClient = class {
|
|
|
2665
2951
|
*/
|
|
2666
2952
|
async testProjectCredentials(projectId) {
|
|
2667
2953
|
const headers = await this.getHeaders();
|
|
2668
|
-
const response = await
|
|
2669
|
-
|
|
2670
|
-
|
|
2954
|
+
const response = await testCredentials({
|
|
2955
|
+
client: this.client,
|
|
2956
|
+
path: { project_id: projectId },
|
|
2671
2957
|
headers
|
|
2672
2958
|
});
|
|
2673
2959
|
if (response.error) {
|
|
2674
2960
|
throw new Error(`Failed to test credentials: ${JSON.stringify(response.error)}`);
|
|
2675
2961
|
}
|
|
2676
|
-
|
|
2677
|
-
if (data && typeof data === "object" && "success" in data) {
|
|
2678
|
-
return data;
|
|
2679
|
-
}
|
|
2680
|
-
return { success: false };
|
|
2962
|
+
return response.data;
|
|
2681
2963
|
}
|
|
2682
2964
|
/**
|
|
2683
2965
|
* Delete project credentials
|
|
@@ -2686,15 +2968,44 @@ var OCXPClient = class {
|
|
|
2686
2968
|
*/
|
|
2687
2969
|
async deleteProjectCredentials(projectId) {
|
|
2688
2970
|
const headers = await this.getHeaders();
|
|
2689
|
-
const response = await
|
|
2690
|
-
|
|
2691
|
-
|
|
2971
|
+
const response = await deleteCredentials({
|
|
2972
|
+
client: this.client,
|
|
2973
|
+
path: { project_id: projectId },
|
|
2692
2974
|
headers
|
|
2693
2975
|
});
|
|
2694
2976
|
if (response.error) {
|
|
2695
2977
|
throw new Error(`Failed to delete credentials: ${JSON.stringify(response.error)}`);
|
|
2696
2978
|
}
|
|
2697
2979
|
}
|
|
2980
|
+
// ============== Document Generation (Workflow-based) ==============
|
|
2981
|
+
/**
|
|
2982
|
+
* Generate mission output by creating a workflow with doc tasks.
|
|
2983
|
+
* Returns the workflow_id so the client can open WorkflowDetailView
|
|
2984
|
+
* for real-time progress tracking.
|
|
2985
|
+
*
|
|
2986
|
+
* @param missionId - Mission UUID
|
|
2987
|
+
* @param outputType - Type of output: 'documents', 'report', 'summary', etc.
|
|
2988
|
+
* @param options - Output options (doc_types, strategy, etc.)
|
|
2989
|
+
* @returns OutputGenerationResponse with workflow_id for tracking
|
|
2990
|
+
*/
|
|
2991
|
+
async generateMissionOutput(missionId, outputType, options) {
|
|
2992
|
+
const headers = await this.getHeaders();
|
|
2993
|
+
const response = await this.client.request({
|
|
2994
|
+
method: "POST",
|
|
2995
|
+
url: `/ocxp/mission/${missionId}/output`,
|
|
2996
|
+
headers,
|
|
2997
|
+
body: {
|
|
2998
|
+
output_type: outputType,
|
|
2999
|
+
doc_types: options?.doc_types,
|
|
3000
|
+
strategy: options?.strategy || "generate_all",
|
|
3001
|
+
session_id: options?.session_id
|
|
3002
|
+
}
|
|
3003
|
+
});
|
|
3004
|
+
if (response.error) {
|
|
3005
|
+
throw new Error(`Failed to generate output: ${JSON.stringify(response.error)}`);
|
|
3006
|
+
}
|
|
3007
|
+
return response.data;
|
|
3008
|
+
}
|
|
2698
3009
|
// ============== Namespaced Accessors ==============
|
|
2699
3010
|
_mission;
|
|
2700
3011
|
_project;
|
|
@@ -2752,13 +3063,61 @@ var OCXPClient = class {
|
|
|
2752
3063
|
return this._prototype;
|
|
2753
3064
|
}
|
|
2754
3065
|
};
|
|
3066
|
+
var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
|
|
3067
|
+
DocumentType2["IMPLEMENTATION_GUIDE"] = "implementation_guide";
|
|
3068
|
+
DocumentType2["PRD"] = "prd";
|
|
3069
|
+
DocumentType2["ARCHITECTURE_DECISIONS"] = "architecture_decisions";
|
|
3070
|
+
DocumentType2["DATABASE_SCHEMA"] = "database_schema";
|
|
3071
|
+
DocumentType2["DEPLOYMENT_GUIDE"] = "deployment_guide";
|
|
3072
|
+
DocumentType2["TESTING_STRATEGY"] = "testing_strategy";
|
|
3073
|
+
DocumentType2["API_REFERENCE"] = "api_reference";
|
|
3074
|
+
return DocumentType2;
|
|
3075
|
+
})(DocumentType || {});
|
|
3076
|
+
var DOCUMENT_TYPE_INFO = {
|
|
3077
|
+
["implementation_guide" /* IMPLEMENTATION_GUIDE */]: {
|
|
3078
|
+
name: "Implementation Guide",
|
|
3079
|
+
description: "Step-by-step development guide",
|
|
3080
|
+
icon: "book"
|
|
3081
|
+
},
|
|
3082
|
+
["prd" /* PRD */]: {
|
|
3083
|
+
name: "PRD",
|
|
3084
|
+
description: "Product requirements document",
|
|
3085
|
+
icon: "file-text"
|
|
3086
|
+
},
|
|
3087
|
+
["architecture_decisions" /* ARCHITECTURE_DECISIONS */]: {
|
|
3088
|
+
name: "Architecture Decisions",
|
|
3089
|
+
description: "ADRs and design rationale",
|
|
3090
|
+
icon: "layers"
|
|
3091
|
+
},
|
|
3092
|
+
["database_schema" /* DATABASE_SCHEMA */]: {
|
|
3093
|
+
name: "Database Schema",
|
|
3094
|
+
description: "Data model and schema design",
|
|
3095
|
+
icon: "database"
|
|
3096
|
+
},
|
|
3097
|
+
["deployment_guide" /* DEPLOYMENT_GUIDE */]: {
|
|
3098
|
+
name: "Deployment Guide",
|
|
3099
|
+
description: "Deployment and infrastructure setup",
|
|
3100
|
+
icon: "cloud"
|
|
3101
|
+
},
|
|
3102
|
+
["testing_strategy" /* TESTING_STRATEGY */]: {
|
|
3103
|
+
name: "Testing Strategy",
|
|
3104
|
+
description: "Test plan and coverage strategy",
|
|
3105
|
+
icon: "check-square"
|
|
3106
|
+
},
|
|
3107
|
+
["api_reference" /* API_REFERENCE */]: {
|
|
3108
|
+
name: "API Reference",
|
|
3109
|
+
description: "API endpoints and contracts",
|
|
3110
|
+
icon: "code"
|
|
3111
|
+
}
|
|
3112
|
+
};
|
|
2755
3113
|
var MissionNamespace = class {
|
|
2756
3114
|
constructor(client2) {
|
|
2757
3115
|
this.client = client2;
|
|
2758
3116
|
}
|
|
2759
3117
|
/**
|
|
2760
|
-
* List missions with optional filtering
|
|
3118
|
+
* List missions with optional filtering and pagination
|
|
2761
3119
|
* @example ocxp.mission.list({ status: 'active', limit: 10 })
|
|
3120
|
+
* @example ocxp.mission.list({ limit: 20, offset: 40, orderBy: 'created_at', orderDir: 'desc' })
|
|
2762
3121
|
*/
|
|
2763
3122
|
async list(options) {
|
|
2764
3123
|
return this.client.listMissions(options);
|
|
@@ -2830,6 +3189,24 @@ var MissionNamespace = class {
|
|
|
2830
3189
|
async tree(path, depth, includeVersions) {
|
|
2831
3190
|
return this.client.tree("mission", path, depth, includeVersions);
|
|
2832
3191
|
}
|
|
3192
|
+
/**
|
|
3193
|
+
* Generate mission output by creating a workflow.
|
|
3194
|
+
* Returns workflow_id for tracking via WorkflowDetailView.
|
|
3195
|
+
*
|
|
3196
|
+
* @param missionId - Mission UUID
|
|
3197
|
+
* @param outputType - Type of output: 'documents', 'report', 'summary', etc.
|
|
3198
|
+
* @param options - Output options (doc_types, strategy, etc.)
|
|
3199
|
+
* @returns OutputGenerationResponse with workflow_id
|
|
3200
|
+
*
|
|
3201
|
+
* @example
|
|
3202
|
+
* const result = await ocxp.mission.generateOutput('mission-id', 'documents', {
|
|
3203
|
+
* doc_types: ['implementation-guide', 'prd'],
|
|
3204
|
+
* });
|
|
3205
|
+
* // Open WorkflowDetailView with result.workflow_id
|
|
3206
|
+
*/
|
|
3207
|
+
async generateOutput(missionId, outputType, options) {
|
|
3208
|
+
return this.client.generateMissionOutput(missionId, outputType, options);
|
|
3209
|
+
}
|
|
2833
3210
|
};
|
|
2834
3211
|
var ProjectNamespace = class {
|
|
2835
3212
|
constructor(client2) {
|
|
@@ -2880,6 +3257,12 @@ var ProjectNamespace = class {
|
|
|
2880
3257
|
async removeRepo(projectId, repoId) {
|
|
2881
3258
|
return this.client.removeProjectRepo(projectId, repoId);
|
|
2882
3259
|
}
|
|
3260
|
+
/**
|
|
3261
|
+
* Remove dead repo links from all projects in the workspace
|
|
3262
|
+
*/
|
|
3263
|
+
async cleanupDeadRepos() {
|
|
3264
|
+
return this.client.cleanupDeadRepos();
|
|
3265
|
+
}
|
|
2883
3266
|
/**
|
|
2884
3267
|
* Set the default repository for a project
|
|
2885
3268
|
*/
|
|
@@ -2904,6 +3287,30 @@ var ProjectNamespace = class {
|
|
|
2904
3287
|
async removeMission(projectId, missionId) {
|
|
2905
3288
|
return this.client.removeProjectMission(projectId, missionId);
|
|
2906
3289
|
}
|
|
3290
|
+
/**
|
|
3291
|
+
* Link a database to a project
|
|
3292
|
+
*/
|
|
3293
|
+
async addDatabase(projectId, databaseId, options) {
|
|
3294
|
+
return this.client.addProjectDatabase(projectId, databaseId, options);
|
|
3295
|
+
}
|
|
3296
|
+
/**
|
|
3297
|
+
* Remove a database from a project
|
|
3298
|
+
*/
|
|
3299
|
+
async removeDatabase(projectId, databaseId) {
|
|
3300
|
+
return this.client.removeProjectDatabase(projectId, databaseId);
|
|
3301
|
+
}
|
|
3302
|
+
/**
|
|
3303
|
+
* Set the default database for a project
|
|
3304
|
+
*/
|
|
3305
|
+
async setDefaultDatabase(projectId, databaseId) {
|
|
3306
|
+
return this.client.setProjectDefaultDatabase(projectId, databaseId);
|
|
3307
|
+
}
|
|
3308
|
+
/**
|
|
3309
|
+
* Get all databases linked to a project
|
|
3310
|
+
*/
|
|
3311
|
+
async getProjectDatabases(projectId) {
|
|
3312
|
+
return this.client.getProjectDatabases(projectId);
|
|
3313
|
+
}
|
|
2907
3314
|
/**
|
|
2908
3315
|
* Get project content tree structure from S3
|
|
2909
3316
|
* @param includeVersions - If true, includes S3 version IDs for files
|
|
@@ -2970,6 +3377,20 @@ var KBNamespace = class {
|
|
|
2970
3377
|
async rag(query, sessionId) {
|
|
2971
3378
|
return this.client.kbRag(query, sessionId);
|
|
2972
3379
|
}
|
|
3380
|
+
/**
|
|
3381
|
+
* Get status of all Knowledge Bases (code, docs, visual)
|
|
3382
|
+
* @example ocxp.kb.status()
|
|
3383
|
+
*/
|
|
3384
|
+
async status() {
|
|
3385
|
+
return this.client.kbStatus();
|
|
3386
|
+
}
|
|
3387
|
+
/**
|
|
3388
|
+
* Trigger KB re-indexing
|
|
3389
|
+
* @example ocxp.kb.sync({ kbType: 'code' })
|
|
3390
|
+
*/
|
|
3391
|
+
async sync(options) {
|
|
3392
|
+
return this.client.kbSync(options);
|
|
3393
|
+
}
|
|
2973
3394
|
};
|
|
2974
3395
|
var PrototypeNamespace = class {
|
|
2975
3396
|
constructor(client2) {
|
|
@@ -3465,6 +3886,12 @@ var WebSocketService = class {
|
|
|
3465
3886
|
onPrototypeSyncComplete(handler) {
|
|
3466
3887
|
return this.on("prototype_sync_complete", handler);
|
|
3467
3888
|
}
|
|
3889
|
+
/**
|
|
3890
|
+
* Subscribe to KB indexing status updates
|
|
3891
|
+
*/
|
|
3892
|
+
onKBIndexingStatus(handler) {
|
|
3893
|
+
return this.on("kb_indexing_status", handler);
|
|
3894
|
+
}
|
|
3468
3895
|
/**
|
|
3469
3896
|
* Subscribe to connection state changes
|
|
3470
3897
|
*/
|
|
@@ -3737,6 +4164,28 @@ var PaginationSchema = zod.z.object({
|
|
|
3737
4164
|
hasMore: zod.z.boolean(),
|
|
3738
4165
|
total: zod.z.number()
|
|
3739
4166
|
});
|
|
4167
|
+
var PaginationParamsSchema = zod.z.object({
|
|
4168
|
+
/** Items per page (default: 50, max: 100) */
|
|
4169
|
+
limit: zod.z.number().min(1).max(100).default(50),
|
|
4170
|
+
/** Skip first N items (for offset pagination) */
|
|
4171
|
+
offset: zod.z.number().min(0).default(0),
|
|
4172
|
+
/** Cursor token (for cursor pagination, alternative to offset) */
|
|
4173
|
+
cursor: zod.z.string().nullable().optional(),
|
|
4174
|
+
/** Sort field */
|
|
4175
|
+
orderBy: zod.z.string().optional(),
|
|
4176
|
+
/** Sort direction: asc | desc */
|
|
4177
|
+
orderDir: zod.z.enum(["asc", "desc"]).default("desc")
|
|
4178
|
+
});
|
|
4179
|
+
function createPaginatedResponseSchema(itemSchema) {
|
|
4180
|
+
return zod.z.object({
|
|
4181
|
+
items: zod.z.array(itemSchema),
|
|
4182
|
+
total: zod.z.number(),
|
|
4183
|
+
limit: zod.z.number(),
|
|
4184
|
+
offset: zod.z.number(),
|
|
4185
|
+
cursor: zod.z.string().nullable().optional(),
|
|
4186
|
+
hasMore: zod.z.boolean()
|
|
4187
|
+
});
|
|
4188
|
+
}
|
|
3740
4189
|
var ContentTypeSchema = zod.z.enum([
|
|
3741
4190
|
"mission",
|
|
3742
4191
|
"project",
|
|
@@ -4337,6 +4786,7 @@ exports.CreateProjectDataSchema = CreateProjectDataSchema;
|
|
|
4337
4786
|
exports.CreateProjectResponseSchema = CreateProjectResponseSchema;
|
|
4338
4787
|
exports.CreateSessionDataSchema = CreateSessionDataSchema;
|
|
4339
4788
|
exports.CreateSessionResponseSchema = CreateSessionResponseSchema;
|
|
4789
|
+
exports.DOCUMENT_TYPE_INFO = DOCUMENT_TYPE_INFO;
|
|
4340
4790
|
exports.DeleteDataSchema = DeleteDataSchema;
|
|
4341
4791
|
exports.DeleteProjectDataSchema = DeleteProjectDataSchema;
|
|
4342
4792
|
exports.DeleteProjectResponseSchema = DeleteProjectResponseSchema;
|
|
@@ -4344,6 +4794,7 @@ exports.DeleteResponseSchema = DeleteResponseSchema;
|
|
|
4344
4794
|
exports.DiscoveryDataSchema = DiscoveryDataSchema;
|
|
4345
4795
|
exports.DiscoveryEndpointSchema = DiscoveryEndpointSchema;
|
|
4346
4796
|
exports.DiscoveryResponseSchema = DiscoveryResponseSchema;
|
|
4797
|
+
exports.DocumentType = DocumentType;
|
|
4347
4798
|
exports.ErrorResponseSchema = ErrorResponseSchema;
|
|
4348
4799
|
exports.ForkSessionDataSchema = ForkSessionDataSchema;
|
|
4349
4800
|
exports.ForkSessionResponseSchema = ForkSessionResponseSchema;
|
|
@@ -4394,6 +4845,7 @@ exports.OCXPRateLimitError = OCXPRateLimitError;
|
|
|
4394
4845
|
exports.OCXPResponseSchema = OCXPResponseSchema;
|
|
4395
4846
|
exports.OCXPTimeoutError = OCXPTimeoutError;
|
|
4396
4847
|
exports.OCXPValidationError = OCXPValidationError;
|
|
4848
|
+
exports.PaginationParamsSchema = PaginationParamsSchema;
|
|
4397
4849
|
exports.PaginationSchema = PaginationSchema;
|
|
4398
4850
|
exports.PresignedUrlDataSchema = PresignedUrlDataSchema;
|
|
4399
4851
|
exports.PresignedUrlResponseSchema = PresignedUrlResponseSchema;
|
|
@@ -4457,25 +4909,31 @@ exports.acknowledgeMemo = acknowledgeMemo;
|
|
|
4457
4909
|
exports.addDatabase = addDatabase;
|
|
4458
4910
|
exports.addLinkedRepo = addLinkedRepo;
|
|
4459
4911
|
exports.addMission = addMission;
|
|
4912
|
+
exports.addTask = addTask;
|
|
4460
4913
|
exports.archiveSession = archiveSession;
|
|
4461
4914
|
exports.buildPath = buildPath;
|
|
4462
4915
|
exports.bulkDeleteContent = bulkDeleteContent;
|
|
4463
4916
|
exports.bulkReadContent = bulkReadContent;
|
|
4917
|
+
exports.bulkUpdateTasks = bulkUpdateTasks;
|
|
4464
4918
|
exports.bulkWriteContent = bulkWriteContent;
|
|
4465
4919
|
exports.createClient = createClient;
|
|
4466
4920
|
exports.createConfig = createConfig;
|
|
4467
4921
|
exports.createDatabase = createDatabase;
|
|
4468
4922
|
exports.createMemo = createMemo;
|
|
4469
4923
|
exports.createOCXPClient = createOCXPClient;
|
|
4924
|
+
exports.createPaginatedResponseSchema = createPaginatedResponseSchema;
|
|
4470
4925
|
exports.createPathService = createPathService;
|
|
4471
4926
|
exports.createProject = createProject;
|
|
4472
4927
|
exports.createResponseSchema = createResponseSchema;
|
|
4473
4928
|
exports.createWebSocketService = createWebSocketService;
|
|
4929
|
+
exports.createWorkflow = createWorkflow;
|
|
4474
4930
|
exports.deleteContent = deleteContent;
|
|
4475
4931
|
exports.deleteDatabase = deleteDatabase;
|
|
4476
4932
|
exports.deleteMemo = deleteMemo;
|
|
4477
4933
|
exports.deleteProject = deleteProject;
|
|
4478
4934
|
exports.deleteRepo = deleteRepo;
|
|
4935
|
+
exports.deleteTask = deleteTask;
|
|
4936
|
+
exports.deleteWorkflow = deleteWorkflow;
|
|
4479
4937
|
exports.downloadRepository = downloadRepository;
|
|
4480
4938
|
exports.forkSession = forkSession;
|
|
4481
4939
|
exports.getAuthConfig = getAuthConfig;
|
|
@@ -4486,6 +4944,7 @@ exports.getContentTypes = getContentTypes;
|
|
|
4486
4944
|
exports.getContextRepos = getContextRepos;
|
|
4487
4945
|
exports.getCurrentUser = getCurrentUser;
|
|
4488
4946
|
exports.getDatabase = getDatabase;
|
|
4947
|
+
exports.getKbStatus = getKbStatus;
|
|
4489
4948
|
exports.getMemo = getMemo;
|
|
4490
4949
|
exports.getMemoForSource = getMemoForSource;
|
|
4491
4950
|
exports.getMissionContext = getMissionContext;
|
|
@@ -4499,6 +4958,8 @@ exports.getSchema = getSchema;
|
|
|
4499
4958
|
exports.getSessionMessages = getSessionMessages;
|
|
4500
4959
|
exports.getStoredVersions = getStoredVersions;
|
|
4501
4960
|
exports.getSyncStatus = getSyncStatus;
|
|
4961
|
+
exports.getTask = getTask;
|
|
4962
|
+
exports.getWorkflow = getWorkflow;
|
|
4502
4963
|
exports.githubCheckAccess = githubCheckAccess;
|
|
4503
4964
|
exports.githubGetContents = githubGetContents;
|
|
4504
4965
|
exports.githubListBranches = githubListBranches;
|
|
@@ -4522,6 +4983,8 @@ exports.listProjects = listProjects;
|
|
|
4522
4983
|
exports.listPrototypeChats = listPrototypeChats;
|
|
4523
4984
|
exports.listSessions = listSessions;
|
|
4524
4985
|
exports.listTables = listTables;
|
|
4986
|
+
exports.listTasks = listTasks;
|
|
4987
|
+
exports.listWorkflows = listWorkflows;
|
|
4525
4988
|
exports.listWorkspaces = listWorkspaces;
|
|
4526
4989
|
exports.lockContent = lockContent;
|
|
4527
4990
|
exports.login = login;
|
|
@@ -4546,6 +5009,7 @@ exports.safeParseWSMessage = safeParseWSMessage;
|
|
|
4546
5009
|
exports.searchContent = searchContent;
|
|
4547
5010
|
exports.setDefaultDatabase = setDefaultDatabase;
|
|
4548
5011
|
exports.setDefaultRepo = setDefaultRepo;
|
|
5012
|
+
exports.startWorkflow = startWorkflow;
|
|
4549
5013
|
exports.syncAllRepos = syncAllRepos;
|
|
4550
5014
|
exports.syncPrototypeChat = syncPrototypeChat;
|
|
4551
5015
|
exports.syncPrototypeChatAsync = syncPrototypeChatAsync;
|
|
@@ -4553,10 +5017,12 @@ exports.syncRepo = syncRepo;
|
|
|
4553
5017
|
exports.testDatabaseConnection = testDatabaseConnection;
|
|
4554
5018
|
exports.toolCreateMission = toolCreateMission;
|
|
4555
5019
|
exports.toolUpdateMission = toolUpdateMission;
|
|
5020
|
+
exports.triggerKbSync = triggerKbSync;
|
|
4556
5021
|
exports.unlockContent = unlockContent;
|
|
4557
5022
|
exports.updateDatabase = updateDatabase;
|
|
4558
5023
|
exports.updateProject = updateProject;
|
|
4559
5024
|
exports.updateSessionMetadata = updateSessionMetadata;
|
|
5025
|
+
exports.updateTask = updateTask;
|
|
4560
5026
|
exports.writeContent = writeContent;
|
|
4561
5027
|
//# sourceMappingURL=index.cjs.map
|
|
4562
5028
|
//# sourceMappingURL=index.cjs.map
|