novyx 2.11.0 → 2.12.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.d.mts +151 -0
- package/dist/index.d.ts +151 -0
- package/dist/index.js +161 -0
- package/dist/index.mjs +161 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -301,6 +301,68 @@ interface StreamStatusResult {
|
|
|
301
301
|
connections: number;
|
|
302
302
|
event_bus: Record<string, any>;
|
|
303
303
|
}
|
|
304
|
+
interface Agent {
|
|
305
|
+
agent_id: string;
|
|
306
|
+
name: string;
|
|
307
|
+
model: string;
|
|
308
|
+
provider: string;
|
|
309
|
+
description?: string;
|
|
310
|
+
instructions?: string;
|
|
311
|
+
memory_scope?: string;
|
|
312
|
+
capabilities: string[];
|
|
313
|
+
policy_profile?: Record<string, any>;
|
|
314
|
+
config?: Record<string, any>;
|
|
315
|
+
status: string;
|
|
316
|
+
created_at: string;
|
|
317
|
+
updated_at?: string;
|
|
318
|
+
}
|
|
319
|
+
interface Mission {
|
|
320
|
+
mission_id: string;
|
|
321
|
+
agent_id: string;
|
|
322
|
+
goal: string;
|
|
323
|
+
constraints?: string[];
|
|
324
|
+
success_criteria?: string[];
|
|
325
|
+
allowed_capabilities?: string[];
|
|
326
|
+
escalation_rules?: Record<string, any>[];
|
|
327
|
+
stop_conditions?: string[];
|
|
328
|
+
config?: Record<string, any>;
|
|
329
|
+
status: string;
|
|
330
|
+
created_at: string;
|
|
331
|
+
updated_at?: string;
|
|
332
|
+
}
|
|
333
|
+
interface Capability {
|
|
334
|
+
capability_id: string;
|
|
335
|
+
name: string;
|
|
336
|
+
description?: string;
|
|
337
|
+
tools?: Record<string, any>[];
|
|
338
|
+
risk_levels?: Record<string, any>;
|
|
339
|
+
approval_requirements?: Record<string, any>;
|
|
340
|
+
memory_behavior?: Record<string, any>;
|
|
341
|
+
eval_rules?: Record<string, any>;
|
|
342
|
+
config?: Record<string, any>;
|
|
343
|
+
status: string;
|
|
344
|
+
created_at: string;
|
|
345
|
+
updated_at?: string;
|
|
346
|
+
}
|
|
347
|
+
interface Checkpoint {
|
|
348
|
+
checkpoint_id: string;
|
|
349
|
+
mission_id: string;
|
|
350
|
+
label?: string;
|
|
351
|
+
metadata?: Record<string, any>;
|
|
352
|
+
mission_status?: string;
|
|
353
|
+
created_at: string;
|
|
354
|
+
}
|
|
355
|
+
interface Intervention {
|
|
356
|
+
intervention_id: string;
|
|
357
|
+
intervention_type: string;
|
|
358
|
+
mission_id?: string;
|
|
359
|
+
action_id?: string;
|
|
360
|
+
agent_id?: string;
|
|
361
|
+
rationale?: string;
|
|
362
|
+
metadata?: Record<string, any>;
|
|
363
|
+
actor?: string;
|
|
364
|
+
created_at: string;
|
|
365
|
+
}
|
|
304
366
|
|
|
305
367
|
declare class NovyxSession {
|
|
306
368
|
private client;
|
|
@@ -576,6 +638,95 @@ declare class Novyx {
|
|
|
576
638
|
}): Promise<any>;
|
|
577
639
|
/** Check the current Control policy profile. */
|
|
578
640
|
policyCheck(): Promise<any>;
|
|
641
|
+
createAgent(params: {
|
|
642
|
+
name: string;
|
|
643
|
+
agent_id?: string;
|
|
644
|
+
description?: string;
|
|
645
|
+
model?: string;
|
|
646
|
+
provider?: string;
|
|
647
|
+
instructions?: string;
|
|
648
|
+
capabilities?: string[];
|
|
649
|
+
memory_scope?: string;
|
|
650
|
+
policy_profile?: Record<string, any>;
|
|
651
|
+
config?: Record<string, any>;
|
|
652
|
+
}): Promise<Agent>;
|
|
653
|
+
getAgent(agentId: string): Promise<Agent>;
|
|
654
|
+
listAgents(opts?: {
|
|
655
|
+
status?: string;
|
|
656
|
+
limit?: number;
|
|
657
|
+
offset?: number;
|
|
658
|
+
}): Promise<Record<string, any>>;
|
|
659
|
+
updateAgent(agentId: string, updates: Record<string, any>): Promise<Agent>;
|
|
660
|
+
deleteAgent(agentId: string): Promise<Record<string, any>>;
|
|
661
|
+
createMission(params: {
|
|
662
|
+
agent_id: string;
|
|
663
|
+
goal: string;
|
|
664
|
+
constraints?: string[];
|
|
665
|
+
success_criteria?: string[];
|
|
666
|
+
allowed_capabilities?: string[];
|
|
667
|
+
escalation_rules?: Record<string, any>[];
|
|
668
|
+
stop_conditions?: string[];
|
|
669
|
+
config?: Record<string, any>;
|
|
670
|
+
}): Promise<Mission>;
|
|
671
|
+
getMission(missionId: string): Promise<Mission>;
|
|
672
|
+
listMissions(opts?: {
|
|
673
|
+
agent_id?: string;
|
|
674
|
+
status?: string;
|
|
675
|
+
limit?: number;
|
|
676
|
+
offset?: number;
|
|
677
|
+
}): Promise<Record<string, any>>;
|
|
678
|
+
updateMission(missionId: string, updates: Record<string, any>): Promise<Mission>;
|
|
679
|
+
deleteMission(missionId: string): Promise<Record<string, any>>;
|
|
680
|
+
pauseMission(missionId: string): Promise<Mission>;
|
|
681
|
+
resumeMission(missionId: string): Promise<Mission>;
|
|
682
|
+
cancelMission(missionId: string): Promise<Mission>;
|
|
683
|
+
createCapability(params: {
|
|
684
|
+
name: string;
|
|
685
|
+
capability_id?: string;
|
|
686
|
+
description?: string;
|
|
687
|
+
tools?: Record<string, any>[];
|
|
688
|
+
risk_levels?: Record<string, any>;
|
|
689
|
+
approval_requirements?: Record<string, any>;
|
|
690
|
+
memory_behavior?: Record<string, any>;
|
|
691
|
+
eval_rules?: Record<string, any>;
|
|
692
|
+
config?: Record<string, any>;
|
|
693
|
+
}): Promise<Capability>;
|
|
694
|
+
getCapability(capabilityId: string): Promise<Capability>;
|
|
695
|
+
listCapabilities(opts?: {
|
|
696
|
+
status?: string;
|
|
697
|
+
limit?: number;
|
|
698
|
+
offset?: number;
|
|
699
|
+
}): Promise<Record<string, any>>;
|
|
700
|
+
updateCapability(capabilityId: string, updates: Record<string, any>): Promise<Capability>;
|
|
701
|
+
deleteCapability(capabilityId: string): Promise<Record<string, any>>;
|
|
702
|
+
createCheckpoint(missionId: string, opts?: {
|
|
703
|
+
label?: string;
|
|
704
|
+
metadata?: Record<string, any>;
|
|
705
|
+
}): Promise<Checkpoint>;
|
|
706
|
+
getCheckpoint(checkpointId: string): Promise<Checkpoint>;
|
|
707
|
+
listCheckpoints(missionId: string, opts?: {
|
|
708
|
+
limit?: number;
|
|
709
|
+
offset?: number;
|
|
710
|
+
}): Promise<Record<string, any>>;
|
|
711
|
+
rollbackToCheckpoint(missionId: string, checkpointId: string, opts?: {
|
|
712
|
+
reason?: string;
|
|
713
|
+
}): Promise<Record<string, any>>;
|
|
714
|
+
createIntervention(params: {
|
|
715
|
+
intervention_type: string;
|
|
716
|
+
mission_id?: string;
|
|
717
|
+
action_id?: string;
|
|
718
|
+
agent_id?: string;
|
|
719
|
+
rationale?: string;
|
|
720
|
+
metadata?: Record<string, any>;
|
|
721
|
+
}): Promise<Intervention>;
|
|
722
|
+
getIntervention(interventionId: string): Promise<Intervention>;
|
|
723
|
+
listInterventions(opts?: {
|
|
724
|
+
mission_id?: string;
|
|
725
|
+
agent_id?: string;
|
|
726
|
+
intervention_type?: string;
|
|
727
|
+
limit?: number;
|
|
728
|
+
offset?: number;
|
|
729
|
+
}): Promise<Record<string, any>>;
|
|
579
730
|
}
|
|
580
731
|
|
|
581
732
|
declare class NovyxError extends Error {
|
package/dist/index.d.ts
CHANGED
|
@@ -301,6 +301,68 @@ interface StreamStatusResult {
|
|
|
301
301
|
connections: number;
|
|
302
302
|
event_bus: Record<string, any>;
|
|
303
303
|
}
|
|
304
|
+
interface Agent {
|
|
305
|
+
agent_id: string;
|
|
306
|
+
name: string;
|
|
307
|
+
model: string;
|
|
308
|
+
provider: string;
|
|
309
|
+
description?: string;
|
|
310
|
+
instructions?: string;
|
|
311
|
+
memory_scope?: string;
|
|
312
|
+
capabilities: string[];
|
|
313
|
+
policy_profile?: Record<string, any>;
|
|
314
|
+
config?: Record<string, any>;
|
|
315
|
+
status: string;
|
|
316
|
+
created_at: string;
|
|
317
|
+
updated_at?: string;
|
|
318
|
+
}
|
|
319
|
+
interface Mission {
|
|
320
|
+
mission_id: string;
|
|
321
|
+
agent_id: string;
|
|
322
|
+
goal: string;
|
|
323
|
+
constraints?: string[];
|
|
324
|
+
success_criteria?: string[];
|
|
325
|
+
allowed_capabilities?: string[];
|
|
326
|
+
escalation_rules?: Record<string, any>[];
|
|
327
|
+
stop_conditions?: string[];
|
|
328
|
+
config?: Record<string, any>;
|
|
329
|
+
status: string;
|
|
330
|
+
created_at: string;
|
|
331
|
+
updated_at?: string;
|
|
332
|
+
}
|
|
333
|
+
interface Capability {
|
|
334
|
+
capability_id: string;
|
|
335
|
+
name: string;
|
|
336
|
+
description?: string;
|
|
337
|
+
tools?: Record<string, any>[];
|
|
338
|
+
risk_levels?: Record<string, any>;
|
|
339
|
+
approval_requirements?: Record<string, any>;
|
|
340
|
+
memory_behavior?: Record<string, any>;
|
|
341
|
+
eval_rules?: Record<string, any>;
|
|
342
|
+
config?: Record<string, any>;
|
|
343
|
+
status: string;
|
|
344
|
+
created_at: string;
|
|
345
|
+
updated_at?: string;
|
|
346
|
+
}
|
|
347
|
+
interface Checkpoint {
|
|
348
|
+
checkpoint_id: string;
|
|
349
|
+
mission_id: string;
|
|
350
|
+
label?: string;
|
|
351
|
+
metadata?: Record<string, any>;
|
|
352
|
+
mission_status?: string;
|
|
353
|
+
created_at: string;
|
|
354
|
+
}
|
|
355
|
+
interface Intervention {
|
|
356
|
+
intervention_id: string;
|
|
357
|
+
intervention_type: string;
|
|
358
|
+
mission_id?: string;
|
|
359
|
+
action_id?: string;
|
|
360
|
+
agent_id?: string;
|
|
361
|
+
rationale?: string;
|
|
362
|
+
metadata?: Record<string, any>;
|
|
363
|
+
actor?: string;
|
|
364
|
+
created_at: string;
|
|
365
|
+
}
|
|
304
366
|
|
|
305
367
|
declare class NovyxSession {
|
|
306
368
|
private client;
|
|
@@ -576,6 +638,95 @@ declare class Novyx {
|
|
|
576
638
|
}): Promise<any>;
|
|
577
639
|
/** Check the current Control policy profile. */
|
|
578
640
|
policyCheck(): Promise<any>;
|
|
641
|
+
createAgent(params: {
|
|
642
|
+
name: string;
|
|
643
|
+
agent_id?: string;
|
|
644
|
+
description?: string;
|
|
645
|
+
model?: string;
|
|
646
|
+
provider?: string;
|
|
647
|
+
instructions?: string;
|
|
648
|
+
capabilities?: string[];
|
|
649
|
+
memory_scope?: string;
|
|
650
|
+
policy_profile?: Record<string, any>;
|
|
651
|
+
config?: Record<string, any>;
|
|
652
|
+
}): Promise<Agent>;
|
|
653
|
+
getAgent(agentId: string): Promise<Agent>;
|
|
654
|
+
listAgents(opts?: {
|
|
655
|
+
status?: string;
|
|
656
|
+
limit?: number;
|
|
657
|
+
offset?: number;
|
|
658
|
+
}): Promise<Record<string, any>>;
|
|
659
|
+
updateAgent(agentId: string, updates: Record<string, any>): Promise<Agent>;
|
|
660
|
+
deleteAgent(agentId: string): Promise<Record<string, any>>;
|
|
661
|
+
createMission(params: {
|
|
662
|
+
agent_id: string;
|
|
663
|
+
goal: string;
|
|
664
|
+
constraints?: string[];
|
|
665
|
+
success_criteria?: string[];
|
|
666
|
+
allowed_capabilities?: string[];
|
|
667
|
+
escalation_rules?: Record<string, any>[];
|
|
668
|
+
stop_conditions?: string[];
|
|
669
|
+
config?: Record<string, any>;
|
|
670
|
+
}): Promise<Mission>;
|
|
671
|
+
getMission(missionId: string): Promise<Mission>;
|
|
672
|
+
listMissions(opts?: {
|
|
673
|
+
agent_id?: string;
|
|
674
|
+
status?: string;
|
|
675
|
+
limit?: number;
|
|
676
|
+
offset?: number;
|
|
677
|
+
}): Promise<Record<string, any>>;
|
|
678
|
+
updateMission(missionId: string, updates: Record<string, any>): Promise<Mission>;
|
|
679
|
+
deleteMission(missionId: string): Promise<Record<string, any>>;
|
|
680
|
+
pauseMission(missionId: string): Promise<Mission>;
|
|
681
|
+
resumeMission(missionId: string): Promise<Mission>;
|
|
682
|
+
cancelMission(missionId: string): Promise<Mission>;
|
|
683
|
+
createCapability(params: {
|
|
684
|
+
name: string;
|
|
685
|
+
capability_id?: string;
|
|
686
|
+
description?: string;
|
|
687
|
+
tools?: Record<string, any>[];
|
|
688
|
+
risk_levels?: Record<string, any>;
|
|
689
|
+
approval_requirements?: Record<string, any>;
|
|
690
|
+
memory_behavior?: Record<string, any>;
|
|
691
|
+
eval_rules?: Record<string, any>;
|
|
692
|
+
config?: Record<string, any>;
|
|
693
|
+
}): Promise<Capability>;
|
|
694
|
+
getCapability(capabilityId: string): Promise<Capability>;
|
|
695
|
+
listCapabilities(opts?: {
|
|
696
|
+
status?: string;
|
|
697
|
+
limit?: number;
|
|
698
|
+
offset?: number;
|
|
699
|
+
}): Promise<Record<string, any>>;
|
|
700
|
+
updateCapability(capabilityId: string, updates: Record<string, any>): Promise<Capability>;
|
|
701
|
+
deleteCapability(capabilityId: string): Promise<Record<string, any>>;
|
|
702
|
+
createCheckpoint(missionId: string, opts?: {
|
|
703
|
+
label?: string;
|
|
704
|
+
metadata?: Record<string, any>;
|
|
705
|
+
}): Promise<Checkpoint>;
|
|
706
|
+
getCheckpoint(checkpointId: string): Promise<Checkpoint>;
|
|
707
|
+
listCheckpoints(missionId: string, opts?: {
|
|
708
|
+
limit?: number;
|
|
709
|
+
offset?: number;
|
|
710
|
+
}): Promise<Record<string, any>>;
|
|
711
|
+
rollbackToCheckpoint(missionId: string, checkpointId: string, opts?: {
|
|
712
|
+
reason?: string;
|
|
713
|
+
}): Promise<Record<string, any>>;
|
|
714
|
+
createIntervention(params: {
|
|
715
|
+
intervention_type: string;
|
|
716
|
+
mission_id?: string;
|
|
717
|
+
action_id?: string;
|
|
718
|
+
agent_id?: string;
|
|
719
|
+
rationale?: string;
|
|
720
|
+
metadata?: Record<string, any>;
|
|
721
|
+
}): Promise<Intervention>;
|
|
722
|
+
getIntervention(interventionId: string): Promise<Intervention>;
|
|
723
|
+
listInterventions(opts?: {
|
|
724
|
+
mission_id?: string;
|
|
725
|
+
agent_id?: string;
|
|
726
|
+
intervention_type?: string;
|
|
727
|
+
limit?: number;
|
|
728
|
+
offset?: number;
|
|
729
|
+
}): Promise<Record<string, any>>;
|
|
579
730
|
}
|
|
580
731
|
|
|
581
732
|
declare class NovyxError extends Error {
|
package/dist/index.js
CHANGED
|
@@ -745,6 +745,167 @@ var Novyx = class {
|
|
|
745
745
|
async policyCheck() {
|
|
746
746
|
return this._controlRequest("GET", "/v1/control/policies");
|
|
747
747
|
}
|
|
748
|
+
// ========================================================================
|
|
749
|
+
// Agents (Runtime v2)
|
|
750
|
+
// ========================================================================
|
|
751
|
+
async createAgent(params) {
|
|
752
|
+
const body = {
|
|
753
|
+
name: params.name,
|
|
754
|
+
model: params.model ?? "gpt-4o-mini",
|
|
755
|
+
provider: params.provider ?? "openai"
|
|
756
|
+
};
|
|
757
|
+
if (params.agent_id) body.agent_id = params.agent_id;
|
|
758
|
+
if (params.description) body.description = params.description;
|
|
759
|
+
if (params.instructions) body.instructions = params.instructions;
|
|
760
|
+
if (params.capabilities) body.capabilities = params.capabilities;
|
|
761
|
+
if (params.memory_scope) body.memory_scope = params.memory_scope;
|
|
762
|
+
if (params.policy_profile) body.policy_profile = params.policy_profile;
|
|
763
|
+
if (params.config) body.config = params.config;
|
|
764
|
+
return this._request("POST", "/v1/agents", { body });
|
|
765
|
+
}
|
|
766
|
+
async getAgent(agentId) {
|
|
767
|
+
return this._request("GET", `/v1/agents/${agentId}`);
|
|
768
|
+
}
|
|
769
|
+
async listAgents(opts) {
|
|
770
|
+
const params = {
|
|
771
|
+
limit: opts?.limit ?? 100,
|
|
772
|
+
offset: opts?.offset ?? 0
|
|
773
|
+
};
|
|
774
|
+
if (opts?.status) params.status = opts.status;
|
|
775
|
+
return this._request("GET", "/v1/agents", { params });
|
|
776
|
+
}
|
|
777
|
+
async updateAgent(agentId, updates) {
|
|
778
|
+
return this._request("PATCH", `/v1/agents/${agentId}`, { body: updates });
|
|
779
|
+
}
|
|
780
|
+
async deleteAgent(agentId) {
|
|
781
|
+
return this._request("DELETE", `/v1/agents/${agentId}`);
|
|
782
|
+
}
|
|
783
|
+
// ========================================================================
|
|
784
|
+
// Missions (Runtime v2)
|
|
785
|
+
// ========================================================================
|
|
786
|
+
async createMission(params) {
|
|
787
|
+
const body = {
|
|
788
|
+
agent_id: params.agent_id,
|
|
789
|
+
goal: params.goal
|
|
790
|
+
};
|
|
791
|
+
if (params.constraints !== void 0) body.constraints = params.constraints;
|
|
792
|
+
if (params.success_criteria !== void 0) body.success_criteria = params.success_criteria;
|
|
793
|
+
if (params.allowed_capabilities !== void 0) body.allowed_capabilities = params.allowed_capabilities;
|
|
794
|
+
if (params.escalation_rules !== void 0) body.escalation_rules = params.escalation_rules;
|
|
795
|
+
if (params.stop_conditions !== void 0) body.stop_conditions = params.stop_conditions;
|
|
796
|
+
if (params.config !== void 0) body.config = params.config;
|
|
797
|
+
return this._request("POST", "/v1/missions", { body });
|
|
798
|
+
}
|
|
799
|
+
async getMission(missionId) {
|
|
800
|
+
return this._request("GET", `/v1/missions/${missionId}`);
|
|
801
|
+
}
|
|
802
|
+
async listMissions(opts) {
|
|
803
|
+
const params = {
|
|
804
|
+
limit: opts?.limit ?? 100,
|
|
805
|
+
offset: opts?.offset ?? 0
|
|
806
|
+
};
|
|
807
|
+
if (opts?.agent_id) params.agent_id = opts.agent_id;
|
|
808
|
+
if (opts?.status) params.status = opts.status;
|
|
809
|
+
return this._request("GET", "/v1/missions", { params });
|
|
810
|
+
}
|
|
811
|
+
async updateMission(missionId, updates) {
|
|
812
|
+
return this._request("PATCH", `/v1/missions/${missionId}`, { body: updates });
|
|
813
|
+
}
|
|
814
|
+
async deleteMission(missionId) {
|
|
815
|
+
return this._request("DELETE", `/v1/missions/${missionId}`);
|
|
816
|
+
}
|
|
817
|
+
async pauseMission(missionId) {
|
|
818
|
+
return this._request("POST", `/v1/missions/${missionId}/pause`);
|
|
819
|
+
}
|
|
820
|
+
async resumeMission(missionId) {
|
|
821
|
+
return this._request("POST", `/v1/missions/${missionId}/resume`);
|
|
822
|
+
}
|
|
823
|
+
async cancelMission(missionId) {
|
|
824
|
+
return this._request("POST", `/v1/missions/${missionId}/cancel`);
|
|
825
|
+
}
|
|
826
|
+
// ========================================================================
|
|
827
|
+
// Capabilities (Runtime v2)
|
|
828
|
+
// ========================================================================
|
|
829
|
+
async createCapability(params) {
|
|
830
|
+
const body = { name: params.name };
|
|
831
|
+
if (params.capability_id !== void 0) body.capability_id = params.capability_id;
|
|
832
|
+
if (params.description !== void 0) body.description = params.description;
|
|
833
|
+
if (params.tools !== void 0) body.tools = params.tools;
|
|
834
|
+
if (params.risk_levels !== void 0) body.risk_levels = params.risk_levels;
|
|
835
|
+
if (params.approval_requirements !== void 0) body.approval_requirements = params.approval_requirements;
|
|
836
|
+
if (params.memory_behavior !== void 0) body.memory_behavior = params.memory_behavior;
|
|
837
|
+
if (params.eval_rules !== void 0) body.eval_rules = params.eval_rules;
|
|
838
|
+
if (params.config !== void 0) body.config = params.config;
|
|
839
|
+
return this._request("POST", "/v1/capabilities", { body });
|
|
840
|
+
}
|
|
841
|
+
async getCapability(capabilityId) {
|
|
842
|
+
return this._request("GET", `/v1/capabilities/${capabilityId}`);
|
|
843
|
+
}
|
|
844
|
+
async listCapabilities(opts) {
|
|
845
|
+
const params = {
|
|
846
|
+
limit: opts?.limit ?? 100,
|
|
847
|
+
offset: opts?.offset ?? 0
|
|
848
|
+
};
|
|
849
|
+
if (opts?.status) params.status = opts.status;
|
|
850
|
+
return this._request("GET", "/v1/capabilities", { params });
|
|
851
|
+
}
|
|
852
|
+
async updateCapability(capabilityId, updates) {
|
|
853
|
+
return this._request("PATCH", `/v1/capabilities/${capabilityId}`, { body: updates });
|
|
854
|
+
}
|
|
855
|
+
async deleteCapability(capabilityId) {
|
|
856
|
+
return this._request("DELETE", `/v1/capabilities/${capabilityId}`);
|
|
857
|
+
}
|
|
858
|
+
// ========================================================================
|
|
859
|
+
// Checkpoints (Runtime v2)
|
|
860
|
+
// ========================================================================
|
|
861
|
+
async createCheckpoint(missionId, opts) {
|
|
862
|
+
const body = {};
|
|
863
|
+
if (opts?.label !== void 0) body.label = opts.label;
|
|
864
|
+
if (opts?.metadata !== void 0) body.metadata = opts.metadata;
|
|
865
|
+
return this._request("POST", `/v1/missions/${missionId}/checkpoints`, { body });
|
|
866
|
+
}
|
|
867
|
+
async getCheckpoint(checkpointId) {
|
|
868
|
+
return this._request("GET", `/v1/checkpoints/${checkpointId}`);
|
|
869
|
+
}
|
|
870
|
+
async listCheckpoints(missionId, opts) {
|
|
871
|
+
const params = {
|
|
872
|
+
limit: opts?.limit ?? 100,
|
|
873
|
+
offset: opts?.offset ?? 0
|
|
874
|
+
};
|
|
875
|
+
return this._request("GET", `/v1/missions/${missionId}/checkpoints`, { params });
|
|
876
|
+
}
|
|
877
|
+
async rollbackToCheckpoint(missionId, checkpointId, opts) {
|
|
878
|
+
const body = { checkpoint_id: checkpointId };
|
|
879
|
+
if (opts?.reason !== void 0) body.reason = opts.reason;
|
|
880
|
+
return this._request("POST", `/v1/missions/${missionId}/rollback`, { body });
|
|
881
|
+
}
|
|
882
|
+
// ========================================================================
|
|
883
|
+
// Interventions (Runtime v2)
|
|
884
|
+
// ========================================================================
|
|
885
|
+
async createIntervention(params) {
|
|
886
|
+
const body = {
|
|
887
|
+
intervention_type: params.intervention_type
|
|
888
|
+
};
|
|
889
|
+
if (params.mission_id !== void 0) body.mission_id = params.mission_id;
|
|
890
|
+
if (params.action_id !== void 0) body.action_id = params.action_id;
|
|
891
|
+
if (params.agent_id !== void 0) body.agent_id = params.agent_id;
|
|
892
|
+
if (params.rationale !== void 0) body.rationale = params.rationale;
|
|
893
|
+
if (params.metadata !== void 0) body.metadata = params.metadata;
|
|
894
|
+
return this._request("POST", "/v1/interventions", { body });
|
|
895
|
+
}
|
|
896
|
+
async getIntervention(interventionId) {
|
|
897
|
+
return this._request("GET", `/v1/interventions/${interventionId}`);
|
|
898
|
+
}
|
|
899
|
+
async listInterventions(opts) {
|
|
900
|
+
const params = {
|
|
901
|
+
limit: opts?.limit ?? 100,
|
|
902
|
+
offset: opts?.offset ?? 0
|
|
903
|
+
};
|
|
904
|
+
if (opts?.mission_id) params.mission_id = opts.mission_id;
|
|
905
|
+
if (opts?.agent_id) params.agent_id = opts.agent_id;
|
|
906
|
+
if (opts?.intervention_type) params.type = opts.intervention_type;
|
|
907
|
+
return this._request("GET", "/v1/interventions", { params });
|
|
908
|
+
}
|
|
748
909
|
};
|
|
749
910
|
// Annotate the CommonJS export names for ESM import in node:
|
|
750
911
|
0 && (module.exports = {
|
package/dist/index.mjs
CHANGED
|
@@ -712,6 +712,167 @@ var Novyx = class {
|
|
|
712
712
|
async policyCheck() {
|
|
713
713
|
return this._controlRequest("GET", "/v1/control/policies");
|
|
714
714
|
}
|
|
715
|
+
// ========================================================================
|
|
716
|
+
// Agents (Runtime v2)
|
|
717
|
+
// ========================================================================
|
|
718
|
+
async createAgent(params) {
|
|
719
|
+
const body = {
|
|
720
|
+
name: params.name,
|
|
721
|
+
model: params.model ?? "gpt-4o-mini",
|
|
722
|
+
provider: params.provider ?? "openai"
|
|
723
|
+
};
|
|
724
|
+
if (params.agent_id) body.agent_id = params.agent_id;
|
|
725
|
+
if (params.description) body.description = params.description;
|
|
726
|
+
if (params.instructions) body.instructions = params.instructions;
|
|
727
|
+
if (params.capabilities) body.capabilities = params.capabilities;
|
|
728
|
+
if (params.memory_scope) body.memory_scope = params.memory_scope;
|
|
729
|
+
if (params.policy_profile) body.policy_profile = params.policy_profile;
|
|
730
|
+
if (params.config) body.config = params.config;
|
|
731
|
+
return this._request("POST", "/v1/agents", { body });
|
|
732
|
+
}
|
|
733
|
+
async getAgent(agentId) {
|
|
734
|
+
return this._request("GET", `/v1/agents/${agentId}`);
|
|
735
|
+
}
|
|
736
|
+
async listAgents(opts) {
|
|
737
|
+
const params = {
|
|
738
|
+
limit: opts?.limit ?? 100,
|
|
739
|
+
offset: opts?.offset ?? 0
|
|
740
|
+
};
|
|
741
|
+
if (opts?.status) params.status = opts.status;
|
|
742
|
+
return this._request("GET", "/v1/agents", { params });
|
|
743
|
+
}
|
|
744
|
+
async updateAgent(agentId, updates) {
|
|
745
|
+
return this._request("PATCH", `/v1/agents/${agentId}`, { body: updates });
|
|
746
|
+
}
|
|
747
|
+
async deleteAgent(agentId) {
|
|
748
|
+
return this._request("DELETE", `/v1/agents/${agentId}`);
|
|
749
|
+
}
|
|
750
|
+
// ========================================================================
|
|
751
|
+
// Missions (Runtime v2)
|
|
752
|
+
// ========================================================================
|
|
753
|
+
async createMission(params) {
|
|
754
|
+
const body = {
|
|
755
|
+
agent_id: params.agent_id,
|
|
756
|
+
goal: params.goal
|
|
757
|
+
};
|
|
758
|
+
if (params.constraints !== void 0) body.constraints = params.constraints;
|
|
759
|
+
if (params.success_criteria !== void 0) body.success_criteria = params.success_criteria;
|
|
760
|
+
if (params.allowed_capabilities !== void 0) body.allowed_capabilities = params.allowed_capabilities;
|
|
761
|
+
if (params.escalation_rules !== void 0) body.escalation_rules = params.escalation_rules;
|
|
762
|
+
if (params.stop_conditions !== void 0) body.stop_conditions = params.stop_conditions;
|
|
763
|
+
if (params.config !== void 0) body.config = params.config;
|
|
764
|
+
return this._request("POST", "/v1/missions", { body });
|
|
765
|
+
}
|
|
766
|
+
async getMission(missionId) {
|
|
767
|
+
return this._request("GET", `/v1/missions/${missionId}`);
|
|
768
|
+
}
|
|
769
|
+
async listMissions(opts) {
|
|
770
|
+
const params = {
|
|
771
|
+
limit: opts?.limit ?? 100,
|
|
772
|
+
offset: opts?.offset ?? 0
|
|
773
|
+
};
|
|
774
|
+
if (opts?.agent_id) params.agent_id = opts.agent_id;
|
|
775
|
+
if (opts?.status) params.status = opts.status;
|
|
776
|
+
return this._request("GET", "/v1/missions", { params });
|
|
777
|
+
}
|
|
778
|
+
async updateMission(missionId, updates) {
|
|
779
|
+
return this._request("PATCH", `/v1/missions/${missionId}`, { body: updates });
|
|
780
|
+
}
|
|
781
|
+
async deleteMission(missionId) {
|
|
782
|
+
return this._request("DELETE", `/v1/missions/${missionId}`);
|
|
783
|
+
}
|
|
784
|
+
async pauseMission(missionId) {
|
|
785
|
+
return this._request("POST", `/v1/missions/${missionId}/pause`);
|
|
786
|
+
}
|
|
787
|
+
async resumeMission(missionId) {
|
|
788
|
+
return this._request("POST", `/v1/missions/${missionId}/resume`);
|
|
789
|
+
}
|
|
790
|
+
async cancelMission(missionId) {
|
|
791
|
+
return this._request("POST", `/v1/missions/${missionId}/cancel`);
|
|
792
|
+
}
|
|
793
|
+
// ========================================================================
|
|
794
|
+
// Capabilities (Runtime v2)
|
|
795
|
+
// ========================================================================
|
|
796
|
+
async createCapability(params) {
|
|
797
|
+
const body = { name: params.name };
|
|
798
|
+
if (params.capability_id !== void 0) body.capability_id = params.capability_id;
|
|
799
|
+
if (params.description !== void 0) body.description = params.description;
|
|
800
|
+
if (params.tools !== void 0) body.tools = params.tools;
|
|
801
|
+
if (params.risk_levels !== void 0) body.risk_levels = params.risk_levels;
|
|
802
|
+
if (params.approval_requirements !== void 0) body.approval_requirements = params.approval_requirements;
|
|
803
|
+
if (params.memory_behavior !== void 0) body.memory_behavior = params.memory_behavior;
|
|
804
|
+
if (params.eval_rules !== void 0) body.eval_rules = params.eval_rules;
|
|
805
|
+
if (params.config !== void 0) body.config = params.config;
|
|
806
|
+
return this._request("POST", "/v1/capabilities", { body });
|
|
807
|
+
}
|
|
808
|
+
async getCapability(capabilityId) {
|
|
809
|
+
return this._request("GET", `/v1/capabilities/${capabilityId}`);
|
|
810
|
+
}
|
|
811
|
+
async listCapabilities(opts) {
|
|
812
|
+
const params = {
|
|
813
|
+
limit: opts?.limit ?? 100,
|
|
814
|
+
offset: opts?.offset ?? 0
|
|
815
|
+
};
|
|
816
|
+
if (opts?.status) params.status = opts.status;
|
|
817
|
+
return this._request("GET", "/v1/capabilities", { params });
|
|
818
|
+
}
|
|
819
|
+
async updateCapability(capabilityId, updates) {
|
|
820
|
+
return this._request("PATCH", `/v1/capabilities/${capabilityId}`, { body: updates });
|
|
821
|
+
}
|
|
822
|
+
async deleteCapability(capabilityId) {
|
|
823
|
+
return this._request("DELETE", `/v1/capabilities/${capabilityId}`);
|
|
824
|
+
}
|
|
825
|
+
// ========================================================================
|
|
826
|
+
// Checkpoints (Runtime v2)
|
|
827
|
+
// ========================================================================
|
|
828
|
+
async createCheckpoint(missionId, opts) {
|
|
829
|
+
const body = {};
|
|
830
|
+
if (opts?.label !== void 0) body.label = opts.label;
|
|
831
|
+
if (opts?.metadata !== void 0) body.metadata = opts.metadata;
|
|
832
|
+
return this._request("POST", `/v1/missions/${missionId}/checkpoints`, { body });
|
|
833
|
+
}
|
|
834
|
+
async getCheckpoint(checkpointId) {
|
|
835
|
+
return this._request("GET", `/v1/checkpoints/${checkpointId}`);
|
|
836
|
+
}
|
|
837
|
+
async listCheckpoints(missionId, opts) {
|
|
838
|
+
const params = {
|
|
839
|
+
limit: opts?.limit ?? 100,
|
|
840
|
+
offset: opts?.offset ?? 0
|
|
841
|
+
};
|
|
842
|
+
return this._request("GET", `/v1/missions/${missionId}/checkpoints`, { params });
|
|
843
|
+
}
|
|
844
|
+
async rollbackToCheckpoint(missionId, checkpointId, opts) {
|
|
845
|
+
const body = { checkpoint_id: checkpointId };
|
|
846
|
+
if (opts?.reason !== void 0) body.reason = opts.reason;
|
|
847
|
+
return this._request("POST", `/v1/missions/${missionId}/rollback`, { body });
|
|
848
|
+
}
|
|
849
|
+
// ========================================================================
|
|
850
|
+
// Interventions (Runtime v2)
|
|
851
|
+
// ========================================================================
|
|
852
|
+
async createIntervention(params) {
|
|
853
|
+
const body = {
|
|
854
|
+
intervention_type: params.intervention_type
|
|
855
|
+
};
|
|
856
|
+
if (params.mission_id !== void 0) body.mission_id = params.mission_id;
|
|
857
|
+
if (params.action_id !== void 0) body.action_id = params.action_id;
|
|
858
|
+
if (params.agent_id !== void 0) body.agent_id = params.agent_id;
|
|
859
|
+
if (params.rationale !== void 0) body.rationale = params.rationale;
|
|
860
|
+
if (params.metadata !== void 0) body.metadata = params.metadata;
|
|
861
|
+
return this._request("POST", "/v1/interventions", { body });
|
|
862
|
+
}
|
|
863
|
+
async getIntervention(interventionId) {
|
|
864
|
+
return this._request("GET", `/v1/interventions/${interventionId}`);
|
|
865
|
+
}
|
|
866
|
+
async listInterventions(opts) {
|
|
867
|
+
const params = {
|
|
868
|
+
limit: opts?.limit ?? 100,
|
|
869
|
+
offset: opts?.offset ?? 0
|
|
870
|
+
};
|
|
871
|
+
if (opts?.mission_id) params.mission_id = opts.mission_id;
|
|
872
|
+
if (opts?.agent_id) params.agent_id = opts.agent_id;
|
|
873
|
+
if (opts?.intervention_type) params.type = opts.intervention_type;
|
|
874
|
+
return this._request("GET", "/v1/interventions", { params });
|
|
875
|
+
}
|
|
715
876
|
};
|
|
716
877
|
export {
|
|
717
878
|
Novyx,
|