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 CHANGED
@@ -148,6 +148,27 @@ function buildPagination(data) {
148
148
  hasPrev: p.hasPrev ?? false
149
149
  };
150
150
  }
151
+ function buildSkillMapping(m) {
152
+ return {
153
+ id: m.id ?? 0,
154
+ workflowId: m.workflowId ?? m.workflow_id ?? "",
155
+ variant: m.variant ?? null,
156
+ requiredTool: m.requiredTool ?? m.required_tool ?? null
157
+ };
158
+ }
159
+ function buildSkill(s) {
160
+ return {
161
+ id: s.id ?? 0,
162
+ name: s.name ?? "",
163
+ description: s.description ?? "",
164
+ content: s.content ?? "",
165
+ createdAt: s.createdAt ?? s.created_at ?? "",
166
+ updatedAt: s.updatedAt ?? s.updated_at ?? "",
167
+ mappings: (s.mappings ?? []).map(
168
+ (m) => buildSkillMapping(m)
169
+ )
170
+ };
171
+ }
151
172
  function buildTaskSummary(t) {
152
173
  return {
153
174
  id: t.id ?? "",
@@ -161,11 +182,23 @@ function buildTaskSummary(t) {
161
182
  approvalReason: t.approvalReason ?? "",
162
183
  ticketId: t.ticketId ?? null,
163
184
  availableTools: t.availableTools ?? null,
185
+ skills: t.skills ?? null,
164
186
  insight: t.insight ?? null,
165
187
  insightLocalized: t.insightLocalized ?? null,
166
188
  createdAt: t.createdAt ?? "",
167
189
  updatedAt: t.updatedAt ?? "",
168
- pendingTranslationsForLocales: t.pendingTranslationsForLocales ?? null
190
+ pendingTranslationsForLocales: t.pendingTranslationsForLocales ?? null,
191
+ workflowData: t.workflowData ?? null
192
+ };
193
+ }
194
+ function buildVsaTaskList(data) {
195
+ const raw = Array.isArray(data) ? data : data.tasks ?? [];
196
+ const tasks = raw.map(
197
+ (item) => typeof item === "string" ? { id: item } : buildTaskSummary(item)
198
+ );
199
+ return {
200
+ tasks,
201
+ pagination: buildPagination(data ?? {})
169
202
  };
170
203
  }
171
204
  function parseApiErrorBody(body, fallbackMessage) {
@@ -840,21 +873,16 @@ var OrchestratorAsync = class {
840
873
  limit: params?.limit,
841
874
  offset: params?.offset
842
875
  });
843
- const tasks = (data.tasks ?? []).map(
844
- buildTaskSummary
845
- );
846
- return { tasks, pagination: buildPagination(data) };
876
+ return buildVsaTaskList(data);
847
877
  }
