orchestrator-client 5.12.0 → 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 +139 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +69 -1
- package/dist/index.d.ts +69 -1
- package/dist/index.js +139 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
/** A single profile/memory entry (decrypted content). */
|
|
2
|
+
interface ProfileEntry {
|
|
3
|
+
id: number;
|
|
4
|
+
docType: "profile" | "memory";
|
|
5
|
+
content: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
updatedAt: string;
|
|
8
|
+
}
|
|
9
|
+
/** Result of `GET /profiles/{userId}/entries`. */
|
|
10
|
+
interface ProfileEntryListResult {
|
|
11
|
+
entries: ProfileEntry[];
|
|
12
|
+
total: number;
|
|
13
|
+
}
|
|
14
|
+
/** Payload for `POST /profiles/{userId}/entries`. */
|
|
15
|
+
interface ProfileEntryCreatePayload {
|
|
16
|
+
docType: "profile" | "memory";
|
|
17
|
+
content: string;
|
|
18
|
+
}
|
|
19
|
+
/** Per-entry length in a usage listing. */
|
|
20
|
+
interface ProfileUsageEntry {
|
|
21
|
+
id: number;
|
|
22
|
+
length: number;
|
|
23
|
+
}
|
|
24
|
+
/** Result of `GET /profiles/{userId}/usage`. */
|
|
25
|
+
interface ProfileUsageResult {
|
|
26
|
+
usedChars: number;
|
|
27
|
+
maxChars: number;
|
|
28
|
+
entries: ProfileUsageEntry[];
|
|
29
|
+
}
|
|
30
|
+
/** Result of `DELETE /profiles/{userId}/entries/{entryId}`. */
|
|
31
|
+
interface ProfileEntryDeleteResult {
|
|
32
|
+
deleted: boolean;
|
|
33
|
+
entryId: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
1
36
|
interface Pagination$1 {
|
|
2
37
|
currentPage: number;
|
|
3
38
|
perPage: number;
|
|
@@ -29,10 +64,11 @@ interface TaskSummary {
|
|
|
29
64
|
approvalReason: string;
|
|
30
65
|
ticketId: string | null;
|
|
31
66
|
availableTools: string[] | null;
|
|
32
|
-
/** Resolved skill references (name + description snapshot) at creation. */
|
|
67
|
+
/** Resolved skill references (name + description + user_id snapshot) at creation; user_id is null for system skills. */
|
|
33
68
|
skills: {
|
|
34
69
|
name: string;
|
|
35
70
|
description: string;
|
|
71
|
+
user_id: string | null;
|
|
36
72
|
}[] | null;
|
|
37
73
|
insight: string | null;
|
|
38
74
|
insightLocalized: string | null;
|
|
@@ -483,6 +519,8 @@ interface SkillMapping {
|
|
|
483
519
|
interface Skill {
|
|
484
520
|
id: number;
|
|
485
521
|
name: string;
|
|
522
|
+
/** Owner: null = system skill, set = personal skill. */
|
|
523
|
+
user_id: string | null;
|
|
486
524
|
description: string;
|
|
487
525
|
content: string;
|
|
488
526
|
createdAt: string;
|
|
@@ -789,6 +827,23 @@ declare class OrchestratorAsync {
|
|
|
789
827
|
deleted: boolean;
|
|
790
828
|
mappingId: number;
|
|
791
829
|
}>;
|
|
830
|
+
listPersonalSkills(userId: string): Promise<SkillsListResult>;
|
|
831
|
+
createPersonalSkill(userId: string, payload: SkillCreatePayload): Promise<Skill>;
|
|
832
|
+
updatePersonalSkill(userId: string, skillName: string, payload: SkillUpdatePayload): Promise<Skill>;
|
|
833
|
+
deletePersonalSkill(userId: string, skillName: string): Promise<{
|
|
834
|
+
deleted: boolean;
|
|
835
|
+
skillId: number;
|
|
836
|
+
}>;
|
|
837
|
+
listProfileUsers(params?: {
|
|
838
|
+
query?: string;
|
|
839
|
+
limit?: number;
|
|
840
|
+
offset?: number;
|
|
841
|
+
}): Promise<string[]>;
|
|
842
|
+
listProfileEntries(userId: string, docType?: "profile" | "memory"): Promise<ProfileEntryListResult>;
|
|
843
|
+
getProfileUsage(userId: string, docType?: "profile" | "memory"): Promise<ProfileUsageResult>;
|
|
844
|
+
createProfileEntry(userId: string, payload: ProfileEntryCreatePayload): Promise<ProfileEntry>;
|
|
845
|
+
replaceProfileEntry(userId: string, entryId: number, content: string): Promise<ProfileEntry>;
|
|
846
|
+
deleteProfileEntry(userId: string, entryId: number): Promise<ProfileEntryDeleteResult>;
|
|
792
847
|
getWorkflowStates(): Promise<WorkflowStates>;
|
|
793
848
|
updateTaskModels(taskId: string, models: {
|
|
794
849
|
agentModelId?: string;
|
|
@@ -934,6 +989,19 @@ declare class Orchestrator {
|
|
|
934
989
|
deleted: boolean;
|
|
935
990
|
mappingId: number;
|
|
936
991
|
};
|
|
992
|
+
listPersonalSkills(userId: string): SkillsListResult;
|
|
993
|
+
createPersonalSkill(userId: string, payload: Parameters<OrchestratorAsync["createPersonalSkill"]>[1]): Skill;
|
|
994
|
+
updatePersonalSkill(userId: string, skillName: string, payload: Parameters<OrchestratorAsync["updatePersonalSkill"]>[2]): Skill;
|
|
995
|
+
deletePersonalSkill(userId: string, skillName: string): {
|
|
996
|
+
deleted: boolean;
|
|
997
|
+
skillId: number;
|
|
998
|
+
};
|
|
999
|
+
listProfileUsers(params?: Parameters<OrchestratorAsync["listProfileUsers"]>[0]): string[];
|
|
1000
|
+
listProfileEntries(userId: string, docType?: "profile" | "memory"): ProfileEntryListResult;
|
|
1001
|
+
getProfileUsage(userId: string, docType?: "profile" | "memory"): ProfileUsageResult;
|
|
1002
|
+
createProfileEntry(userId: string, payload: Parameters<OrchestratorAsync["createProfileEntry"]>[1]): ProfileEntry;
|
|
1003
|
+
replaceProfileEntry(userId: string, entryId: number, content: string): ProfileEntry;
|
|
1004
|
+
deleteProfileEntry(userId: string, entryId: number): ProfileEntryDeleteResult;
|
|
937
1005
|
getWorkflowStates(): WorkflowStates;
|
|
938
1006
|
updateTaskModels(taskId: string, models: {
|
|
939
1007
|
agentModelId?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
/** A single profile/memory entry (decrypted content). */
|
|
2
|
+
interface ProfileEntry {
|
|
3
|
+
id: number;
|
|
4
|
+
docType: "profile" | "memory";
|
|
5
|
+
content: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
updatedAt: string;
|
|
8
|
+
}
|
|
9
|
+
/** Result of `GET /profiles/{userId}/entries`. */
|
|
10
|
+
interface ProfileEntryListResult {
|
|
11
|
+
entries: ProfileEntry[];
|
|
12
|
+
total: number;
|
|
13
|
+
}
|
|
14
|
+
/** Payload for `POST /profiles/{userId}/entries`. */
|
|
15
|
+
interface ProfileEntryCreatePayload {
|
|
16
|
+
docType: "profile" | "memory";
|
|
17
|
+
content: string;
|
|
18
|
+
}
|
|
19
|
+
/** Per-entry length in a usage listing. */
|
|
20
|
+
interface ProfileUsageEntry {
|
|
21
|
+
id: number;
|
|
22
|
+
length: number;
|
|
23
|
+
}
|
|
24
|
+
/** Result of `GET /profiles/{userId}/usage`. */
|
|
25
|
+
interface ProfileUsageResult {
|
|
26
|
+
usedChars: number;
|
|
27
|
+
maxChars: number;
|
|
28
|
+
entries: ProfileUsageEntry[];
|
|
29
|
+
}
|
|
30
|
+
/** Result of `DELETE /profiles/{userId}/entries/{entryId}`. */
|
|
31
|
+
interface ProfileEntryDeleteResult {
|
|
32
|
+
deleted: boolean;
|
|
33
|
+
entryId: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
1
36
|
interface Pagination$1 {
|
|
2
37
|
currentPage: number;
|
|
3
38
|
perPage: number;
|
|
@@ -29,10 +64,11 @@ interface TaskSummary {
|
|
|
29
64
|
approvalReason: string;
|
|
30
65
|
ticketId: string | null;
|
|
31
66
|
availableTools: string[] | null;
|
|
32
|
-
/** Resolved skill references (name + description snapshot) at creation. */
|
|
67
|
+
/** Resolved skill references (name + description + user_id snapshot) at creation; user_id is null for system skills. */
|
|
33
68
|
skills: {
|
|
34
69
|
name: string;
|
|
35
70
|
description: string;
|
|
71
|
+
user_id: string | null;
|
|
36
72
|
}[] | null;
|
|
37
73
|
insight: string | null;
|
|
38
74
|
insightLocalized: string | null;
|
|
@@ -483,6 +519,8 @@ interface SkillMapping {
|
|
|
483
519
|
interface Skill {
|
|
484
520
|
id: number;
|
|
485
521
|
name: string;
|
|
522
|
+
/** Owner: null = system skill, set = personal skill. */
|
|
523
|
+
user_id: string | null;
|
|
486
524
|
description: string;
|
|
487
525
|
content: string;
|
|
488
526
|
createdAt: string;
|
|
@@ -789,6 +827,23 @@ declare class OrchestratorAsync {
|
|
|
789
827
|
deleted: boolean;
|
|
790
828
|
mappingId: number;
|
|
791
829
|
}>;
|
|
830
|
+
listPersonalSkills(userId: string): Promise<SkillsListResult>;
|
|
831
|
+
createPersonalSkill(userId: string, payload: SkillCreatePayload): Promise<Skill>;
|
|
832
|
+
updatePersonalSkill(userId: string, skillName: string, payload: SkillUpdatePayload): Promise<Skill>;
|
|
833
|
+
deletePersonalSkill(userId: string, skillName: string): Promise<{
|
|
834
|
+
deleted: boolean;
|
|
835
|
+
skillId: number;
|
|
836
|
+
}>;
|
|
837
|
+
listProfileUsers(params?: {
|
|
838
|
+
query?: string;
|
|
839
|
+
limit?: number;
|
|
840
|
+
offset?: number;
|
|
841
|
+
}): Promise<string[]>;
|
|
842
|
+
listProfileEntries(userId: string, docType?: "profile" | "memory"): Promise<ProfileEntryListResult>;
|
|
843
|
+
getProfileUsage(userId: string, docType?: "profile" | "memory"): Promise<ProfileUsageResult>;
|
|
844
|
+
createProfileEntry(userId: string, payload: ProfileEntryCreatePayload): Promise<ProfileEntry>;
|
|
845
|
+
replaceProfileEntry(userId: string, entryId: number, content: string): Promise<ProfileEntry>;
|
|
846
|
+
deleteProfileEntry(userId: string, entryId: number): Promise<ProfileEntryDeleteResult>;
|
|
792
847
|
getWorkflowStates(): Promise<WorkflowStates>;
|
|
793
848
|
updateTaskModels(taskId: string, models: {
|
|
794
849
|
agentModelId?: string;
|
|
@@ -934,6 +989,19 @@ declare class Orchestrator {
|
|
|
934
989
|
deleted: boolean;
|
|
935
990
|
mappingId: number;
|
|
936
991
|
};
|
|
992
|
+
listPersonalSkills(userId: string): SkillsListResult;
|
|
993
|
+
createPersonalSkill(userId: string, payload: Parameters<OrchestratorAsync["createPersonalSkill"]>[1]): Skill;
|
|
994
|
+
updatePersonalSkill(userId: string, skillName: string, payload: Parameters<OrchestratorAsync["updatePersonalSkill"]>[2]): Skill;
|
|
995
|
+
deletePersonalSkill(userId: string, skillName: string): {
|
|
996
|
+
deleted: boolean;
|
|
997
|
+
skillId: number;
|
|
998
|
+
};
|
|
999
|
+
listProfileUsers(params?: Parameters<OrchestratorAsync["listProfileUsers"]>[0]): string[];
|
|
1000
|
+
listProfileEntries(userId: string, docType?: "profile" | "memory"): ProfileEntryListResult;
|
|
1001
|
+
getProfileUsage(userId: string, docType?: "profile" | "memory"): ProfileUsageResult;
|
|
1002
|
+
createProfileEntry(userId: string, payload: Parameters<OrchestratorAsync["createProfileEntry"]>[1]): ProfileEntry;
|
|
1003
|
+
replaceProfileEntry(userId: string, entryId: number, content: string): ProfileEntry;
|
|
1004
|
+
deleteProfileEntry(userId: string, entryId: number): ProfileEntryDeleteResult;
|
|
937
1005
|
getWorkflowStates(): WorkflowStates;
|
|
938
1006
|
updateTaskModels(taskId: string, models: {
|
|
939
1007
|
agentModelId?: string;
|
package/dist/index.js
CHANGED
|
@@ -94,10 +94,20 @@ function buildSkillMapping(m) {
|
|
|
94
94
|
requiredTool: m.requiredTool ?? m.required_tool ?? null
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
+
function buildProfileEntry(e) {
|
|
98
|
+
return {
|
|
99
|
+
id: e.id ?? 0,
|
|
100
|
+
docType: e.docType ?? e.doc_type ?? "memory",
|
|
101
|
+
content: e.content ?? "",
|
|
102
|
+
createdAt: e.createdAt ?? e.created_at ?? "",
|
|
103
|
+
updatedAt: e.updatedAt ?? e.updated_at ?? ""
|
|
104
|
+
};
|
|
105
|
+
}
|
|
97
106
|
function buildSkill(s) {
|
|
98
107
|
return {
|
|
99
108
|
id: s.id ?? 0,
|
|
100
109
|
name: s.name ?? "",
|
|
110
|
+
user_id: s.userId ?? s.user_id ?? null,
|
|
101
111
|
description: s.description ?? "",
|
|
102
112
|
content: s.content ?? "",
|
|
103
113
|
createdAt: s.createdAt ?? s.created_at ?? "",
|
|
@@ -933,6 +943,105 @@ var OrchestratorAsync = class {
|
|
|
933
943
|
};
|
|
934
944
|
}
|
|
935
945
|
// ------------------------------------------------------------------
|
|
946
|
+
// Personal skills (#789) — per-user ownership
|
|
947
|
+
// ------------------------------------------------------------------
|
|
948
|
+
async listPersonalSkills(userId) {
|
|
949
|
+
const data = await this._get(
|
|
950
|
+
`/profiles/${userId}/skills`
|
|
951
|
+
);
|
|
952
|
+
const skills = (data.skills ?? []).map(
|
|
953
|
+
(s) => buildSkill(s)
|
|
954
|
+
);
|
|
955
|
+
return {
|
|
956
|
+
skills,
|
|
957
|
+
total: data.total ?? skills.length
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
async createPersonalSkill(userId, payload) {
|
|
961
|
+
const data = await this._post(
|
|
962
|
+
`/profiles/${userId}/skills`,
|
|
963
|
+
payload
|
|
964
|
+
);
|
|
965
|
+
return buildSkill(data);
|
|
966
|
+
}
|
|
967
|
+
async updatePersonalSkill(userId, skillName, payload) {
|
|
968
|
+
const data = await this._put(
|
|
969
|
+
`/profiles/${userId}/skills/${skillName}`,
|
|
970
|
+
payload
|
|
971
|
+
);
|
|
972
|
+
return buildSkill(data);
|
|
973
|
+
}
|
|
974
|
+
async deletePersonalSkill(userId, skillName) {
|
|
975
|
+
const data = await this._delete(
|
|
976
|
+
`/profiles/${userId}/skills/${skillName}`
|
|
977
|
+
);
|
|
978
|
+
return {
|
|
979
|
+
deleted: data.deleted ?? false,
|
|
980
|
+
skillId: data.skillId ?? data.skill_id ?? 0
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
// ------------------------------------------------------------------
|
|
984
|
+
// Profile/memory entries (#788)
|
|
985
|
+
// ------------------------------------------------------------------
|
|
986
|
+
async listProfileUsers(params) {
|
|
987
|
+
const data = await this._get("/profiles/users", {
|
|
988
|
+
query: params?.query,
|
|
989
|
+
limit: params?.limit,
|
|
990
|
+
offset: params?.offset
|
|
991
|
+
});
|
|
992
|
+
return data ?? [];
|
|
993
|
+
}
|
|
994
|
+
async listProfileEntries(userId, docType) {
|
|
995
|
+
const data = await this._get(
|
|
996
|
+
`/profiles/${userId}/entries`,
|
|
997
|
+
docType ? { doc_type: docType } : void 0
|
|
998
|
+
);
|
|
999
|
+
const entries = (data.entries ?? []).map(
|
|
1000
|
+
(e) => buildProfileEntry(e)
|
|
1001
|
+
);
|
|
1002
|
+
return {
|
|
1003
|
+
entries,
|
|
1004
|
+
total: data.total ?? entries.length
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
async getProfileUsage(userId, docType = "profile") {
|
|
1008
|
+
const data = await this._get(`/profiles/${userId}/usage`, { doc_type: docType });
|
|
1009
|
+
return {
|
|
1010
|
+
usedChars: data.usedChars ?? 0,
|
|
1011
|
+
maxChars: data.maxChars ?? 0,
|
|
1012
|
+
entries: (data.entries ?? []).map(
|
|
1013
|
+
(e) => ({
|
|
1014
|
+
id: e.id ?? 0,
|
|
1015
|
+
length: e.length ?? 0
|
|
1016
|
+
})
|
|
1017
|
+
)
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
async createProfileEntry(userId, payload) {
|
|
1021
|
+
const data = await this._post(
|
|
1022
|
+
`/profiles/${userId}/entries`,
|
|
1023
|
+
{ doc_type: payload.docType, content: payload.content }
|
|
1024
|
+
);
|
|
1025
|
+
return buildProfileEntry(data);
|
|
1026
|
+
}
|
|
1027
|
+
async replaceProfileEntry(userId, entryId, content) {
|
|
1028
|
+
const data = await this._request(
|
|
1029
|
+
"PATCH",
|
|
1030
|
+
`/profiles/${userId}/entries/${entryId}`,
|
|
1031
|
+
{ jsonBody: { content } }
|
|
1032
|
+
);
|
|
1033
|
+
return buildProfileEntry(data);
|
|
1034
|
+
}
|
|
1035
|
+
async deleteProfileEntry(userId, entryId) {
|
|
1036
|
+
const data = await this._delete(
|
|
1037
|
+
`/profiles/${userId}/entries/${entryId}`
|
|
1038
|
+
);
|
|
1039
|
+
return {
|
|
1040
|
+
deleted: data.deleted ?? false,
|
|
1041
|
+
entryId: data.entryId ?? data.entry_id ?? 0
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
// ------------------------------------------------------------------
|
|
936
1045
|
// Debug / Admin
|
|
937
1046
|
// ------------------------------------------------------------------
|
|
938
1047
|
async getWorkflowStates() {
|
|
@@ -1557,6 +1666,36 @@ var Orchestrator = class {
|
|
|
1557
1666
|
deleteSkillMapping(skillId, mappingId) {
|
|
1558
1667
|
return runSync(this._async.deleteSkillMapping(skillId, mappingId));
|
|
1559
1668
|
}
|
|
1669
|
+
listPersonalSkills(userId) {
|
|
1670
|
+
return runSync(this._async.listPersonalSkills(userId));
|
|
1671
|
+
}
|
|
1672
|
+
createPersonalSkill(userId, payload) {
|
|
1673
|
+
return runSync(this._async.createPersonalSkill(userId, payload));
|
|
1674
|
+
}
|
|
1675
|
+
updatePersonalSkill(userId, skillName, payload) {
|
|
1676
|
+
return runSync(this._async.updatePersonalSkill(userId, skillName, payload));
|
|
1677
|
+
}
|
|
1678
|
+
deletePersonalSkill(userId, skillName) {
|
|
1679
|
+
return runSync(this._async.deletePersonalSkill(userId, skillName));
|
|
1680
|
+
}
|
|
1681
|
+
listProfileUsers(params) {
|
|
1682
|
+
return runSync(this._async.listProfileUsers(params));
|
|
1683
|
+
}
|
|
1684
|
+
listProfileEntries(userId, docType) {
|
|
1685
|
+
return runSync(this._async.listProfileEntries(userId, docType));
|
|
1686
|
+
}
|
|
1687
|
+
getProfileUsage(userId, docType = "profile") {
|
|
1688
|
+
return runSync(this._async.getProfileUsage(userId, docType));
|
|
1689
|
+
}
|
|
1690
|
+
createProfileEntry(userId, payload) {
|
|
1691
|
+
return runSync(this._async.createProfileEntry(userId, payload));
|
|
1692
|
+
}
|
|
1693
|
+
replaceProfileEntry(userId, entryId, content) {
|
|
1694
|
+
return runSync(this._async.replaceProfileEntry(userId, entryId, content));
|
|
1695
|
+
}
|
|
1696
|
+
deleteProfileEntry(userId, entryId) {
|
|
1697
|
+
return runSync(this._async.deleteProfileEntry(userId, entryId));
|
|
1698
|
+
}
|
|
1560
1699
|
// ------------------------------------------------------------------
|
|
1561
1700
|
// Debug / Admin
|
|
1562
1701
|
// ------------------------------------------------------------------
|