orchestrator-client 5.11.7 → 5.12.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/dist/index.cjs +153 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.js +153 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -148,6 +148,12 @@ function buildPagination(data) {
|
|
|
148
148
|
hasPrev: p.hasPrev ?? false
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
+
function toSnakeCaseOptions(options) {
|
|
152
|
+
if (!options) return options;
|
|
153
|
+
return Object.fromEntries(
|
|
154
|
+
Object.entries(options).map(([key, value]) => [camelToSnake(key), value])
|
|
155
|
+
);
|
|
156
|
+
}
|
|
151
157
|
function buildSkillMapping(m) {
|
|
152
158
|
return {
|
|
153
159
|
id: m.id ?? 0,
|
|
@@ -156,10 +162,20 @@ function buildSkillMapping(m) {
|
|
|
156
162
|
requiredTool: m.requiredTool ?? m.required_tool ?? null
|
|
157
163
|
};
|
|
158
164
|
}
|
|
165
|
+
function buildProfileEntry(e) {
|
|
166
|
+
return {
|
|
167
|
+
id: e.id ?? 0,
|
|
168
|
+
docType: e.docType ?? e.doc_type ?? "memory",
|
|
169
|
+
content: e.content ?? "",
|
|
170
|
+
createdAt: e.createdAt ?? e.created_at ?? "",
|
|
171
|
+
updatedAt: e.updatedAt ?? e.updated_at ?? ""
|
|
172
|
+
};
|
|
173
|
+
}
|
|
159
174
|
function buildSkill(s) {
|
|
160
175
|
return {
|
|
161
176
|
id: s.id ?? 0,
|
|
162
177
|
name: s.name ?? "",
|
|
178
|
+
user_id: s.userId ?? s.user_id ?? null,
|
|
163
179
|
description: s.description ?? "",
|
|
164
180
|
content: s.content ?? "",
|
|
165
181
|
createdAt: s.createdAt ?? s.created_at ?? "",
|
|
@@ -480,7 +496,7 @@ var OrchestratorAsync = class {
|
|
|
480
496
|
orchestrator_model_id: params.orchestratorModelId,
|
|
481
497
|
available_tools: params.availableTools,
|
|
482
498
|
attachment_ids: params.attachmentIds,
|
|
483
|
-
options: params.options
|
|
499
|
+
options: toSnakeCaseOptions(params.options)
|
|
484
500
|
});
|
|
485
501
|
return {
|
|
486
502
|
taskId: data.taskId ?? data.task_id ?? "",
|
|
@@ -798,7 +814,7 @@ var OrchestratorAsync = class {
|
|
|
798
814
|
orchestrator_model_id: params.orchestratorModelId,
|
|
799
815
|
available_tools: params.availableTools,
|
|
800
816
|
attachment_ids: params.attachmentIds,
|
|
801
|
-
options: params.options
|
|
817
|
+
options: toSnakeCaseOptions(params.options)
|
|
802
818
|
};
|
|
803
819
|
if (params.delegatedToken !== void 0) {
|
|
804
820
|
body.delegated_token = params.delegatedToken;
|
|
@@ -995,6 +1011,105 @@ var OrchestratorAsync = class {
|
|
|
995
1011
|
};
|
|
996
1012
|
}
|
|
997
1013
|
// ------------------------------------------------------------------
|
|
1014
|
+
// Personal skills (#789) — per-user ownership
|
|
1015
|
+
// ------------------------------------------------------------------
|
|
1016
|
+
async listPersonalSkills(userId) {
|
|
1017
|
+
const data = await this._get(
|
|
1018
|
+
`/profiles/${userId}/skills`
|
|
1019
|
+
);
|
|
1020
|
+
const skills = (data.skills ?? []).map(
|
|
1021
|
+
(s) => buildSkill(s)
|
|
1022
|
+
);
|
|
1023
|
+
return {
|
|
1024
|
+
skills,
|
|
1025
|
+
total: data.total ?? skills.length
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
async createPersonalSkill(userId, payload) {
|
|
1029
|
+
const data = await this._post(
|
|
1030
|
+
`/profiles/${userId}/skills`,
|
|
1031
|
+
payload
|
|
1032
|
+
);
|
|
1033
|
+
return buildSkill(data);
|
|
1034
|
+
}
|
|
1035
|
+
async updatePersonalSkill(userId, skillName, payload) {
|
|
1036
|
+
const data = await this._put(
|
|
1037
|
+
`/profiles/${userId}/skills/${skillName}`,
|
|
1038
|
+
payload
|
|
1039
|
+
);
|
|
1040
|
+
return buildSkill(data);
|
|
1041
|
+
}
|
|
1042
|
+
async deletePersonalSkill(userId, skillName) {
|
|
1043
|
+
const data = await this._delete(
|
|
1044
|
+
`/profiles/${userId}/skills/${skillName}`
|
|
1045
|
+
);
|
|
1046
|
+
return {
|
|
1047
|
+
deleted: data.deleted ?? false,
|
|
1048
|
+
skillId: data.skillId ?? data.skill_id ?? 0
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
// ------------------------------------------------------------------
|
|
1052
|
+
// Profile/memory entries (#788)
|
|
1053
|
+
// ------------------------------------------------------------------
|
|
1054
|
+
async listProfileUsers(params) {
|
|
1055
|
+
const data = await this._get("/profiles/users", {
|
|
1056
|
+
query: params?.query,
|
|
1057
|
+
limit: params?.limit,
|
|
1058
|
+
offset: params?.offset
|
|
1059
|
+
});
|
|
1060
|
+
return data ?? [];
|
|
1061
|
+
}
|
|
1062
|
+
async listProfileEntries(userId, docType) {
|
|
1063
|
+
const data = await this._get(
|
|
1064
|
+
`/profiles/${userId}/entries`,
|
|
1065
|
+
docType ? { doc_type: docType } : void 0
|
|
1066
|
+
);
|
|
1067
|
+
const entries = (data.entries ?? []).map(
|
|
1068
|
+
(e) => buildProfileEntry(e)
|
|
1069
|
+
);
|
|
1070
|
+
return {
|
|
1071
|
+
entries,
|
|
1072
|
+
total: data.total ?? entries.length
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1075
|
+
async getProfileUsage(userId, docType = "profile") {
|
|
1076
|
+
const data = await this._get(`/profiles/${userId}/usage`, { doc_type: docType });
|
|
1077
|
+
return {
|
|
1078
|
+
usedChars: data.usedChars ?? 0,
|
|
1079
|
+
maxChars: data.maxChars ?? 0,
|
|
1080
|
+
entries: (data.entries ?? []).map(
|
|
1081
|
+
(e) => ({
|
|
1082
|
+
id: e.id ?? 0,
|
|
1083
|
+
length: e.length ?? 0
|
|
1084
|
+
})
|
|
1085
|
+
)
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
async createProfileEntry(userId, payload) {
|
|
1089
|
+
const data = await this._post(
|
|
1090
|
+
`/profiles/${userId}/entries`,
|
|
1091
|
+
{ doc_type: payload.docType, content: payload.content }
|
|
1092
|
+
);
|
|
1093
|
+
return buildProfileEntry(data);
|
|
1094
|
+
}
|
|
1095
|
+
async replaceProfileEntry(userId, entryId, content) {
|
|
1096
|
+
const data = await this._request(
|
|
1097
|
+
"PATCH",
|
|
1098
|
+
`/profiles/${userId}/entries/${entryId}`,
|
|
1099
|
+
{ jsonBody: { content } }
|
|
1100
|
+
);
|
|
1101
|
+
return buildProfileEntry(data);
|
|
1102
|
+
}
|
|
1103
|
+
async deleteProfileEntry(userId, entryId) {
|
|
1104
|
+
const data = await this._delete(
|
|
1105
|
+
`/profiles/${userId}/entries/${entryId}`
|
|
1106
|
+
);
|
|
1107
|
+
return {
|
|
1108
|
+
deleted: data.deleted ?? false,
|
|
1109
|
+
entryId: data.entryId ?? data.entry_id ?? 0
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
// ------------------------------------------------------------------
|
|
998
1113
|
// Debug / Admin
|
|
999
1114
|
// ------------------------------------------------------------------
|
|
1000
1115
|
async getWorkflowStates() {
|
|
@@ -1619,6 +1734,36 @@ var Orchestrator = class {
|
|
|
1619
1734
|
deleteSkillMapping(skillId, mappingId) {
|
|
1620
1735
|
return runSync(this._async.deleteSkillMapping(skillId, mappingId));
|
|
1621
1736
|
}
|
|
1737
|
+
listPersonalSkills(userId) {
|
|
1738
|
+
return runSync(this._async.listPersonalSkills(userId));
|
|
1739
|
+
}
|
|
1740
|
+
createPersonalSkill(userId, payload) {
|
|
1741
|
+
return runSync(this._async.createPersonalSkill(userId, payload));
|
|
1742
|
+
}
|
|
1743
|
+
updatePersonalSkill(userId, skillName, payload) {
|
|
1744
|
+
return runSync(this._async.updatePersonalSkill(userId, skillName, payload));
|
|
1745
|
+
}
|
|
1746
|
+
deletePersonalSkill(userId, skillName) {
|
|
1747
|
+
return runSync(this._async.deletePersonalSkill(userId, skillName));
|
|
1748
|
+
}
|
|
1749
|
+
listProfileUsers(params) {
|
|
1750
|
+
return runSync(this._async.listProfileUsers(params));
|
|
1751
|
+
}
|
|
1752
|
+
listProfileEntries(userId, docType) {
|
|
1753
|
+
return runSync(this._async.listProfileEntries(userId, docType));
|
|
1754
|
+
}
|
|
1755
|
+
getProfileUsage(userId, docType = "profile") {
|
|
1756
|
+
return runSync(this._async.getProfileUsage(userId, docType));
|
|
1757
|
+
}
|
|
1758
|
+
createProfileEntry(userId, payload) {
|
|
1759
|
+
return runSync(this._async.createProfileEntry(userId, payload));
|
|
1760
|
+
}
|
|
1761
|
+
replaceProfileEntry(userId, entryId, content) {
|
|
1762
|
+
return runSync(this._async.replaceProfileEntry(userId, entryId, content));
|
|
1763
|
+
}
|
|
1764
|
+
deleteProfileEntry(userId, entryId) {
|
|
1765
|
+
return runSync(this._async.deleteProfileEntry(userId, entryId));
|
|
1766
|
+
}
|
|
1622
1767
|
// ------------------------------------------------------------------
|
|
1623
1768
|
// Debug / Admin
|
|
1624
1769
|
// ------------------------------------------------------------------
|
|
@@ -2340,12 +2485,16 @@ var Flow = class {
|
|
|
2340
2485
|
}
|
|
2341
2486
|
/**
|
|
2342
2487
|
* Per-task feature toggles sent in the creation request.
|
|
2343
|
-
* By default summaries and
|
|
2488
|
+
* By default summaries, translation and streaming are disabled since flow
|
|
2344
2489
|
* output is typically machine-consumed, not human-read.
|
|
2345
2490
|
* Override in subclasses that produce human-facing content.
|
|
2346
2491
|
*/
|
|
2347
2492
|
get taskOptions() {
|
|
2348
|
-
return {
|
|
2493
|
+
return {
|
|
2494
|
+
disableSummaries: true,
|
|
2495
|
+
disableTranslation: true,
|
|
2496
|
+
disableStreaming: true
|
|
2497
|
+
};
|
|
2349
2498
|
}
|
|
2350
2499
|
/**
|
|
2351
2500
|
* Override the agent model for this flow.
|