orchestrator-client 5.9.0 → 5.11.0
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 +156 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +110 -46
- package/dist/index.d.ts +110 -46
- package/dist/index.js +156 -123
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -80,6 +80,27 @@ function buildPagination(data) {
|
|
|
80
80
|
hasPrev: p.hasPrev ?? false
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
+
function buildSkillMapping(m) {
|
|
84
|
+
return {
|
|
85
|
+
id: m.id ?? 0,
|
|
86
|
+
workflowId: m.workflowId ?? m.workflow_id ?? "",
|
|
87
|
+
variant: m.variant ?? null,
|
|
88
|
+
requiredTool: m.requiredTool ?? m.required_tool ?? null
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function buildSkill(s) {
|
|
92
|
+
return {
|
|
93
|
+
id: s.id ?? 0,
|
|
94
|
+
name: s.name ?? "",
|
|
95
|
+
description: s.description ?? "",
|
|
96
|
+
content: s.content ?? "",
|
|
97
|
+
createdAt: s.createdAt ?? s.created_at ?? "",
|
|
98
|
+
updatedAt: s.updatedAt ?? s.updated_at ?? "",
|
|
99
|
+
mappings: (s.mappings ?? []).map(
|
|
100
|
+
(m) => buildSkillMapping(m)
|
|
101
|
+
)
|
|
102
|
+
};
|
|
103
|
+
}
|
|
83
104
|
function buildTaskSummary(t) {
|
|
84
105
|
return {
|
|
85
106
|
id: t.id ?? "",
|
|
@@ -93,11 +114,23 @@ function buildTaskSummary(t) {
|
|
|
93
114
|
approvalReason: t.approvalReason ?? "",
|
|
94
115
|
ticketId: t.ticketId ?? null,
|
|
95
116
|
availableTools: t.availableTools ?? null,
|
|
117
|
+
skills: t.skills ?? null,
|
|
96
118
|
insight: t.insight ?? null,
|
|
97
119
|
insightLocalized: t.insightLocalized ?? null,
|
|
98
120
|
createdAt: t.createdAt ?? "",
|
|
99
121
|
updatedAt: t.updatedAt ?? "",
|
|
100
|
-
pendingTranslationsForLocales: t.pendingTranslationsForLocales ?? null
|
|
122
|
+
pendingTranslationsForLocales: t.pendingTranslationsForLocales ?? null,
|
|
123
|
+
workflowData: t.workflowData ?? null
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function buildVsaTaskList(data) {
|
|
127
|
+
const raw = Array.isArray(data) ? data : data.tasks ?? [];
|
|
128
|
+
const tasks = raw.map(
|
|
129
|
+
(item) => typeof item === "string" ? { id: item } : buildTaskSummary(item)
|
|
130
|
+
);
|
|
131
|
+
return {
|
|
132
|
+
tasks,
|
|
133
|
+
pagination: buildPagination(data ?? {})
|
|
101
134
|
};
|
|
102
135
|
}
|
|
103
136
|
function parseApiErrorBody(body, fallbackMessage) {
|
|
@@ -772,21 +805,16 @@ var OrchestratorAsync = class {
|
|
|
772
805
|
limit: params?.limit,
|
|
773
806
|
offset: params?.offset
|
|
774
807
|
});
|
|
775
|
-
|
|
776
|
-
buildTaskSummary
|
|
777
|
-
);
|
|
778
|
-
return { tasks, pagination: buildPagination(data) };
|
|
808
|
+
return buildVsaTaskList(data);
|
|
779
809
|
}
|
|
780
|
-
async searchVSATasks(userId, query, limit) {
|
|
810
|
+
async searchVSATasks(userId, query, limit, offset) {
|
|
781
811
|
const data = await this._get("/task/vsa/search", {
|
|
782
812
|
user_id: userId,
|
|
783
813
|
query,
|
|
784
|
-
limit
|
|
814
|
+
limit,
|
|
815
|
+
offset
|
|
785
816
|
});
|
|
786
|
-
|
|
787
|
-
buildTaskSummary
|
|
788
|
-
);
|
|
789
|
-
return { tasks, pagination: buildPagination(data) };
|
|
817
|
+
return buildVsaTaskList(data);
|
|
790
818
|
}
|
|
791
819
|
async deleteVSATasksBulk(taskIds) {
|
|
792
820
|
const data = await this._post(
|
|
@@ -801,85 +829,6 @@ var OrchestratorAsync = class {
|
|
|
801
829
|
};
|
|
802
830
|
}
|
|
803
831
|
// ------------------------------------------------------------------
|
|
804
|
-
// MIO (self_managed) workflow
|
|
805
|
-
// ------------------------------------------------------------------
|
|
806
|
-
async sendMioMessage(taskId, message, attachmentIds) {
|
|
807
|
-
const data = await this._post(
|
|
808
|
-
"/task/self_managed/message",
|
|
809
|
-
{ task_id: taskId, message, attachment_ids: attachmentIds }
|
|
810
|
-
);
|
|
811
|
-
return { message: data.message ?? "" };
|
|
812
|
-
}
|
|
813
|
-
async approveMioAction(taskId, approved = true, feedback) {
|
|
814
|
-
const data = await this._post(
|
|
815
|
-
"/task/self_managed/action",
|
|
816
|
-
{ task_id: taskId, approved, feedback }
|
|
817
|
-
);
|
|
818
|
-
return { message: data.message ?? "" };
|
|
819
|
-
}
|
|
820
|
-
async wakeMio(taskId) {
|
|
821
|
-
const data = await this._post(
|
|
822
|
-
"/task/self_managed/wake",
|
|
823
|
-
{ task_id: taskId }
|
|
824
|
-
);
|
|
825
|
-
return { message: data.message ?? "" };
|
|
826
|
-
}
|
|
827
|
-
async sendMioUserAway(taskId) {
|
|
828
|
-
const data = await this._post(
|
|
829
|
-
"/task/self_managed/user_away",
|
|
830
|
-
{ task_id: taskId }
|
|
831
|
-
);
|
|
832
|
-
return { message: data.message ?? "" };
|
|
833
|
-
}
|
|
834
|
-
async markMioComplete(taskId) {
|
|
835
|
-
const data = await this._post(
|
|
836
|
-
"/task/self_managed/mark_complete",
|
|
837
|
-
{ task_id: taskId }
|
|
838
|
-
);
|
|
839
|
-
return { message: data.message ?? "" };
|
|
840
|
-
}
|
|
841
|
-
async markMioFailed(taskId) {
|
|
842
|
-
const data = await this._post(
|
|
843
|
-
"/task/self_managed/mark_failed",
|
|
844
|
-
{ task_id: taskId }
|
|
845
|
-
);
|
|
846
|
-
return { message: data.message ?? "" };
|
|
847
|
-
}
|
|
848
|
-
async archiveMio(taskId) {
|
|
849
|
-
const data = await this._post(
|
|
850
|
-
"/task/self_managed/archive",
|
|
851
|
-
{ task_id: taskId }
|
|
852
|
-
);
|
|
853
|
-
return { message: data.message ?? "" };
|
|
854
|
-
}
|
|
855
|
-
async getMioContext(taskId) {
|
|
856
|
-
const data = await this._get(
|
|
857
|
-
"/task/self_managed/context",
|
|
858
|
-
{ task_id: taskId }
|
|
859
|
-
);
|
|
860
|
-
return {
|
|
861
|
-
taskId: data.taskId ?? data.task_id ?? taskId,
|
|
862
|
-
modelId: data.modelId ?? data.model_id ?? "",
|
|
863
|
-
currentTokens: data.currentTokens ?? data.current_tokens ?? 0,
|
|
864
|
-
contextLimit: data.contextLimit ?? data.context_limit ?? 0,
|
|
865
|
-
usagePercentage: data.usagePercentage ?? data.usage_percentage ?? 0,
|
|
866
|
-
totalMessages: data.totalMessages ?? data.total_messages ?? 0,
|
|
867
|
-
activeMessages: data.activeMessages ?? data.active_messages ?? 0,
|
|
868
|
-
archivedMessages: data.archivedMessages ?? data.archived_messages ?? 0,
|
|
869
|
-
messagesWithoutTokenCount: data.messagesWithoutTokenCount ?? data.messages_without_token_count ?? 0
|
|
870
|
-
};
|
|
871
|
-
}
|
|
872
|
-
async getMioMemories(taskId, includeCommon) {
|
|
873
|
-
const data = await this._get(
|
|
874
|
-
"/task/self_managed/memories",
|
|
875
|
-
{ task_id: taskId, include_common: includeCommon }
|
|
876
|
-
);
|
|
877
|
-
return {
|
|
878
|
-
memories: data.memories ?? [],
|
|
879
|
-
total: data.total ?? 0
|
|
880
|
-
};
|
|
881
|
-
}
|
|
882
|
-
// ------------------------------------------------------------------
|
|
883
832
|
// Tools
|
|
884
833
|
// ------------------------------------------------------------------
|
|
885
834
|
async listTools() {
|
|
@@ -921,6 +870,63 @@ var OrchestratorAsync = class {
|
|
|
921
870
|
return this._get("/tools/validate");
|
|
922
871
|
}
|
|
923
872
|
// ------------------------------------------------------------------
|
|
873
|
+
// Skills
|
|
874
|
+
// ------------------------------------------------------------------
|
|
875
|
+
async listSkills() {
|
|
876
|
+
const data = await this._get("/skills");
|
|
877
|
+
const skills = (data.skills ?? []).map(
|
|
878
|
+
(s) => buildSkill(s)
|
|
879
|
+
);
|
|
880
|
+
return {
|
|
881
|
+
skills,
|
|
882
|
+
total: data.total ?? skills.length
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
async getSkill(skillId) {
|
|
886
|
+
const data = await this._get(`/skills/${skillId}`);
|
|
887
|
+
return buildSkill(data);
|
|
888
|
+
}
|
|
889
|
+
async createSkill(payload) {
|
|
890
|
+
const data = await this._post("/skills", payload);
|
|
891
|
+
return buildSkill(data);
|
|
892
|
+
}
|
|
893
|
+
async updateSkill(skillId, payload) {
|
|
894
|
+
const data = await this._put(
|
|
895
|
+
`/skills/${skillId}`,
|
|
896
|
+
payload
|
|
897
|
+
);
|
|
898
|
+
return buildSkill(data);
|
|
899
|
+
}
|
|
900
|
+
async deleteSkill(skillId) {
|
|
901
|
+
const data = await this._delete(
|
|
902
|
+
`/skills/${skillId}`
|
|
903
|
+
);
|
|
904
|
+
return {
|
|
905
|
+
deleted: data.deleted ?? false,
|
|
906
|
+
skillId: data.skillId ?? data.skill_id ?? 0
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
async addSkillMapping(skillId, payload) {
|
|
910
|
+
const data = await this._post(
|
|
911
|
+
`/skills/${skillId}/mappings`,
|
|
912
|
+
{
|
|
913
|
+
workflow_id: payload.workflowId,
|
|
914
|
+
...payload.variant ? { variant: payload.variant } : {},
|
|
915
|
+
...payload.requiredTool ? { required_tool: payload.requiredTool } : {}
|
|
916
|
+
}
|
|
917
|
+
);
|
|
918
|
+
return buildSkillMapping(data);
|
|
919
|
+
}
|
|
920
|
+
async deleteSkillMapping(skillId, mappingId) {
|
|
921
|
+
const data = await this._delete(
|
|
922
|
+
`/skills/${skillId}/mappings/${mappingId}`
|
|
923
|
+
);
|
|
924
|
+
return {
|
|
925
|
+
deleted: data.deleted ?? false,
|
|
926
|
+
mappingId: data.mappingId ?? data.mapping_id ?? 0
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
// ------------------------------------------------------------------
|
|
924
930
|
// Debug / Admin
|
|
925
931
|
// ------------------------------------------------------------------
|
|
926
932
|
async getWorkflowStates() {
|
|
@@ -1136,6 +1142,37 @@ var OrchestratorAsync = class {
|
|
|
1136
1142
|
}
|
|
1137
1143
|
return this._post("/configuration/system/settings", body);
|
|
1138
1144
|
}
|
|
1145
|
+
async getPromptMetadata() {
|
|
1146
|
+
return this._get("/configuration/prompt-metadata");
|
|
1147
|
+
}
|
|
1148
|
+
async updatePromptMetadata(patch) {
|
|
1149
|
+
const body = {};
|
|
1150
|
+
if (patch.companyName !== void 0) {
|
|
1151
|
+
body.company_name = patch.companyName;
|
|
1152
|
+
}
|
|
1153
|
+
if (patch.companyDescription !== void 0) {
|
|
1154
|
+
body.company_description = patch.companyDescription;
|
|
1155
|
+
}
|
|
1156
|
+
if (patch.agentName !== void 0) {
|
|
1157
|
+
body.agent_name = patch.agentName;
|
|
1158
|
+
}
|
|
1159
|
+
if (patch.personalityTraits !== void 0) {
|
|
1160
|
+
body.personality_traits = patch.personalityTraits;
|
|
1161
|
+
}
|
|
1162
|
+
if (patch.environmentInfo !== void 0) {
|
|
1163
|
+
body.environment_info = patch.environmentInfo;
|
|
1164
|
+
}
|
|
1165
|
+
if (patch.productName !== void 0) {
|
|
1166
|
+
body.product_name = patch.productName;
|
|
1167
|
+
}
|
|
1168
|
+
if (patch.contactChannels !== void 0) {
|
|
1169
|
+
body.contact_channels = patch.contactChannels;
|
|
1170
|
+
}
|
|
1171
|
+
return this._post(
|
|
1172
|
+
"/configuration/prompt-metadata",
|
|
1173
|
+
body
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1139
1176
|
async getConfigurationStatus() {
|
|
1140
1177
|
return this._get("/configuration/status");
|
|
1141
1178
|
}
|
|
@@ -1467,44 +1504,13 @@ var Orchestrator = class {
|
|
|
1467
1504
|
listVSATasks(userId, params) {
|
|
1468
1505
|
return runSync(this._async.listVSATasks(userId, params));
|
|
1469
1506
|
}
|
|
1470
|
-
searchVSATasks(userId, query, limit) {
|
|
1471
|
-
return runSync(this._async.searchVSATasks(userId, query, limit));
|
|
1507
|
+
searchVSATasks(userId, query, limit, offset) {
|
|
1508
|
+
return runSync(this._async.searchVSATasks(userId, query, limit, offset));
|
|
1472
1509
|
}
|
|
1473
1510
|
deleteVSATasksBulk(taskIds) {
|
|
1474
1511
|
return runSync(this._async.deleteVSATasksBulk(taskIds));
|
|
1475
1512
|
}
|
|
1476
1513
|
// ------------------------------------------------------------------
|
|
1477
|
-
// MIO (self_managed) workflow
|
|
1478
|
-
// ------------------------------------------------------------------
|
|
1479
|
-
sendMioMessage(taskId, message, attachmentIds) {
|
|
1480
|
-
return runSync(this._async.sendMioMessage(taskId, message, attachmentIds));
|
|
1481
|
-
}
|
|
1482
|
-
approveMioAction(taskId, approved = true, feedback) {
|
|
1483
|
-
return runSync(this._async.approveMioAction(taskId, approved, feedback));
|
|
1484
|
-
}
|
|
1485
|
-
wakeMio(taskId) {
|
|
1486
|
-
return runSync(this._async.wakeMio(taskId));
|
|
1487
|
-
}
|
|
1488
|
-
sendMioUserAway(taskId) {
|
|
1489
|
-
return runSync(this._async.sendMioUserAway(taskId));
|
|
1490
|
-
}
|
|
1491
|
-
markMioComplete(taskId) {
|
|
1492
|
-
return runSync(this._async.markMioComplete(taskId));
|
|
1493
|
-
}
|
|
1494
|
-
markMioFailed(taskId) {
|
|
1495
|
-
return runSync(this._async.markMioFailed(taskId));
|
|
1496
|
-
}
|
|
1497
|
-
archiveMio(taskId) {
|
|
1498
|
-
return runSync(this._async.archiveMio(taskId));
|
|
1499
|
-
}
|
|
1500
|
-
getMioContext(taskId) {
|
|
1501
|
-
return runSync(this._async.getMioContext(taskId));
|
|
1502
|
-
}
|
|
1503
|
-
getMioMemories(taskId, includeCommon) {
|
|
1504
|
-
return runSync(this._async.getMioMemories(taskId, includeCommon));
|
|
1505
|
-
}
|
|
1506
|
-
// ------------------------------------------------------------------
|
|
1507
|
-
// Tools
|
|
1508
1514
|
// ------------------------------------------------------------------
|
|
1509
1515
|
listTools() {
|
|
1510
1516
|
return runSync(this._async.listTools());
|
|
@@ -1521,6 +1527,27 @@ var Orchestrator = class {
|
|
|
1521
1527
|
validateToolCatalog() {
|
|
1522
1528
|
return runSync(this._async.validateToolCatalog());
|
|
1523
1529
|
}
|
|
1530
|
+
listSkills() {
|
|
1531
|
+
return runSync(this._async.listSkills());
|
|
1532
|
+
}
|
|
1533
|
+
getSkill(skillId) {
|
|
1534
|
+
return runSync(this._async.getSkill(skillId));
|
|
1535
|
+
}
|
|
1536
|
+
createSkill(payload) {
|
|
1537
|
+
return runSync(this._async.createSkill(payload));
|
|
1538
|
+
}
|
|
1539
|
+
updateSkill(skillId, payload) {
|
|
1540
|
+
return runSync(this._async.updateSkill(skillId, payload));
|
|
1541
|
+
}
|
|
1542
|
+
deleteSkill(skillId) {
|
|
1543
|
+
return runSync(this._async.deleteSkill(skillId));
|
|
1544
|
+
}
|
|
1545
|
+
addSkillMapping(skillId, payload) {
|
|
1546
|
+
return runSync(this._async.addSkillMapping(skillId, payload));
|
|
1547
|
+
}
|
|
1548
|
+
deleteSkillMapping(skillId, mappingId) {
|
|
1549
|
+
return runSync(this._async.deleteSkillMapping(skillId, mappingId));
|
|
1550
|
+
}
|
|
1524
1551
|
// ------------------------------------------------------------------
|
|
1525
1552
|
// Debug / Admin
|
|
1526
1553
|
// ------------------------------------------------------------------
|
|
@@ -1598,6 +1625,12 @@ var Orchestrator = class {
|
|
|
1598
1625
|
updateSettings(settings) {
|
|
1599
1626
|
return runSync(this._async.updateSettings(settings));
|
|
1600
1627
|
}
|
|
1628
|
+
getPromptMetadata() {
|
|
1629
|
+
return runSync(this._async.getPromptMetadata());
|
|
1630
|
+
}
|
|
1631
|
+
updatePromptMetadata(patch) {
|
|
1632
|
+
return runSync(this._async.updatePromptMetadata(patch));
|
|
1633
|
+
}
|
|
1601
1634
|
getConfigurationStatus() {
|
|
1602
1635
|
return runSync(this._async.getConfigurationStatus());
|
|
1603
1636
|
}
|