848
- async searchVSATasks(userId, query, limit) {
878
+ async searchVSATasks(userId, query, limit, offset) {
849
879
  const data = await this._get("/task/vsa/search", {
850
880
  user_id: userId,
851
881
  query,
852
- limit
882
+ limit,
883
+ offset
853
884
  });
854
- const tasks = (data.tasks ?? []).map(
855
- buildTaskSummary
856
- );
857
- return { tasks, pagination: buildPagination(data) };
885
+ return buildVsaTaskList(data);
858
886
  }
859
887
  async deleteVSATasksBulk(taskIds) {
860
888
  const data = await this._post(
@@ -869,85 +897,6 @@ var OrchestratorAsync = class {
869
897
  };
870
898
  }
871
899
  // ------------------------------------------------------------------
872
- // MIO (self_managed) workflow
873
- // ------------------------------------------------------------------
874
- async sendMioMessage(taskId, message, attachmentIds) {
875
- const data = await this._post(
876
- "/task/self_managed/message",
877
- { task_id: taskId, message, attachment_ids: attachmentIds }
878
- );
879
- return { message: data.message ?? "" };
880
- }
881
- async approveMioAction(taskId, approved = true, feedback) {
882
- const data = await this._post(
883
- "/task/self_managed/action",
884
- { task_id: taskId, approved, feedback }
885
- );
886
- return { message: data.message ?? "" };
887
- }
888
- async wakeMio(taskId) {
889
- const data = await this._post(
890
- "/task/self_managed/wake",
891
- { task_id: taskId }
892
- );
893
- return { message: data.message ?? "" };
894
- }
895
- async sendMioUserAway(taskId) {
896
- const data = await this._post(
897
- "/task/self_managed/user_away",
898
- { task_id: taskId }
899
- );
900
- return { message: data.message ?? "" };
901
- }
902
- async markMioComplete(taskId) {
903
- const data = await this._post(
904
- "/task/self_managed/mark_complete",
905
- { task_id: taskId }
906
- );
907
- return { message: data.message ?? "" };
908
- }
909
- async markMioFailed(taskId) {
910
- const data = await this._post(
911
- "/task/self_managed/mark_failed",
912
- { task_id: taskId }
913
- );
914
- return { message: data.message ?? "" };
915
- }
916
- async archiveMio(taskId) {
917
- const data = await this._post(
918
- "/task/self_managed/archive",
919
- { task_id: taskId }
920
- );
921
- return { message: data.message ?? "" };
922
- }
923
- async getMioContext(taskId) {
924
- const data = await this._get(
925
- "/task/self_managed/context",
926
- { task_id: taskId }
927
- );
928
- return {
929
- taskId: data.taskId ?? data.task_id ?? taskId,
930
- modelId: data.modelId ?? data.model_id ?? "",
931
- currentTokens: data.currentTokens ?? data.current_tokens ?? 0,
932
- contextLimit: data.contextLimit ?? data.context_limit ?? 0,
933
- usagePercentage: data.usagePercentage ?? data.usage_percentage ?? 0,
934
- totalMessages: data.totalMessages ?? data.total_messages ?? 0,
935
- activeMessages: data.activeMessages ?? data.active_messages ?? 0,
936
- archivedMessages: data.archivedMessages ?? data.archived_messages ?? 0,
937
- messagesWithoutTokenCount: data.messagesWithoutTokenCount ?? data.messages_without_token_count ?? 0
938
- };
939
- }
940
- async getMioMemories(taskId, includeCommon) {
941
- const data = await this._get(
942
- "/task/self_managed/memories",
943
- { task_id: taskId, include_common: includeCommon }
944
- );
945
- return {
946
- memories: data.memories ?? [],
947
- total: data.total ?? 0
948
- };
949
- }
950
- // ------------------------------------------------------------------
951
900
  // Tools
952
901
  // ------------------------------------------------------------------
953
902
  async listTools() {
@@ -989,6 +938,63 @@ var OrchestratorAsync = class {
989
938
  return this._get("/tools/validate");
990
939
  }
991
940
  // ------------------------------------------------------------------
941
+ // Skills
942
+ // ------------------------------------------------------------------
943
+ async listSkills() {
944
+ const data = await this._get("/skills");
945
+ const skills = (data.skills ?? []).map(
946
+ (s) => buildSkill(s)
947
+ );
948
+ return {
949
+ skills,
950
+ total: data.total ?? skills.length
951
+ };
952
+ }
953
+ async getSkill(skillId) {
954
+ const data = await this._get(`/skills/${skillId}`);
955
+ return buildSkill(data);
956
+ }
957
+ async createSkill(payload) {
958
+ const data = await this._post("/skills", payload);
959
+ return buildSkill(data);
960
+ }
961
+ async updateSkill(skillId, payload) {
962
+ const data = await this._put(
963
+ `/skills/${skillId}`,
964
+ payload
965
+ );
966
+ return buildSkill(data);
967
+ }
968
+ async deleteSkill(skillId) {
969
+ const data = await this._delete(
970
+ `/skills/${skillId}`
971
+ );
972
+ return {
973
+ deleted: data.deleted ?? false,
974
+ skillId: data.skillId ?? data.skill_id ?? 0
975
+ };
976
+ }
977
+ async addSkillMapping(skillId, payload) {
978
+ const data = await this._post(
979
+ `/skills/${skillId}/mappings`,
980
+ {
981
+ workflow_id: payload.workflowId,
982
+ ...payload.variant ? { variant: payload.variant } : {},
983
+ ...payload.requiredTool ? { required_tool: payload.requiredTool } : {}
984
+ }
985
+ );
986
+ return buildSkillMapping(data);
987
+ }
988
+ async deleteSkillMapping(skillId, mappingId) {
989
+ const data = await this._delete(
990
+ `/skills/${skillId}/mappings/${mappingId}`
991
+ );
992
+ return {
993
+ deleted: data.deleted ?? false,
994
+ mappingId: data.mappingId ?? data.mapping_id ?? 0
995
+ };
996
+ }
997
+ // ------------------------------------------------------------------
992
998
  // Debug / Admin
993
999
  // ------------------------------------------------------------------
994
1000
  async getWorkflowStates() {
@@ -1204,6 +1210,37 @@ var OrchestratorAsync = class {
1204
1210
  }
1205
1211
  return this._post("/configuration/system/settings", body);
1206
1212
  }
1213
+ async getPromptMetadata() {
1214
+ return this._get("/configuration/prompt-metadata");
1215
+ }
1216
+ async updatePromptMetadata(patch) {
1217
+ const body = {};
1218
+ if (patch.companyName !== void 0) {
1219
+ body.company_name = patch.companyName;
1220
+ }
1221
+ if (patch.companyDescription !== void 0) {
1222
+ body.company_description = patch.companyDescription;
1223
+ }
1224
+ if (patch.agentName !== void 0) {
1225
+ body.agent_name = patch.agentName;
1226
+ }
1227
+ if (patch.personalityTraits !== void 0) {
1228
+ body.personality_traits = patch.personalityTraits;
1229
+ }
1230
+ if (patch.environmentInfo !== void 0) {
1231
+ body.environment_info = patch.environmentInfo;
1232
+ }
1233
+ if (patch.productName !== void 0) {
1234
+ body.product_name = patch.productName;
1235
+ }
1236
+ if (patch.contactChannels !== void 0) {
1237
+ body.contact_channels = patch.contactChannels;
1238
+ }
1239
+ return this._post(
1240
+ "/configuration/prompt-metadata",
1241
+ body
1242
+ );
1243
+ }
1207
1244
  async getConfigurationStatus() {
1208
1245
  return this._get("/configuration/status");
1209
1246
  }
@@ -1535,44 +1572,13 @@ var Orchestrator = class {
1535
1572
  listVSATasks(userId, params) {
1536
1573
  return runSync(this._async.listVSATasks(userId, params));
1537
1574
  }
1538
- searchVSATasks(userId, query, limit) {
1539
- return runSync(this._async.searchVSATasks(userId, query, limit));
1575
+ searchVSATasks(userId, query, limit, offset) {
1576
+ return runSync(this._async.searchVSATasks(userId, query, limit, offset));
1540
1577
  }
1541
1578
  deleteVSATasksBulk(taskIds) {
1542
1579
  return runSync(this._async.deleteVSATasksBulk(taskIds));
1543
1580
  }
1544
1581
  // ------------------------------------------------------------------
1545
- // MIO (self_managed) workflow
1546
- // ------------------------------------------------------------------
1547
- sendMioMessage(taskId, message, attachmentIds) {
1548
- return runSync(this._async.sendMioMessage(taskId, message, attachmentIds));
1549
- }
1550
- approveMioAction(taskId, approved = true, feedback) {
1551
- return runSync(this._async.approveMioAction(taskId, approved, feedback));
1552
- }
1553
- wakeMio(taskId) {
1554
- return runSync(this._async.wakeMio(taskId));
1555
- }
1556
- sendMioUserAway(taskId) {
1557
- return runSync(this._async.sendMioUserAway(taskId));
1558
- }
1559
- markMioComplete(taskId) {
1560
- return runSync(this._async.markMioComplete(taskId));
1561
- }
1562
- markMioFailed(taskId) {
1563
- return runSync(this._async.markMioFailed(taskId));
1564
- }
1565
- archiveMio(taskId) {
1566
- return runSync(this._async.archiveMio(taskId));
1567
- }
1568
- getMioContext(taskId) {
1569
- return runSync(this._async.getMioContext(taskId));
1570
- }
1571
- getMioMemories(taskId, includeCommon) {
1572
- return runSync(this._async.getMioMemories(taskId, includeCommon));
1573
- }
1574
- // ------------------------------------------------------------------
1575
- // Tools
1576
1582
  // ------------------------------------------------------------------
1577
1583
  listTools() {
1578
1584
  return runSync(this._async.listTools());
@@ -1589,6 +1595,27 @@ var Orchestrator = class {
1589
1595
  validateToolCatalog() {
1590
1596
  return runSync(this._async.validateToolCatalog());
1591
1597
  }
1598
+ listSkills() {
1599
+ return runSync(this._async.listSkills());
1600
+ }
1601
+ getSkill(skillId) {
1602
+ return runSync(this._async.getSkill(skillId));
1603
+ }
1604
+ createSkill(payload) {
1605
+ return runSync(this._async.createSkill(payload));
1606
+ }
1607
+ updateSkill(skillId, payload) {
1608
+ return runSync(this._async.updateSkill(skillId, payload));
1609
+ }
1610
+ deleteSkill(skillId) {
1611
+ return runSync(this._async.deleteSkill(skillId));
1612
+ }
1613
+ addSkillMapping(skillId, payload) {
1614
+ return runSync(this._async.addSkillMapping(skillId, payload));
1615
+ }
1616
+ deleteSkillMapping(skillId, mappingId) {
1617
+ return runSync(this._async.deleteSkillMapping(skillId, mappingId));
1618
+ }
1592
1619
  // ------------------------------------------------------------------
1593
1620
  // Debug / Admin
1594
1621
  // ------------------------------------------------------------------
@@ -1666,6 +1693,12 @@ var Orchestrator = class {
1666
1693
  updateSettings(settings) {
1667
1694
  return runSync(this._async.updateSettings(settings));
1668
1695
  }
1696
+ getPromptMetadata() {
1697
+ return runSync(this._async.getPromptMetadata());
1698
+ }
1699
+ updatePromptMetadata(patch) {
1700
+ return runSync(this._async.updatePromptMetadata(patch));
1701
+ }
1669
1702
  getConfigurationStatus() {
1670
1703
  return runSync(this._async.getConfigurationStatus());
1671
1704
  }