orchestrator-client 5.12.0 → 5.12.3

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
@@ -162,10 +162,20 @@ function buildSkillMapping(m) {
162
162
  requiredTool: m.requiredTool ?? m.required_tool ?? null
163
163
  };
164
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
+ }
165
174
  function buildSkill(s) {
166
175
  return {
167
176
  id: s.id ?? 0,
168
177
  name: s.name ?? "",
178
+ user_id: s.userId ?? s.user_id ?? null,
169
179
  description: s.description ?? "",
170
180
  content: s.content ?? "",
171
181
  createdAt: s.createdAt ?? s.created_at ?? "",
@@ -1001,6 +1011,105 @@ var OrchestratorAsync = class {
1001
1011
  };
1002
1012
  }
1003
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
+ // ------------------------------------------------------------------
1004
1113
  // Debug / Admin
1005
1114
  // ------------------------------------------------------------------
1006
1115
  async getWorkflowStates() {
@@ -1625,6 +1734,36 @@ var Orchestrator = class {
1625
1734
  deleteSkillMapping(skillId, mappingId) {
1626
1735
  return runSync(this._async.deleteSkillMapping(skillId, mappingId));
1627
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
+ }
1628
1767
  // ------------------------------------------------------------------
1629
1768
  // Debug / Admin
1630
1769
  // ------------------------------------------------------------------