orchestrator-client 5.9.0 → 5.9.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 +114 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +78 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +114 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -29,11 +29,21 @@ interface TaskSummary {
|
|
|
29
29
|
approvalReason: string;
|
|
30
30
|
ticketId: string | null;
|
|
31
31
|
availableTools: string[] | null;
|
|
32
|
+
/** Resolved skill references (name + description snapshot) at creation. */
|
|
33
|
+
skills: {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
}[] | null;
|
|
32
37
|
insight: string | null;
|
|
33
38
|
insightLocalized: string | null;
|
|
34
39
|
createdAt: string;
|
|
35
40
|
updatedAt: string;
|
|
36
41
|
pendingTranslationsForLocales?: string[] | null;
|
|
42
|
+
/**
|
|
43
|
+
* Workflow-specific data blob. Present on list responses (the API's
|
|
44
|
+
* TaskStatusResponse carries workflow_data); null on legacy rows.
|
|
45
|
+
*/
|
|
46
|
+
workflowData?: Record<string, unknown> | null;
|
|
37
47
|
}
|
|
38
48
|
/** Per-task feature toggles set at creation time. */
|
|
39
49
|
interface TaskOptions {
|
|
@@ -432,6 +442,48 @@ interface CatalogValidationResult {
|
|
|
432
442
|
totalIssues: number;
|
|
433
443
|
}
|
|
434
444
|
|
|
445
|
+
/** Skill availability mapping: which workflow/variant/tool a skill needs. */
|
|
446
|
+
interface SkillMapping {
|
|
447
|
+
id: number;
|
|
448
|
+
workflowId: string;
|
|
449
|
+
/** Null matches every variant of the workflow. */
|
|
450
|
+
variant: string | null;
|
|
451
|
+
/** Tool the task toolset must contain; null means no tool gate. */
|
|
452
|
+
requiredTool: string | null;
|
|
453
|
+
}
|
|
454
|
+
/** A skill definition with its availability mappings. */
|
|
455
|
+
interface Skill {
|
|
456
|
+
id: number;
|
|
457
|
+
name: string;
|
|
458
|
+
description: string;
|
|
459
|
+
content: string;
|
|
460
|
+
createdAt: string;
|
|
461
|
+
updatedAt: string;
|
|
462
|
+
mappings: SkillMapping[];
|
|
463
|
+
}
|
|
464
|
+
/** Result of `GET /skills`. */
|
|
465
|
+
interface SkillsListResult {
|
|
466
|
+
skills: Skill[];
|
|
467
|
+
total: number;
|
|
468
|
+
}
|
|
469
|
+
/** Payload for `POST /skills`. */
|
|
470
|
+
interface SkillCreatePayload {
|
|
471
|
+
name: string;
|
|
472
|
+
description: string;
|
|
473
|
+
content: string;
|
|
474
|
+
}
|
|
475
|
+
/** Payload for `PUT /skills/:id` — only provided fields are applied. */
|
|
476
|
+
interface SkillUpdatePayload {
|
|
477
|
+
description?: string;
|
|
478
|
+
content?: string;
|
|
479
|
+
}
|
|
480
|
+
/** Payload for `POST /skills/:id/mappings`. */
|
|
481
|
+
interface SkillMappingCreatePayload {
|
|
482
|
+
workflowId: string;
|
|
483
|
+
variant?: string | null;
|
|
484
|
+
requiredTool?: string | null;
|
|
485
|
+
}
|
|
486
|
+
|
|
435
487
|
interface CompactionEvent {
|
|
436
488
|
id: number;
|
|
437
489
|
taskId: string;
|
|
@@ -730,6 +782,19 @@ declare class OrchestratorAsync {
|
|
|
730
782
|
getToolCatalog(): Promise<ToolCatalogResult>;
|
|
731
783
|
refreshMCPTools(): Promise<MCPRefreshResult>;
|
|
732
784
|
validateToolCatalog(): Promise<CatalogValidationResult>;
|
|
785
|
+
listSkills(): Promise<SkillsListResult>;
|
|
786
|
+
getSkill(skillId: number): Promise<Skill>;
|
|
787
|
+
createSkill(payload: SkillCreatePayload): Promise<Skill>;
|
|
788
|
+
updateSkill(skillId: number, payload: SkillUpdatePayload): Promise<Skill>;
|
|
789
|
+
deleteSkill(skillId: number): Promise<{
|
|
790
|
+
deleted: boolean;
|
|
791
|
+
skillId: number;
|
|
792
|
+
}>;
|
|
793
|
+
addSkillMapping(skillId: number, payload: SkillMappingCreatePayload): Promise<SkillMapping>;
|
|
794
|
+
deleteSkillMapping(skillId: number, mappingId: number): Promise<{
|
|
795
|
+
deleted: boolean;
|
|
796
|
+
mappingId: number;
|
|
797
|
+
}>;
|
|
733
798
|
getWorkflowStates(): Promise<WorkflowStates>;
|
|
734
799
|
updateTaskModels(taskId: string, models: {
|
|
735
800
|
agentModelId?: string;
|
|
@@ -869,6 +934,19 @@ declare class Orchestrator {
|
|
|
869
934
|
getToolCatalog(): ToolCatalogResult;
|
|
870
935
|
refreshMCPTools(): MCPRefreshResult;
|
|
871
936
|
validateToolCatalog(): CatalogValidationResult;
|
|
937
|
+
listSkills(): SkillsListResult;
|
|
938
|
+
getSkill(skillId: number): Skill;
|
|
939
|
+
createSkill(payload: Parameters<OrchestratorAsync["createSkill"]>[0]): Skill;
|
|
940
|
+
updateSkill(skillId: number, payload: Parameters<OrchestratorAsync["updateSkill"]>[1]): Skill;
|
|
941
|
+
deleteSkill(skillId: number): {
|
|
942
|
+
deleted: boolean;
|
|
943
|
+
skillId: number;
|
|
944
|
+
};
|
|
945
|
+
addSkillMapping(skillId: number, payload: Parameters<OrchestratorAsync["addSkillMapping"]>[1]): SkillMapping;
|
|
946
|
+
deleteSkillMapping(skillId: number, mappingId: number): {
|
|
947
|
+
deleted: boolean;
|
|
948
|
+
mappingId: number;
|
|
949
|
+
};
|
|
872
950
|
getWorkflowStates(): WorkflowStates;
|
|
873
951
|
updateTaskModels(taskId: string, models: {
|
|
874
952
|
agentModelId?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -29,11 +29,21 @@ interface TaskSummary {
|
|
|
29
29
|
approvalReason: string;
|
|
30
30
|
ticketId: string | null;
|
|
31
31
|
availableTools: string[] | null;
|
|
32
|
+
/** Resolved skill references (name + description snapshot) at creation. */
|
|
33
|
+
skills: {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
}[] | null;
|
|
32
37
|
insight: string | null;
|
|
33
38
|
insightLocalized: string | null;
|
|
34
39
|
createdAt: string;
|
|
35
40
|
updatedAt: string;
|
|
36
41
|
pendingTranslationsForLocales?: string[] | null;
|
|
42
|
+
/**
|
|
43
|
+
* Workflow-specific data blob. Present on list responses (the API's
|
|
44
|
+
* TaskStatusResponse carries workflow_data); null on legacy rows.
|
|
45
|
+
*/
|
|
46
|
+
workflowData?: Record<string, unknown> | null;
|
|
37
47
|
}
|
|
38
48
|
/** Per-task feature toggles set at creation time. */
|
|
39
49
|
interface TaskOptions {
|
|
@@ -432,6 +442,48 @@ interface CatalogValidationResult {
|
|
|
432
442
|
totalIssues: number;
|
|
433
443
|
}
|
|
434
444
|
|
|
445
|
+
/** Skill availability mapping: which workflow/variant/tool a skill needs. */
|
|
446
|
+
interface SkillMapping {
|
|
447
|
+
id: number;
|
|
448
|
+
workflowId: string;
|
|
449
|
+
/** Null matches every variant of the workflow. */
|
|
450
|
+
variant: string | null;
|
|
451
|
+
/** Tool the task toolset must contain; null means no tool gate. */
|
|
452
|
+
requiredTool: string | null;
|
|
453
|
+
}
|
|
454
|
+
/** A skill definition with its availability mappings. */
|
|
455
|
+
interface Skill {
|
|
456
|
+
id: number;
|
|
457
|
+
name: string;
|
|
458
|
+
description: string;
|
|
459
|
+
content: string;
|
|
460
|
+
createdAt: string;
|
|
461
|
+
updatedAt: string;
|
|
462
|
+
mappings: SkillMapping[];
|
|
463
|
+
}
|
|
464
|
+
/** Result of `GET /skills`. */
|
|
465
|
+
interface SkillsListResult {
|
|
466
|
+
skills: Skill[];
|
|
467
|
+
total: number;
|
|
468
|
+
}
|
|
469
|
+
/** Payload for `POST /skills`. */
|
|
470
|
+
interface SkillCreatePayload {
|
|
471
|
+
name: string;
|
|
472
|
+
description: string;
|
|
473
|
+
content: string;
|
|
474
|
+
}
|
|
475
|
+
/** Payload for `PUT /skills/:id` — only provided fields are applied. */
|
|
476
|
+
interface SkillUpdatePayload {
|
|
477
|
+
description?: string;
|
|
478
|
+
content?: string;
|
|
479
|
+
}
|
|
480
|
+
/** Payload for `POST /skills/:id/mappings`. */
|
|
481
|
+
interface SkillMappingCreatePayload {
|
|
482
|
+
workflowId: string;
|
|
483
|
+
variant?: string | null;
|
|
484
|
+
requiredTool?: string | null;
|
|
485
|
+
}
|
|
486
|
+
|
|
435
487
|
interface CompactionEvent {
|
|
436
488
|
id: number;
|
|
437
489
|
taskId: string;
|
|
@@ -730,6 +782,19 @@ declare class OrchestratorAsync {
|
|
|
730
782
|
getToolCatalog(): Promise<ToolCatalogResult>;
|
|
731
783
|
refreshMCPTools(): Promise<MCPRefreshResult>;
|
|
732
784
|
validateToolCatalog(): Promise<CatalogValidationResult>;
|
|
785
|
+
listSkills(): Promise<SkillsListResult>;
|
|
786
|
+
getSkill(skillId: number): Promise<Skill>;
|
|
787
|
+
createSkill(payload: SkillCreatePayload): Promise<Skill>;
|
|
788
|
+
updateSkill(skillId: number, payload: SkillUpdatePayload): Promise<Skill>;
|
|
789
|
+
deleteSkill(skillId: number): Promise<{
|
|
790
|
+
deleted: boolean;
|
|
791
|
+
skillId: number;
|
|
792
|
+
}>;
|
|
793
|
+
addSkillMapping(skillId: number, payload: SkillMappingCreatePayload): Promise<SkillMapping>;
|
|
794
|
+
deleteSkillMapping(skillId: number, mappingId: number): Promise<{
|
|
795
|
+
deleted: boolean;
|
|
796
|
+
mappingId: number;
|
|
797
|
+
}>;
|
|
733
798
|
getWorkflowStates(): Promise<WorkflowStates>;
|
|
734
799
|
updateTaskModels(taskId: string, models: {
|
|
735
800
|
agentModelId?: string;
|
|
@@ -869,6 +934,19 @@ declare class Orchestrator {
|
|
|
869
934
|
getToolCatalog(): ToolCatalogResult;
|
|
870
935
|
refreshMCPTools(): MCPRefreshResult;
|
|
871
936
|
validateToolCatalog(): CatalogValidationResult;
|
|
937
|
+
listSkills(): SkillsListResult;
|
|
938
|
+
getSkill(skillId: number): Skill;
|
|
939
|
+
createSkill(payload: Parameters<OrchestratorAsync["createSkill"]>[0]): Skill;
|
|
940
|
+
updateSkill(skillId: number, payload: Parameters<OrchestratorAsync["updateSkill"]>[1]): Skill;
|
|
941
|
+
deleteSkill(skillId: number): {
|
|
942
|
+
deleted: boolean;
|
|
943
|
+
skillId: number;
|
|
944
|
+
};
|
|
945
|
+
addSkillMapping(skillId: number, payload: Parameters<OrchestratorAsync["addSkillMapping"]>[1]): SkillMapping;
|
|
946
|
+
deleteSkillMapping(skillId: number, mappingId: number): {
|
|
947
|
+
deleted: boolean;
|
|
948
|
+
mappingId: number;
|
|
949
|
+
};
|
|
872
950
|
getWorkflowStates(): WorkflowStates;
|
|
873
951
|
updateTaskModels(taskId: string, models: {
|
|
874
952
|
agentModelId?: string;
|
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,10 +805,7 @@ 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
810
|
async searchVSATasks(userId, query, limit) {
|
|
781
811
|
const data = await this._get("/task/vsa/search", {
|
|
@@ -783,10 +813,7 @@ var OrchestratorAsync = class {
|
|
|
783
813
|
query,
|
|
784
814
|
limit
|
|
785
815
|
});
|
|
786
|
-
|
|
787
|
-
buildTaskSummary
|
|
788
|
-
);
|
|
789
|
-
return { tasks, pagination: buildPagination(data) };
|
|
816
|
+
return buildVsaTaskList(data);
|
|
790
817
|
}
|
|
791
818
|
async deleteVSATasksBulk(taskIds) {
|
|
792
819
|
const data = await this._post(
|
|
@@ -921,6 +948,63 @@ var OrchestratorAsync = class {
|
|
|
921
948
|
return this._get("/tools/validate");
|
|
922
949
|
}
|
|
923
950
|
// ------------------------------------------------------------------
|
|
951
|
+
// Skills
|
|
952
|
+
// ------------------------------------------------------------------
|
|
953
|
+
async listSkills() {
|
|
954
|
+
const data = await this._get("/skills");
|
|
955
|
+
const skills = (data.skills ?? []).map(
|
|
956
|
+
(s) => buildSkill(s)
|
|
957
|
+
);
|
|
958
|
+
return {
|
|
959
|
+
skills,
|
|
960
|
+
total: data.total ?? skills.length
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
async getSkill(skillId) {
|
|
964
|
+
const data = await this._get(`/skills/${skillId}`);
|
|
965
|
+
return buildSkill(data);
|
|
966
|
+
}
|
|
967
|
+
async createSkill(payload) {
|
|
968
|
+
const data = await this._post("/skills", payload);
|
|
969
|
+
return buildSkill(data);
|
|
970
|
+
}
|
|
971
|
+
async updateSkill(skillId, payload) {
|
|
972
|
+
const data = await this._put(
|
|
973
|
+
`/skills/${skillId}`,
|
|
974
|
+
payload
|
|
975
|
+
);
|
|
976
|
+
return buildSkill(data);
|
|
977
|
+
}
|
|
978
|
+
async deleteSkill(skillId) {
|
|
979
|
+
const data = await this._delete(
|
|
980
|
+
`/skills/${skillId}`
|
|
981
|
+
);
|
|
982
|
+
return {
|
|
983
|
+
deleted: data.deleted ?? false,
|
|
984
|
+
skillId: data.skillId ?? data.skill_id ?? 0
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
async addSkillMapping(skillId, payload) {
|
|
988
|
+
const data = await this._post(
|
|
989
|
+
`/skills/${skillId}/mappings`,
|
|
990
|
+
{
|
|
991
|
+
workflow_id: payload.workflowId,
|
|
992
|
+
...payload.variant ? { variant: payload.variant } : {},
|
|
993
|
+
...payload.requiredTool ? { required_tool: payload.requiredTool } : {}
|
|
994
|
+
}
|
|
995
|
+
);
|
|
996
|
+
return buildSkillMapping(data);
|
|
997
|
+
}
|
|
998
|
+
async deleteSkillMapping(skillId, mappingId) {
|
|
999
|
+
const data = await this._delete(
|
|
1000
|
+
`/skills/${skillId}/mappings/${mappingId}`
|
|
1001
|
+
);
|
|
1002
|
+
return {
|
|
1003
|
+
deleted: data.deleted ?? false,
|
|
1004
|
+
mappingId: data.mappingId ?? data.mapping_id ?? 0
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
// ------------------------------------------------------------------
|
|
924
1008
|
// Debug / Admin
|
|
925
1009
|
// ------------------------------------------------------------------
|
|
926
1010
|
async getWorkflowStates() {
|
|
@@ -1521,6 +1605,27 @@ var Orchestrator = class {
|
|
|
1521
1605
|
validateToolCatalog() {
|
|
1522
1606
|
return runSync(this._async.validateToolCatalog());
|
|
1523
1607
|
}
|
|
1608
|
+
listSkills() {
|
|
1609
|
+
return runSync(this._async.listSkills());
|
|
1610
|
+
}
|
|
1611
|
+
getSkill(skillId) {
|
|
1612
|
+
return runSync(this._async.getSkill(skillId));
|
|
1613
|
+
}
|
|
1614
|
+
createSkill(payload) {
|
|
1615
|
+
return runSync(this._async.createSkill(payload));
|
|
1616
|
+
}
|
|
1617
|
+
updateSkill(skillId, payload) {
|
|
1618
|
+
return runSync(this._async.updateSkill(skillId, payload));
|
|
1619
|
+
}
|
|
1620
|
+
deleteSkill(skillId) {
|
|
1621
|
+
return runSync(this._async.deleteSkill(skillId));
|
|
1622
|
+
}
|
|
1623
|
+
addSkillMapping(skillId, payload) {
|
|
1624
|
+
return runSync(this._async.addSkillMapping(skillId, payload));
|
|
1625
|
+
}
|
|
1626
|
+
deleteSkillMapping(skillId, mappingId) {
|
|
1627
|
+
return runSync(this._async.deleteSkillMapping(skillId, mappingId));
|
|
1628
|
+
}
|
|
1524
1629
|
// ------------------------------------------------------------------
|
|
1525
1630
|
// Debug / Admin
|
|
1526
1631
|
// ------------------------------------------------------------------
|