@agent-os-sdk/client 0.1.1 → 0.1.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/client/AgentOsClient.d.ts +28 -4
- package/dist/client/AgentOsClient.d.ts.map +1 -1
- package/dist/client/AgentOsClient.js +40 -3
- package/dist/generated/openapi.d.ts +93 -0
- package/dist/generated/openapi.d.ts.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/modules/approvals.d.ts +78 -0
- package/dist/modules/approvals.d.ts.map +1 -0
- package/dist/modules/approvals.js +157 -0
- package/dist/modules/artifacts.d.ts +100 -0
- package/dist/modules/artifacts.d.ts.map +1 -0
- package/dist/modules/artifacts.js +217 -0
- package/dist/modules/budgets.d.ts +104 -0
- package/dist/modules/budgets.d.ts.map +1 -0
- package/dist/modules/budgets.js +161 -0
- package/dist/modules/builder.d.ts +2 -2
- package/dist/modules/builder.d.ts.map +1 -1
- package/dist/modules/builder.js +5 -5
- package/dist/modules/capabilities.d.ts +68 -0
- package/dist/modules/capabilities.d.ts.map +1 -0
- package/dist/modules/capabilities.js +113 -0
- package/dist/modules/deployments.d.ts +110 -0
- package/dist/modules/deployments.d.ts.map +1 -0
- package/dist/modules/deployments.js +230 -0
- package/dist/modules/flows.d.ts +104 -0
- package/dist/modules/flows.d.ts.map +1 -0
- package/dist/modules/flows.js +190 -0
- package/dist/modules/handoff.d.ts +88 -0
- package/dist/modules/handoff.d.ts.map +1 -0
- package/dist/modules/handoff.js +128 -0
- package/dist/modules/incidents.d.ts +133 -0
- package/dist/modules/incidents.d.ts.map +1 -0
- package/dist/modules/incidents.js +231 -0
- package/dist/modules/members.d.ts +5 -0
- package/dist/modules/members.d.ts.map +1 -1
- package/dist/modules/members.js +10 -0
- package/dist/modules/policies.d.ts +103 -0
- package/dist/modules/policies.d.ts.map +1 -0
- package/dist/modules/policies.js +180 -0
- package/dist/modules/runs.d.ts.map +1 -1
- package/dist/modules/tenants.d.ts +4 -0
- package/dist/modules/tenants.d.ts.map +1 -1
- package/dist/modules/tenants.js +8 -0
- package/package.json +49 -48
- package/src/client/AgentOsClient.ts +45 -7
- package/src/generated/openapi.ts +93 -0
- package/src/generated/swagger.json +107 -0
- package/src/index.ts +11 -0
- package/src/modules/approvals.ts +210 -0
- package/src/modules/artifacts.ts +287 -0
- package/src/modules/budgets.ts +236 -0
- package/src/modules/builder.ts +3 -3
- package/src/modules/capabilities.ts +176 -0
- package/src/modules/deployments.ts +315 -0
- package/src/modules/flows.ts +259 -0
- package/src/modules/handoff.ts +204 -0
- package/src/modules/incidents.ts +339 -0
- package/src/modules/members.ts +11 -0
- package/src/modules/policies.ts +258 -0
- package/src/modules/tenants.ts +9 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handoff Module - Multi-Agent Delegation
|
|
3
|
+
*
|
|
4
|
+
* // MOCK - This module contains mock implementations for future features
|
|
5
|
+
*
|
|
6
|
+
* Provides first-class support for agent handoffs, delegation,
|
|
7
|
+
* thread forking, and run chain management.
|
|
8
|
+
*/
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Module
|
|
11
|
+
// ============================================================================
|
|
12
|
+
export class HandoffModule {
|
|
13
|
+
client;
|
|
14
|
+
headers;
|
|
15
|
+
constructor(client, headers) {
|
|
16
|
+
this.client = client;
|
|
17
|
+
this.headers = headers;
|
|
18
|
+
}
|
|
19
|
+
// MOCK - Simulated handoff
|
|
20
|
+
/**
|
|
21
|
+
* Hand off current run to another agent.
|
|
22
|
+
*/
|
|
23
|
+
async handoff(runId, toAgentId, options) {
|
|
24
|
+
// MOCK - Returns simulated data
|
|
25
|
+
const mockResult = {
|
|
26
|
+
run_id: `run_handoff_${Date.now()}`,
|
|
27
|
+
parent_run_id: runId,
|
|
28
|
+
to_agent_id: toAgentId,
|
|
29
|
+
mode: options?.mode || "subthread",
|
|
30
|
+
thread_id: `thread_${Date.now()}`,
|
|
31
|
+
status: "pending",
|
|
32
|
+
created_at: new Date().toISOString(),
|
|
33
|
+
};
|
|
34
|
+
return { data: mockResult, error: undefined, response: new Response() };
|
|
35
|
+
}
|
|
36
|
+
// MOCK - Simulated fork
|
|
37
|
+
/**
|
|
38
|
+
* Fork a thread into a new conversation branch.
|
|
39
|
+
*/
|
|
40
|
+
async fork(threadId, options) {
|
|
41
|
+
// MOCK - Returns simulated data
|
|
42
|
+
const mockResult = {
|
|
43
|
+
original_thread_id: threadId,
|
|
44
|
+
forked_thread_id: `thread_fork_${Date.now()}`,
|
|
45
|
+
checkpoint_id: options?.checkpoint_id,
|
|
46
|
+
created_at: new Date().toISOString(),
|
|
47
|
+
};
|
|
48
|
+
return { data: mockResult, error: undefined, response: new Response() };
|
|
49
|
+
}
|
|
50
|
+
// MOCK - Simulated chain
|
|
51
|
+
/**
|
|
52
|
+
* Get the full run chain (delegation tree).
|
|
53
|
+
*/
|
|
54
|
+
async getChain(runId) {
|
|
55
|
+
// MOCK - Returns simulated data
|
|
56
|
+
const mockChain = {
|
|
57
|
+
root_run_id: runId,
|
|
58
|
+
total_runs: 3,
|
|
59
|
+
max_depth: 2,
|
|
60
|
+
nodes: [
|
|
61
|
+
{
|
|
62
|
+
run_id: runId,
|
|
63
|
+
agent_id: "agent_1",
|
|
64
|
+
agent_name: "Main Agent",
|
|
65
|
+
status: "completed",
|
|
66
|
+
depth: 0,
|
|
67
|
+
started_at: new Date(Date.now() - 60000).toISOString(),
|
|
68
|
+
completed_at: new Date().toISOString(),
|
|
69
|
+
children: [
|
|
70
|
+
{
|
|
71
|
+
run_id: `${runId}_child_1`,
|
|
72
|
+
agent_id: "agent_2",
|
|
73
|
+
agent_name: "Research Agent",
|
|
74
|
+
status: "completed",
|
|
75
|
+
parent_run_id: runId,
|
|
76
|
+
depth: 1,
|
|
77
|
+
started_at: new Date(Date.now() - 30000).toISOString(),
|
|
78
|
+
completed_at: new Date().toISOString(),
|
|
79
|
+
children: [],
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
};
|
|
85
|
+
return { data: mockChain, error: undefined, response: new Response() };
|
|
86
|
+
}
|
|
87
|
+
// MOCK - Simulated parents
|
|
88
|
+
/**
|
|
89
|
+
* Get parent runs in the chain.
|
|
90
|
+
*/
|
|
91
|
+
async getParents(runId) {
|
|
92
|
+
// MOCK - Returns simulated data
|
|
93
|
+
const mockParents = [
|
|
94
|
+
{
|
|
95
|
+
run_id: `parent_${runId}`,
|
|
96
|
+
agent_id: "agent_parent",
|
|
97
|
+
agent_name: "Parent Agent",
|
|
98
|
+
status: "completed",
|
|
99
|
+
depth: 0,
|
|
100
|
+
started_at: new Date(Date.now() - 120000).toISOString(),
|
|
101
|
+
completed_at: new Date(Date.now() - 60000).toISOString(),
|
|
102
|
+
children: [],
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
return { data: mockParents, error: undefined, response: new Response() };
|
|
106
|
+
}
|
|
107
|
+
// MOCK - Simulated children
|
|
108
|
+
/**
|
|
109
|
+
* Get child runs in the chain.
|
|
110
|
+
*/
|
|
111
|
+
async getChildren(runId) {
|
|
112
|
+
// MOCK - Returns simulated data
|
|
113
|
+
const mockChildren = [
|
|
114
|
+
{
|
|
115
|
+
run_id: `child_1_${runId}`,
|
|
116
|
+
agent_id: "agent_child_1",
|
|
117
|
+
agent_name: "Child Agent 1",
|
|
118
|
+
status: "completed",
|
|
119
|
+
parent_run_id: runId,
|
|
120
|
+
depth: 1,
|
|
121
|
+
started_at: new Date(Date.now() - 30000).toISOString(),
|
|
122
|
+
completed_at: new Date().toISOString(),
|
|
123
|
+
children: [],
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
return { data: mockChildren, error: undefined, response: new Response() };
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incidents Module - Operational Incidents & Postmortems
|
|
3
|
+
*
|
|
4
|
+
* // MOCK - This module contains mock implementations for future features
|
|
5
|
+
*
|
|
6
|
+
* Provides incident management, SLO tracking, and postmortem creation.
|
|
7
|
+
* Brings Datadog vibes to agent operations.
|
|
8
|
+
*/
|
|
9
|
+
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
10
|
+
export type IncidentSeverity = "critical" | "major" | "minor" | "warning";
|
|
11
|
+
export type IncidentStatus = "open" | "investigating" | "identified" | "monitoring" | "resolved";
|
|
12
|
+
export interface Incident {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
severity: IncidentSeverity;
|
|
17
|
+
status: IncidentStatus;
|
|
18
|
+
affected_agents: string[];
|
|
19
|
+
affected_runs: string[];
|
|
20
|
+
root_cause?: string;
|
|
21
|
+
resolution?: string;
|
|
22
|
+
created_at: string;
|
|
23
|
+
updated_at: string;
|
|
24
|
+
resolved_at?: string;
|
|
25
|
+
created_by: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SLO {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
target_percentage: number;
|
|
32
|
+
current_percentage: number;
|
|
33
|
+
metric_type: "availability" | "latency" | "error_rate" | "success_rate";
|
|
34
|
+
threshold?: number;
|
|
35
|
+
window_days: number;
|
|
36
|
+
status: "healthy" | "at_risk" | "breached";
|
|
37
|
+
budget_remaining: number;
|
|
38
|
+
created_at: string;
|
|
39
|
+
}
|
|
40
|
+
export interface Postmortem {
|
|
41
|
+
id: string;
|
|
42
|
+
incident_id: string;
|
|
43
|
+
title: string;
|
|
44
|
+
summary: string;
|
|
45
|
+
timeline: PostmortemEvent[];
|
|
46
|
+
root_cause_analysis: string;
|
|
47
|
+
impact: string;
|
|
48
|
+
action_items: ActionItem[];
|
|
49
|
+
lessons_learned: string[];
|
|
50
|
+
created_at: string;
|
|
51
|
+
created_by: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PostmortemEvent {
|
|
54
|
+
timestamp: string;
|
|
55
|
+
description: string;
|
|
56
|
+
actor?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ActionItem {
|
|
59
|
+
id: string;
|
|
60
|
+
description: string;
|
|
61
|
+
owner: string;
|
|
62
|
+
due_date?: string;
|
|
63
|
+
status: "open" | "in_progress" | "completed";
|
|
64
|
+
}
|
|
65
|
+
export interface IncidentListResponse {
|
|
66
|
+
items: Incident[];
|
|
67
|
+
total: number;
|
|
68
|
+
open_count: number;
|
|
69
|
+
}
|
|
70
|
+
export interface SLOListResponse {
|
|
71
|
+
items: SLO[];
|
|
72
|
+
total: number;
|
|
73
|
+
}
|
|
74
|
+
export declare class IncidentsModule {
|
|
75
|
+
private client;
|
|
76
|
+
private headers;
|
|
77
|
+
constructor(client: RawClient, headers: () => Record<string, string>);
|
|
78
|
+
/**
|
|
79
|
+
* List all incidents.
|
|
80
|
+
*/
|
|
81
|
+
list(params?: {
|
|
82
|
+
status?: IncidentStatus;
|
|
83
|
+
severity?: IncidentSeverity;
|
|
84
|
+
}): Promise<APIResponse<IncidentListResponse>>;
|
|
85
|
+
/**
|
|
86
|
+
* Get an incident by ID.
|
|
87
|
+
*/
|
|
88
|
+
get(incidentId: string): Promise<APIResponse<Incident>>;
|
|
89
|
+
/**
|
|
90
|
+
* Create a new incident.
|
|
91
|
+
*/
|
|
92
|
+
create(body: {
|
|
93
|
+
title: string;
|
|
94
|
+
description: string;
|
|
95
|
+
severity: IncidentSeverity;
|
|
96
|
+
affected_agents?: string[];
|
|
97
|
+
}): Promise<APIResponse<Incident>>;
|
|
98
|
+
/**
|
|
99
|
+
* Resolve an incident.
|
|
100
|
+
*/
|
|
101
|
+
resolve(incidentId: string, resolution: string): Promise<APIResponse<Incident>>;
|
|
102
|
+
/**
|
|
103
|
+
* Link runs to an incident.
|
|
104
|
+
*/
|
|
105
|
+
linkRuns(incidentId: string, runIds: string[]): Promise<APIResponse<Incident>>;
|
|
106
|
+
/**
|
|
107
|
+
* List all SLOs.
|
|
108
|
+
*/
|
|
109
|
+
listSLOs(): Promise<APIResponse<SLOListResponse>>;
|
|
110
|
+
/**
|
|
111
|
+
* Create or update an SLO.
|
|
112
|
+
*/
|
|
113
|
+
setSLO(body: {
|
|
114
|
+
name: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
target_percentage: number;
|
|
117
|
+
metric_type: SLO["metric_type"];
|
|
118
|
+
threshold?: number;
|
|
119
|
+
window_days: number;
|
|
120
|
+
}): Promise<APIResponse<SLO>>;
|
|
121
|
+
/**
|
|
122
|
+
* Create a postmortem for an incident.
|
|
123
|
+
*/
|
|
124
|
+
createPostmortem(incidentId: string, body: {
|
|
125
|
+
title: string;
|
|
126
|
+
summary: string;
|
|
127
|
+
root_cause_analysis: string;
|
|
128
|
+
impact: string;
|
|
129
|
+
lessons_learned: string[];
|
|
130
|
+
action_items: Omit<ActionItem, "id" | "status">[];
|
|
131
|
+
}): Promise<APIResponse<Postmortem>>;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=incidents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incidents.d.ts","sourceRoot":"","sources":["../../src/modules/incidents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAM/D,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,eAAe,GAAG,YAAY,GAAG,YAAY,GAAG,UAAU,CAAC;AAEjG,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC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M,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAoBpF;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAgDvD;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE;QACf,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,WAAW,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;QAChC,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAqB7B;;OAEG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;QAC7C,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,MAAM,EAAE,MAAM,CAAC;QACf,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,QAAQ,CAAC,EAAE,CAAC;KACrD,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;CAyBvC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incidents Module - Operational Incidents & Postmortems
|
|
3
|
+
*
|
|
4
|
+
* // MOCK - This module contains mock implementations for future features
|
|
5
|
+
*
|
|
6
|
+
* Provides incident management, SLO tracking, and postmortem creation.
|
|
7
|
+
* Brings Datadog vibes to agent operations.
|
|
8
|
+
*/
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Module
|
|
11
|
+
// ============================================================================
|
|
12
|
+
export class IncidentsModule {
|
|
13
|
+
client;
|
|
14
|
+
headers;
|
|
15
|
+
constructor(client, headers) {
|
|
16
|
+
this.client = client;
|
|
17
|
+
this.headers = headers;
|
|
18
|
+
}
|
|
19
|
+
// ========== Incidents ==========
|
|
20
|
+
// MOCK - Simulated list
|
|
21
|
+
/**
|
|
22
|
+
* List all incidents.
|
|
23
|
+
*/
|
|
24
|
+
async list(params) {
|
|
25
|
+
// MOCK - Returns simulated data
|
|
26
|
+
const mockIncidents = {
|
|
27
|
+
items: [
|
|
28
|
+
{
|
|
29
|
+
id: "inc_1",
|
|
30
|
+
title: "High error rate on Support Agent",
|
|
31
|
+
description: "Error rate exceeded 5% threshold",
|
|
32
|
+
severity: "major",
|
|
33
|
+
status: "investigating",
|
|
34
|
+
affected_agents: ["agent_support"],
|
|
35
|
+
affected_runs: ["run_123", "run_124", "run_125"],
|
|
36
|
+
created_at: new Date(Date.now() - 3600000).toISOString(),
|
|
37
|
+
updated_at: new Date().toISOString(),
|
|
38
|
+
created_by: "system",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
total: 1,
|
|
42
|
+
open_count: 1,
|
|
43
|
+
};
|
|
44
|
+
return { data: mockIncidents, error: undefined, response: new Response() };
|
|
45
|
+
}
|
|
46
|
+
// MOCK - Simulated get
|
|
47
|
+
/**
|
|
48
|
+
* Get an incident by ID.
|
|
49
|
+
*/
|
|
50
|
+
async get(incidentId) {
|
|
51
|
+
// MOCK - Returns simulated data
|
|
52
|
+
const mockIncident = {
|
|
53
|
+
id: incidentId,
|
|
54
|
+
title: "High error rate on Support Agent",
|
|
55
|
+
description: "Error rate exceeded 5% threshold",
|
|
56
|
+
severity: "major",
|
|
57
|
+
status: "investigating",
|
|
58
|
+
affected_agents: ["agent_support"],
|
|
59
|
+
affected_runs: ["run_123", "run_124", "run_125"],
|
|
60
|
+
created_at: new Date(Date.now() - 3600000).toISOString(),
|
|
61
|
+
updated_at: new Date().toISOString(),
|
|
62
|
+
created_by: "system",
|
|
63
|
+
};
|
|
64
|
+
return { data: mockIncident, error: undefined, response: new Response() };
|
|
65
|
+
}
|
|
66
|
+
// MOCK - Simulated create
|
|
67
|
+
/**
|
|
68
|
+
* Create a new incident.
|
|
69
|
+
*/
|
|
70
|
+
async create(body) {
|
|
71
|
+
// MOCK - Returns simulated data
|
|
72
|
+
const mockIncident = {
|
|
73
|
+
id: `inc_${Date.now()}`,
|
|
74
|
+
title: body.title,
|
|
75
|
+
description: body.description,
|
|
76
|
+
severity: body.severity,
|
|
77
|
+
status: "open",
|
|
78
|
+
affected_agents: body.affected_agents || [],
|
|
79
|
+
affected_runs: [],
|
|
80
|
+
created_at: new Date().toISOString(),
|
|
81
|
+
updated_at: new Date().toISOString(),
|
|
82
|
+
created_by: "user_current",
|
|
83
|
+
};
|
|
84
|
+
return { data: mockIncident, error: undefined, response: new Response() };
|
|
85
|
+
}
|
|
86
|
+
// MOCK - Simulated resolve
|
|
87
|
+
/**
|
|
88
|
+
* Resolve an incident.
|
|
89
|
+
*/
|
|
90
|
+
async resolve(incidentId, resolution) {
|
|
91
|
+
// MOCK - Returns simulated data
|
|
92
|
+
const mockIncident = {
|
|
93
|
+
id: incidentId,
|
|
94
|
+
title: "High error rate on Support Agent",
|
|
95
|
+
description: "Error rate exceeded 5% threshold",
|
|
96
|
+
severity: "major",
|
|
97
|
+
status: "resolved",
|
|
98
|
+
affected_agents: ["agent_support"],
|
|
99
|
+
affected_runs: [],
|
|
100
|
+
root_cause: "Model provider rate limit",
|
|
101
|
+
resolution,
|
|
102
|
+
created_at: new Date(Date.now() - 7200000).toISOString(),
|
|
103
|
+
updated_at: new Date().toISOString(),
|
|
104
|
+
resolved_at: new Date().toISOString(),
|
|
105
|
+
created_by: "system",
|
|
106
|
+
};
|
|
107
|
+
return { data: mockIncident, error: undefined, response: new Response() };
|
|
108
|
+
}
|
|
109
|
+
// MOCK - Simulated linkRuns
|
|
110
|
+
/**
|
|
111
|
+
* Link runs to an incident.
|
|
112
|
+
*/
|
|
113
|
+
async linkRuns(incidentId, runIds) {
|
|
114
|
+
// MOCK - Returns simulated data
|
|
115
|
+
const mockIncident = {
|
|
116
|
+
id: incidentId,
|
|
117
|
+
title: "High error rate on Support Agent",
|
|
118
|
+
description: "Error rate exceeded 5% threshold",
|
|
119
|
+
severity: "major",
|
|
120
|
+
status: "investigating",
|
|
121
|
+
affected_agents: ["agent_support"],
|
|
122
|
+
affected_runs: runIds,
|
|
123
|
+
created_at: new Date(Date.now() - 3600000).toISOString(),
|
|
124
|
+
updated_at: new Date().toISOString(),
|
|
125
|
+
created_by: "system",
|
|
126
|
+
};
|
|
127
|
+
return { data: mockIncident, error: undefined, response: new Response() };
|
|
128
|
+
}
|
|
129
|
+
// ========== SLOs ==========
|
|
130
|
+
// MOCK - Simulated listSLOs
|
|
131
|
+
/**
|
|
132
|
+
* List all SLOs.
|
|
133
|
+
*/
|
|
134
|
+
async listSLOs() {
|
|
135
|
+
// MOCK - Returns simulated data
|
|
136
|
+
const mockSLOs = {
|
|
137
|
+
items: [
|
|
138
|
+
{
|
|
139
|
+
id: "slo_availability",
|
|
140
|
+
name: "Agent Availability",
|
|
141
|
+
description: "99.9% availability for all agents",
|
|
142
|
+
target_percentage: 99.9,
|
|
143
|
+
current_percentage: 99.95,
|
|
144
|
+
metric_type: "availability",
|
|
145
|
+
window_days: 30,
|
|
146
|
+
status: "healthy",
|
|
147
|
+
budget_remaining: 0.05,
|
|
148
|
+
created_at: new Date(Date.now() - 86400000 * 30).toISOString(),
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: "slo_latency",
|
|
152
|
+
name: "Response Latency",
|
|
153
|
+
description: "P95 latency under 2s",
|
|
154
|
+
target_percentage: 95,
|
|
155
|
+
current_percentage: 97.5,
|
|
156
|
+
metric_type: "latency",
|
|
157
|
+
threshold: 2000,
|
|
158
|
+
window_days: 7,
|
|
159
|
+
status: "healthy",
|
|
160
|
+
budget_remaining: 2.5,
|
|
161
|
+
created_at: new Date(Date.now() - 86400000 * 7).toISOString(),
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: "slo_errors",
|
|
165
|
+
name: "Error Rate",
|
|
166
|
+
description: "Error rate below 1%",
|
|
167
|
+
target_percentage: 99,
|
|
168
|
+
current_percentage: 98.2,
|
|
169
|
+
metric_type: "error_rate",
|
|
170
|
+
window_days: 7,
|
|
171
|
+
status: "at_risk",
|
|
172
|
+
budget_remaining: -0.8,
|
|
173
|
+
created_at: new Date(Date.now() - 86400000 * 7).toISOString(),
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
total: 3,
|
|
177
|
+
};
|
|
178
|
+
return { data: mockSLOs, error: undefined, response: new Response() };
|
|
179
|
+
}
|
|
180
|
+
// MOCK - Simulated setSLO
|
|
181
|
+
/**
|
|
182
|
+
* Create or update an SLO.
|
|
183
|
+
*/
|
|
184
|
+
async setSLO(body) {
|
|
185
|
+
// MOCK - Returns simulated data
|
|
186
|
+
const mockSLO = {
|
|
187
|
+
id: `slo_${Date.now()}`,
|
|
188
|
+
name: body.name,
|
|
189
|
+
description: body.description,
|
|
190
|
+
target_percentage: body.target_percentage,
|
|
191
|
+
current_percentage: 100,
|
|
192
|
+
metric_type: body.metric_type,
|
|
193
|
+
threshold: body.threshold,
|
|
194
|
+
window_days: body.window_days,
|
|
195
|
+
status: "healthy",
|
|
196
|
+
budget_remaining: 100 - body.target_percentage,
|
|
197
|
+
created_at: new Date().toISOString(),
|
|
198
|
+
};
|
|
199
|
+
return { data: mockSLO, error: undefined, response: new Response() };
|
|
200
|
+
}
|
|
201
|
+
// ========== Postmortems ==========
|
|
202
|
+
// MOCK - Simulated createPostmortem
|
|
203
|
+
/**
|
|
204
|
+
* Create a postmortem for an incident.
|
|
205
|
+
*/
|
|
206
|
+
async createPostmortem(incidentId, body) {
|
|
207
|
+
// MOCK - Returns simulated data
|
|
208
|
+
const mockPostmortem = {
|
|
209
|
+
id: `pm_${Date.now()}`,
|
|
210
|
+
incident_id: incidentId,
|
|
211
|
+
title: body.title,
|
|
212
|
+
summary: body.summary,
|
|
213
|
+
timeline: [
|
|
214
|
+
{ timestamp: new Date(Date.now() - 7200000).toISOString(), description: "Incident detected" },
|
|
215
|
+
{ timestamp: new Date(Date.now() - 3600000).toISOString(), description: "Root cause identified" },
|
|
216
|
+
{ timestamp: new Date().toISOString(), description: "Incident resolved" },
|
|
217
|
+
],
|
|
218
|
+
root_cause_analysis: body.root_cause_analysis,
|
|
219
|
+
impact: body.impact,
|
|
220
|
+
action_items: body.action_items.map((item, i) => ({
|
|
221
|
+
...item,
|
|
222
|
+
id: `action_${i}`,
|
|
223
|
+
status: "open",
|
|
224
|
+
})),
|
|
225
|
+
lessons_learned: body.lessons_learned,
|
|
226
|
+
created_at: new Date().toISOString(),
|
|
227
|
+
created_by: "user_current",
|
|
228
|
+
};
|
|
229
|
+
return { data: mockPostmortem, error: undefined, response: new Response() };
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -73,5 +73,10 @@ export declare class MembersModule {
|
|
|
73
73
|
* Resend invitation email.
|
|
74
74
|
*/
|
|
75
75
|
resendInvite(memberId: string): Promise<APIResponse<void>>;
|
|
76
|
+
/**
|
|
77
|
+
* Ensure membership exists (auto-create on first access).
|
|
78
|
+
* This is used by the frontend for onboarding.
|
|
79
|
+
*/
|
|
80
|
+
ensure(tenantId?: string): Promise<APIResponse<Member>>;
|
|
76
81
|
}
|
|
77
82
|
//# sourceMappingURL=members.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../src/modules/members.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MA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OAGG;IACG,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAMhE"}
|
package/dist/modules/members.js
CHANGED
|
@@ -74,4 +74,14 @@ export class MembersModule {
|
|
|
74
74
|
headers: this.headers(),
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Ensure membership exists (auto-create on first access).
|
|
79
|
+
* This is used by the frontend for onboarding.
|
|
80
|
+
*/
|
|
81
|
+
async ensure(tenantId) {
|
|
82
|
+
return this.client.POST("/v1/api/memberships/ensure", {
|
|
83
|
+
body: { tenant_id: tenantId ?? null },
|
|
84
|
+
headers: this.headers(),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
77
87
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policies Module - Governance Rules
|
|
3
|
+
*
|
|
4
|
+
* // MOCK - This module contains mock implementations for future features
|
|
5
|
+
*
|
|
6
|
+
* Defines and evaluates policies that control agent behavior.
|
|
7
|
+
* Enables enterprise governance and compliance.
|
|
8
|
+
*/
|
|
9
|
+
import type { RawClient, APIResponse } from "../client/raw.js";
|
|
10
|
+
export type PolicyType = "allow" | "deny" | "require_approval" | "audit";
|
|
11
|
+
export type PolicyScope = "tenant" | "workspace" | "agent" | "run";
|
|
12
|
+
export interface Policy {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
type: PolicyType;
|
|
17
|
+
scope: PolicyScope;
|
|
18
|
+
scope_id?: string;
|
|
19
|
+
conditions: PolicyCondition[];
|
|
20
|
+
actions: PolicyAction[];
|
|
21
|
+
priority: number;
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
created_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PolicyCondition {
|
|
27
|
+
field: string;
|
|
28
|
+
operator: "eq" | "neq" | "in" | "not_in" | "gt" | "lt" | "contains" | "regex";
|
|
29
|
+
value: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface PolicyAction {
|
|
32
|
+
type: "block" | "allow" | "require_approval" | "log" | "alert" | "modify";
|
|
33
|
+
config?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
export interface PolicyEvaluationInput {
|
|
36
|
+
action: string;
|
|
37
|
+
resource: string;
|
|
38
|
+
context: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
export interface PolicyEvaluationResult {
|
|
41
|
+
allowed: boolean;
|
|
42
|
+
matched_policies: string[];
|
|
43
|
+
required_approvals: string[];
|
|
44
|
+
warnings: string[];
|
|
45
|
+
audit_entries: PolicyAuditEntry[];
|
|
46
|
+
}
|
|
47
|
+
export interface PolicyAuditEntry {
|
|
48
|
+
policy_id: string;
|
|
49
|
+
policy_name: string;
|
|
50
|
+
decision: "allow" | "deny" | "pending_approval";
|
|
51
|
+
reason: string;
|
|
52
|
+
evaluated_at: string;
|
|
53
|
+
}
|
|
54
|
+
export interface PolicyListResponse {
|
|
55
|
+
items: Policy[];
|
|
56
|
+
total: number;
|
|
57
|
+
}
|
|
58
|
+
export declare class PoliciesModule {
|
|
59
|
+
private client;
|
|
60
|
+
private headers;
|
|
61
|
+
constructor(client: RawClient, headers: () => Record<string, string>);
|
|
62
|
+
/**
|
|
63
|
+
* List all policies.
|
|
64
|
+
*/
|
|
65
|
+
list(params?: {
|
|
66
|
+
scope?: PolicyScope;
|
|
67
|
+
enabled?: boolean;
|
|
68
|
+
}): Promise<APIResponse<PolicyListResponse>>;
|
|
69
|
+
/**
|
|
70
|
+
* Get a policy by ID.
|
|
71
|
+
*/
|
|
72
|
+
get(policyId: string): Promise<APIResponse<Policy>>;
|
|
73
|
+
/**
|
|
74
|
+
* Create a new policy.
|
|
75
|
+
*/
|
|
76
|
+
create(body: {
|
|
77
|
+
name: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
type: PolicyType;
|
|
80
|
+
scope: PolicyScope;
|
|
81
|
+
scope_id?: string;
|
|
82
|
+
conditions: PolicyCondition[];
|
|
83
|
+
actions: PolicyAction[];
|
|
84
|
+
priority?: number;
|
|
85
|
+
}): Promise<APIResponse<Policy>>;
|
|
86
|
+
/**
|
|
87
|
+
* Update a policy.
|
|
88
|
+
*/
|
|
89
|
+
update(policyId: string, body: Partial<Policy>): Promise<APIResponse<Policy>>;
|
|
90
|
+
/**
|
|
91
|
+
* Delete a policy.
|
|
92
|
+
*/
|
|
93
|
+
delete(policyId: string): Promise<APIResponse<void>>;
|
|
94
|
+
/**
|
|
95
|
+
* Evaluate policies against an action (simulation).
|
|
96
|
+
*/
|
|
97
|
+
evaluate(input: PolicyEvaluationInput): Promise<APIResponse<PolicyEvaluationResult>>;
|
|
98
|
+
/**
|
|
99
|
+
* Enforce policies (apply to current context).
|
|
100
|
+
*/
|
|
101
|
+
enforce(runId: string): Promise<APIResponse<PolicyEvaluationResult>>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../src/modules/policies.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAM/D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,kBAAkB,GAAG,OAAO,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,KAAK,CAAC;AAEnE,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,eAAe,EAAE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