@arelis-ai/mcp-server 0.1.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/README.md +182 -0
- package/dist/client.d.ts +7 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +20 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +14 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +56 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/integration/helpers.d.ts +4 -0
- package/dist/integration/helpers.d.ts.map +1 -0
- package/dist/integration/helpers.js +15 -0
- package/dist/integration/helpers.js.map +1 -0
- package/dist/resources/active-policies.d.ts +9 -0
- package/dist/resources/active-policies.d.ts.map +1 -0
- package/dist/resources/active-policies.js +11 -0
- package/dist/resources/active-policies.js.map +1 -0
- package/dist/resources/ai-systems-registry.d.ts +9 -0
- package/dist/resources/ai-systems-registry.d.ts.map +1 -0
- package/dist/resources/ai-systems-registry.js +11 -0
- package/dist/resources/ai-systems-registry.js.map +1 -0
- package/dist/resources/environment-info.d.ts +9 -0
- package/dist/resources/environment-info.d.ts.map +1 -0
- package/dist/resources/environment-info.js +11 -0
- package/dist/resources/environment-info.js.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +27 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/risk-config.d.ts +9 -0
- package/dist/resources/risk-config.d.ts.map +1 -0
- package/dist/resources/risk-config.js +11 -0
- package/dist/resources/risk-config.js.map +1 -0
- package/dist/resources/usage-quotas.d.ts +9 -0
- package/dist/resources/usage-quotas.d.ts.map +1 -0
- package/dist/resources/usage-quotas.js +11 -0
- package/dist/resources/usage-quotas.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +29 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/ai-systems.d.ts +3 -0
- package/dist/tools/ai-systems.d.ts.map +1 -0
- package/dist/tools/ai-systems.js +99 -0
- package/dist/tools/ai-systems.js.map +1 -0
- package/dist/tools/approvals.d.ts +3 -0
- package/dist/tools/approvals.d.ts.map +1 -0
- package/dist/tools/approvals.js +44 -0
- package/dist/tools/approvals.js.map +1 -0
- package/dist/tools/events.d.ts +3 -0
- package/dist/tools/events.d.ts.map +1 -0
- package/dist/tools/events.js +79 -0
- package/dist/tools/events.js.map +1 -0
- package/dist/tools/exports.d.ts +3 -0
- package/dist/tools/exports.d.ts.map +1 -0
- package/dist/tools/exports.js +77 -0
- package/dist/tools/exports.js.map +1 -0
- package/dist/tools/governance.d.ts +3 -0
- package/dist/tools/governance.d.ts.map +1 -0
- package/dist/tools/governance.js +166 -0
- package/dist/tools/governance.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +10 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/jobs.d.ts +3 -0
- package/dist/tools/jobs.d.ts.map +1 -0
- package/dist/tools/jobs.js +62 -0
- package/dist/tools/jobs.js.map +1 -0
- package/dist/tools/proofs.d.ts +3 -0
- package/dist/tools/proofs.d.ts.map +1 -0
- package/dist/tools/proofs.js +55 -0
- package/dist/tools/proofs.js.map +1 -0
- package/dist/tools/replay.d.ts +3 -0
- package/dist/tools/replay.d.ts.map +1 -0
- package/dist/tools/replay.js +77 -0
- package/dist/tools/replay.js.map +1 -0
- package/dist/tools/risk.d.ts +3 -0
- package/dist/tools/risk.d.ts.map +1 -0
- package/dist/tools/risk.js +96 -0
- package/dist/tools/risk.js.map +1 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# @arelis-ai/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for the Arelis Governance API. Exposes 40 tools and 5 resources that let AI assistants interact with audit events, governance policies, risk configuration, compliance proofs, replay verification, and more.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### STDIO (default)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ARELIS_API_KEY=sk_live_... npx @arelis-ai/mcp-server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### HTTP with Bearer auth
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ARELIS_API_KEY=sk_live_... ARELIS_MCP_SECRET=my-secret \
|
|
17
|
+
npx @arelis-ai/mcp-server --transport http --port 3100
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Configuration
|
|
21
|
+
|
|
22
|
+
| Variable | Required | Default | Description |
|
|
23
|
+
|---|---|---|---|
|
|
24
|
+
| `ARELIS_API_KEY` | Yes | — | Arelis platform API key |
|
|
25
|
+
| `ARELIS_BASE_URL` | No | `https://api.arelis.digital` | Arelis API base URL |
|
|
26
|
+
| `ARELIS_MCP_SECRET` | No | — | Bearer token for HTTP transport auth |
|
|
27
|
+
| `DEBUG` | No | `false` | Enable verbose logging |
|
|
28
|
+
|
|
29
|
+
## Claude Desktop Setup
|
|
30
|
+
|
|
31
|
+
Add to `claude_desktop_config.json`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"arelis-governance": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["@arelis-ai/mcp-server"],
|
|
39
|
+
"env": {
|
|
40
|
+
"ARELIS_API_KEY": "sk_live_..."
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Tools (40)
|
|
48
|
+
|
|
49
|
+
### Events (4)
|
|
50
|
+
| Tool | Description |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `arelis_events_create` | Log an audit event |
|
|
53
|
+
| `arelis_events_list` | List audit events with filters |
|
|
54
|
+
| `arelis_events_get` | Get a single audit event by ID |
|
|
55
|
+
| `arelis_events_count` | Count events matching filters |
|
|
56
|
+
|
|
57
|
+
### AI Systems (5)
|
|
58
|
+
| Tool | Description |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `arelis_ai_systems_register` | Register a new AI system |
|
|
61
|
+
| `arelis_ai_systems_list` | List registered AI systems |
|
|
62
|
+
| `arelis_ai_systems_get` | Get AI system details |
|
|
63
|
+
| `arelis_ai_systems_update` | Update an AI system |
|
|
64
|
+
| `arelis_ai_systems_set_default` | Set the default AI system |
|
|
65
|
+
|
|
66
|
+
### Jobs (3)
|
|
67
|
+
| Tool | Description |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `arelis_jobs_list` | List async jobs |
|
|
70
|
+
| `arelis_jobs_get` | Get job status and result |
|
|
71
|
+
| `arelis_jobs_retry` | Retry a failed job |
|
|
72
|
+
|
|
73
|
+
### Governance (9)
|
|
74
|
+
| Tool | Description |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `arelis_governance_policies_create` | Create a governance policy |
|
|
77
|
+
| `arelis_governance_policies_list` | List governance policies |
|
|
78
|
+
| `arelis_governance_policies_get` | Get policy details |
|
|
79
|
+
| `arelis_governance_policies_update` | Update a policy |
|
|
80
|
+
| `arelis_governance_policies_create_version` | Create a new policy version |
|
|
81
|
+
| `arelis_governance_policies_list_versions` | List versions of a policy |
|
|
82
|
+
| `arelis_governance_policies_activate_version` | Activate a specific version |
|
|
83
|
+
| `arelis_governance_policies_simulate` | Simulate policy evaluation |
|
|
84
|
+
| `arelis_governance_evaluations_list` | List policy evaluations |
|
|
85
|
+
|
|
86
|
+
### Risk (6)
|
|
87
|
+
| Tool | Description |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `arelis_risk_config_get` | Get current risk configuration |
|
|
90
|
+
| `arelis_risk_config_save_draft` | Save a risk config draft |
|
|
91
|
+
| `arelis_risk_config_clear_draft` | Discard the current draft |
|
|
92
|
+
| `arelis_risk_config_publish` | Publish draft as active config |
|
|
93
|
+
| `arelis_risk_config_rollback` | Rollback to a previous version |
|
|
94
|
+
| `arelis_risk_simulate` | Simulate a risk assessment |
|
|
95
|
+
|
|
96
|
+
### Proofs (3)
|
|
97
|
+
| Tool | Description |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `arelis_proofs_request` | Request a compliance proof |
|
|
100
|
+
| `arelis_proofs_get` | Get proof details |
|
|
101
|
+
| `arelis_proofs_verify` | Verify a compliance proof |
|
|
102
|
+
|
|
103
|
+
### Approvals (2)
|
|
104
|
+
| Tool | Description |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `arelis_approvals_list` | List pending approvals |
|
|
107
|
+
| `arelis_approvals_resolve` | Approve or reject an approval |
|
|
108
|
+
|
|
109
|
+
### Replay (4)
|
|
110
|
+
| Tool | Description |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `arelis_replay_create` | Create a replay verification |
|
|
113
|
+
| `arelis_replay_get` | Get replay result |
|
|
114
|
+
| `arelis_replay_templates_list` | List replay templates |
|
|
115
|
+
| `arelis_replay_templates_save` | Save a replay template |
|
|
116
|
+
|
|
117
|
+
### Exports (4)
|
|
118
|
+
| Tool | Description |
|
|
119
|
+
|---|---|
|
|
120
|
+
| `arelis_exports_create` | Create a data export |
|
|
121
|
+
| `arelis_exports_list` | List exports |
|
|
122
|
+
| `arelis_exports_get` | Get export details |
|
|
123
|
+
| `arelis_exports_download` | Get export download URL |
|
|
124
|
+
|
|
125
|
+
## Resources (5)
|
|
126
|
+
|
|
127
|
+
| URI | Description |
|
|
128
|
+
|---|---|
|
|
129
|
+
| `arelis://governance/policies` | Active governance policies |
|
|
130
|
+
| `arelis://risk/config` | Current risk configuration |
|
|
131
|
+
| `arelis://context/environment` | Environment information |
|
|
132
|
+
| `arelis://ai-systems/registry` | Registered AI systems |
|
|
133
|
+
| `arelis://usage/quotas` | Usage quotas and limits |
|
|
134
|
+
|
|
135
|
+
## Development
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Install dependencies
|
|
139
|
+
pnpm install
|
|
140
|
+
|
|
141
|
+
# Build
|
|
142
|
+
pnpm --filter @arelis-ai/mcp-server build
|
|
143
|
+
|
|
144
|
+
# Run unit tests (155 tests)
|
|
145
|
+
pnpm --filter @arelis-ai/mcp-server test
|
|
146
|
+
|
|
147
|
+
# Run integration tests
|
|
148
|
+
pnpm --filter @arelis-ai/mcp-server test:integration
|
|
149
|
+
|
|
150
|
+
# Lint
|
|
151
|
+
pnpm --filter @arelis-ai/mcp-server lint
|
|
152
|
+
|
|
153
|
+
# Type check
|
|
154
|
+
pnpm --filter @arelis-ai/mcp-server type-check
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Integration Tests
|
|
158
|
+
|
|
159
|
+
The integration test suite includes:
|
|
160
|
+
|
|
161
|
+
- **In-process startup test**: Uses `InMemoryTransport` to verify the server registers all 40 tools and 5 resources
|
|
162
|
+
- **HTTP transport test**: Spawns the server with `--transport http` and verifies auth rejection (401) and successful initialization
|
|
163
|
+
- **API smoke tests**: Skipped unless `ARELIS_TEST_API_KEY` is set; tests actual API calls through the MCP server
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Run with a live API key for full coverage
|
|
167
|
+
ARELIS_TEST_API_KEY=sk_test_... pnpm --filter @arelis-ai/mcp-server test:integration
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Architecture
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
src/
|
|
174
|
+
index.ts # CLI entry point (STDIO/HTTP transport)
|
|
175
|
+
server.ts # McpServer creation and tool/resource registration
|
|
176
|
+
client.ts # Lazy singleton ArelisPlatform SDK client
|
|
177
|
+
config.ts # Environment variable configuration
|
|
178
|
+
errors.ts # Unified error formatting for MCP responses
|
|
179
|
+
tools/ # 40 tools across 9 categories
|
|
180
|
+
resources/ # 5 read-only resources
|
|
181
|
+
integration/ # Integration test suite
|
|
182
|
+
```
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAKlE,wBAAgB,eAAe,IAAI,cAAc,CAShD;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ArelisPlatform } from "@arelis-ai/arelis-governance-sdk";
|
|
2
|
+
import { getConfig } from "./config.js";
|
|
3
|
+
let instance = null;
|
|
4
|
+
export function getArelisClient() {
|
|
5
|
+
if (!instance) {
|
|
6
|
+
const config = getConfig();
|
|
7
|
+
instance = new ArelisPlatform({
|
|
8
|
+
baseUrl: config.baseUrl,
|
|
9
|
+
apiKey: config.apiKey,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return instance;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Reset the singleton — used in tests.
|
|
16
|
+
*/
|
|
17
|
+
export function resetClient() {
|
|
18
|
+
instance = null;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,IAAI,QAAQ,GAA0B,IAAI,CAAC;AAE3C,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,QAAQ,GAAG,IAAI,cAAc,CAAC;YAC5B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,SAAS,IAAI,eAAe,CAe3C"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function getConfig() {
|
|
2
|
+
const apiKey = process.env.ARELIS_API_KEY;
|
|
3
|
+
if (!apiKey) {
|
|
4
|
+
throw new Error("ARELIS_API_KEY environment variable is required. " +
|
|
5
|
+
"Get your API key from https://app.arelis.dev/settings/api-keys");
|
|
6
|
+
}
|
|
7
|
+
return {
|
|
8
|
+
apiKey,
|
|
9
|
+
baseUrl: process.env.ARELIS_BASE_URL ?? "https://api.arelis.dev",
|
|
10
|
+
mcpSecret: process.env.ARELIS_MCP_SECRET,
|
|
11
|
+
debug: process.env.DEBUG === "true" || process.env.DEBUG === "1",
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,SAAS;IACvB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,mDAAmD;YACjD,gEAAgE,CACnE,CAAC;IACJ,CAAC;IAED,OAAO;QACL,MAAM;QACN,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,wBAAwB;QAChE,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;QACxC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,GAAG;KACjE,CAAC;AACJ,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,IAAI,CAAC;CACf;AASD,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAiD/E"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ArelisApiError } from "@arelis-ai/arelis-governance-sdk";
|
|
2
|
+
import { ZodError } from "zod";
|
|
3
|
+
export function formatToolError(error) {
|
|
4
|
+
let payload;
|
|
5
|
+
if (error instanceof ArelisApiError) {
|
|
6
|
+
const status = error.status ?? 0;
|
|
7
|
+
let errorType;
|
|
8
|
+
if (status === 401 || status === 403) {
|
|
9
|
+
errorType = "auth_error";
|
|
10
|
+
}
|
|
11
|
+
else if (status === 404) {
|
|
12
|
+
errorType = "not_found";
|
|
13
|
+
}
|
|
14
|
+
else if (status === 0 || status >= 500) {
|
|
15
|
+
errorType = "network_error";
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
errorType = "api_error";
|
|
19
|
+
}
|
|
20
|
+
payload = {
|
|
21
|
+
error: errorType,
|
|
22
|
+
message: error.message,
|
|
23
|
+
status,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
else if (error instanceof ZodError) {
|
|
27
|
+
const firstIssue = error.issues[0];
|
|
28
|
+
payload = {
|
|
29
|
+
error: "validation_error",
|
|
30
|
+
message: error.message,
|
|
31
|
+
field: firstIssue?.path?.join(".") || undefined,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
else if (error instanceof Error) {
|
|
35
|
+
payload = {
|
|
36
|
+
error: "internal_error",
|
|
37
|
+
message: error.message,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
payload = {
|
|
42
|
+
error: "internal_error",
|
|
43
|
+
message: String(error),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: "text",
|
|
50
|
+
text: JSON.stringify(payload),
|
|
51
|
+
isError: true,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAe/B,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,OAAyB,CAAC;IAE9B,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;QACjC,IAAI,SAAiB,CAAC;QACtB,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YACrC,SAAS,GAAG,YAAY,CAAC;QAC3B,CAAC;aAAM,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,SAAS,GAAG,WAAW,CAAC;QAC1B,CAAC;aAAM,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;YACzC,SAAS,GAAG,eAAe,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,WAAW,CAAC;QAC1B,CAAC;QAED,OAAO,GAAG;YACR,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,MAAM;SACP,CAAC;IACJ,CAAC;SAAM,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;QACrC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnC,OAAO,GAAG;YACR,KAAK,EAAE,kBAAkB;YACzB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS;SAChD,CAAC;IACJ,CAAC;SAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAClC,OAAO,GAAG;YACR,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,GAAG;YACR,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC;SACvB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBAC7B,OAAO,EAAE,IAAI;aACd;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
4
|
+
import { createServer as createHttpServer } from "node:http";
|
|
5
|
+
import { createServer } from "./server.js";
|
|
6
|
+
function parseArgs() {
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
let transport = "stdio";
|
|
9
|
+
let port = 3100;
|
|
10
|
+
for (let i = 0; i < args.length; i++) {
|
|
11
|
+
if (args[i] === "--transport" && args[i + 1]) {
|
|
12
|
+
const val = args[i + 1];
|
|
13
|
+
if (val === "stdio" || val === "http") {
|
|
14
|
+
transport = val;
|
|
15
|
+
}
|
|
16
|
+
i++;
|
|
17
|
+
}
|
|
18
|
+
else if (args[i] === "--port" && args[i + 1]) {
|
|
19
|
+
port = parseInt(args[i + 1], 10);
|
|
20
|
+
i++;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return { transport, port };
|
|
24
|
+
}
|
|
25
|
+
async function main() {
|
|
26
|
+
const { transport: transportType, port } = parseArgs();
|
|
27
|
+
const server = createServer();
|
|
28
|
+
if (transportType === "stdio") {
|
|
29
|
+
const transport = new StdioServerTransport();
|
|
30
|
+
await server.connect(transport);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const mcpSecret = process.env.ARELIS_MCP_SECRET;
|
|
34
|
+
const httpTransport = new StreamableHTTPServerTransport({
|
|
35
|
+
sessionIdGenerator: undefined,
|
|
36
|
+
});
|
|
37
|
+
await server.connect(httpTransport);
|
|
38
|
+
const httpServer = createHttpServer(async (req, res) => {
|
|
39
|
+
// Bearer token auth
|
|
40
|
+
if (mcpSecret) {
|
|
41
|
+
const authHeader = req.headers.authorization;
|
|
42
|
+
if (!authHeader || authHeader !== `Bearer ${mcpSecret}`) {
|
|
43
|
+
res.writeHead(401, { "Content-Type": "application/json" });
|
|
44
|
+
res.end(JSON.stringify({ error: "Unauthorized" }));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Only handle POST /mcp
|
|
49
|
+
if (req.method === "POST") {
|
|
50
|
+
const chunks = [];
|
|
51
|
+
req.on("data", (chunk) => chunks.push(chunk));
|
|
52
|
+
req.on("end", async () => {
|
|
53
|
+
const body = JSON.parse(Buffer.concat(chunks).toString());
|
|
54
|
+
await httpTransport.handleRequest(req, res, body);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
else if (req.method === "GET") {
|
|
58
|
+
await httpTransport.handleRequest(req, res);
|
|
59
|
+
}
|
|
60
|
+
else if (req.method === "DELETE") {
|
|
61
|
+
await httpTransport.handleRequest(req, res);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
res.writeHead(405, { "Content-Type": "application/json" });
|
|
65
|
+
res.end(JSON.stringify({ error: "Method not allowed" }));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
httpServer.listen(port, () => {
|
|
69
|
+
console.error(`Arelis MCP server listening on http://localhost:${port}`);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
main().catch((error) => {
|
|
74
|
+
console.error("Failed to start MCP server:", error);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/integration/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,wBAAgB,aAAa,IAAI,cAAc,CAS9C;AAED,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ArelisPlatform } from "@arelis-ai/arelis-governance-sdk";
|
|
2
|
+
export function getTestClient() {
|
|
3
|
+
const apiKey = process.env.ARELIS_TEST_API_KEY;
|
|
4
|
+
if (!apiKey) {
|
|
5
|
+
throw new Error("ARELIS_TEST_API_KEY environment variable is required for integration tests");
|
|
6
|
+
}
|
|
7
|
+
return new ArelisPlatform({
|
|
8
|
+
baseUrl: process.env.ARELIS_BASE_URL ?? "https://api.arelis.dev",
|
|
9
|
+
apiKey,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function skipIfNoTestKey() {
|
|
13
|
+
return !process.env.ARELIS_TEST_API_KEY;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/integration/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,UAAU,aAAa;IAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAC/C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,IAAI,cAAc,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,wBAAwB;QAChE,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ArelisPlatform } from "@arelis-ai/arelis-governance-sdk";
|
|
2
|
+
export declare const activePoliciesResource: {
|
|
3
|
+
uri: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function readActivePolicies(client: ArelisPlatform): Promise<string>;
|
|
9
|
+
//# sourceMappingURL=active-policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-policies.d.ts","sourceRoot":"","sources":["../../src/resources/active-policies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,eAAO,MAAM,sBAAsB;;;;;CAKlC,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGhF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const activePoliciesResource = {
|
|
2
|
+
uri: "arelis://governance/policies",
|
|
3
|
+
name: "Active Policies",
|
|
4
|
+
description: "List of all currently active governance policies and their configurations.",
|
|
5
|
+
mimeType: "application/json",
|
|
6
|
+
};
|
|
7
|
+
export async function readActivePolicies(client) {
|
|
8
|
+
const result = await client.governance.policies.list({ status: "active" });
|
|
9
|
+
return JSON.stringify(result, null, 2);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=active-policies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-policies.js","sourceRoot":"","sources":["../../src/resources/active-policies.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,GAAG,EAAE,8BAA8B;IACnC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,4EAA4E;IACzF,QAAQ,EAAE,kBAAkB;CAC7B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAsB;IAC7D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ArelisPlatform } from "@arelis-ai/arelis-governance-sdk";
|
|
2
|
+
export declare const aiSystemsRegistryResource: {
|
|
3
|
+
uri: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function readAiSystemsRegistry(client: ArelisPlatform): Promise<string>;
|
|
9
|
+
//# sourceMappingURL=ai-systems-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-systems-registry.d.ts","sourceRoot":"","sources":["../../src/resources/ai-systems-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,eAAO,MAAM,yBAAyB;;;;;CAKrC,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const aiSystemsRegistryResource = {
|
|
2
|
+
uri: "arelis://ai-systems/registry",
|
|
3
|
+
name: "AI Systems Registry",
|
|
4
|
+
description: "All active registered AI systems in the governance platform.",
|
|
5
|
+
mimeType: "application/json",
|
|
6
|
+
};
|
|
7
|
+
export async function readAiSystemsRegistry(client) {
|
|
8
|
+
const result = await client.aiSystems.list({ status: "active" });
|
|
9
|
+
return JSON.stringify(result, null, 2);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ai-systems-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-systems-registry.js","sourceRoot":"","sources":["../../src/resources/ai-systems-registry.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,GAAG,EAAE,8BAA8B;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,kBAAkB;CAC7B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAAsB;IAChE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ArelisPlatform } from "@arelis-ai/arelis-governance-sdk";
|
|
2
|
+
export declare const environmentInfoResource: {
|
|
3
|
+
uri: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function readEnvironmentInfo(client: ArelisPlatform): Promise<string>;
|
|
9
|
+
//# sourceMappingURL=environment-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-info.d.ts","sourceRoot":"","sources":["../../src/resources/environment-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAC;AAEF,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGjF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const environmentInfoResource = {
|
|
2
|
+
uri: "arelis://context/environment",
|
|
3
|
+
name: "Environment Info",
|
|
4
|
+
description: "Current organization, project, and environment context for this API key.",
|
|
5
|
+
mimeType: "application/json",
|
|
6
|
+
};
|
|
7
|
+
export async function readEnvironmentInfo(client) {
|
|
8
|
+
const result = await client.organization.get();
|
|
9
|
+
return JSON.stringify(result, null, 2);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=environment-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-info.js","sourceRoot":"","sources":["../../src/resources/environment-info.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,GAAG,EAAE,8BAA8B;IACnC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,0EAA0E;IACvF,QAAQ,EAAE,kBAAkB;CAC7B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAAsB;IAC9D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;IAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAyBzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAYzD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getArelisClient } from "../client.js";
|
|
2
|
+
import { activePoliciesResource, readActivePolicies } from "./active-policies.js";
|
|
3
|
+
import { riskConfigResource, readRiskConfig } from "./risk-config.js";
|
|
4
|
+
import { environmentInfoResource, readEnvironmentInfo } from "./environment-info.js";
|
|
5
|
+
import { aiSystemsRegistryResource, readAiSystemsRegistry } from "./ai-systems-registry.js";
|
|
6
|
+
import { usageQuotasResource, readUsageQuotas } from "./usage-quotas.js";
|
|
7
|
+
const ALL_RESOURCES = [
|
|
8
|
+
{ ...activePoliciesResource, read: readActivePolicies },
|
|
9
|
+
{ ...riskConfigResource, read: readRiskConfig },
|
|
10
|
+
{ ...environmentInfoResource, read: readEnvironmentInfo },
|
|
11
|
+
{ ...aiSystemsRegistryResource, read: readAiSystemsRegistry },
|
|
12
|
+
{ ...usageQuotasResource, read: readUsageQuotas },
|
|
13
|
+
];
|
|
14
|
+
export function registerResources(server) {
|
|
15
|
+
for (const resource of ALL_RESOURCES) {
|
|
16
|
+
server.resource(resource.name, resource.uri, { description: resource.description, mimeType: resource.mimeType }, async () => ({
|
|
17
|
+
contents: [
|
|
18
|
+
{
|
|
19
|
+
uri: resource.uri,
|
|
20
|
+
mimeType: resource.mimeType,
|
|
21
|
+
text: await resource.read(getArelisClient()),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWzE,MAAM,aAAa,GAAkB;IACnC,EAAE,GAAG,sBAAsB,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACvD,EAAE,GAAG,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE;IAC/C,EAAE,GAAG,uBAAuB,EAAE,IAAI,EAAE,mBAAmB,EAAE;IACzD,EAAE,GAAG,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC7D,EAAE,GAAG,mBAAmB,EAAE,IAAI,EAAE,eAAe,EAAE;CAClD,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;QACrC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;YAC5H,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,QAAQ,CAAC,GAAG;oBACjB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;oBAC3B,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;iBAC7C;aACF;SACF,CAAC,CAAC,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ArelisPlatform } from "@arelis-ai/arelis-governance-sdk";
|
|
2
|
+
export declare const riskConfigResource: {
|
|
3
|
+
uri: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function readRiskConfig(client: ArelisPlatform): Promise<string>;
|
|
9
|
+
//# sourceMappingURL=risk-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-config.d.ts","sourceRoot":"","sources":["../../src/resources/risk-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC;AAEF,wBAAsB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG5E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const riskConfigResource = {
|
|
2
|
+
uri: "arelis://risk/config",
|
|
3
|
+
name: "Risk Configuration",
|
|
4
|
+
description: "The current active risk scoring configuration including routes, thresholds, and factors.",
|
|
5
|
+
mimeType: "application/json",
|
|
6
|
+
};
|
|
7
|
+
export async function readRiskConfig(client) {
|
|
8
|
+
const result = await client.risk.getConfig();
|
|
9
|
+
return JSON.stringify(result, null, 2);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=risk-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-config.js","sourceRoot":"","sources":["../../src/resources/risk-config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,EAAE,sBAAsB;IAC3B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,0FAA0F;IACvG,QAAQ,EAAE,kBAAkB;CAC7B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAsB;IACzD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IAC7C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ArelisPlatform } from "@arelis-ai/arelis-governance-sdk";
|
|
2
|
+
export declare const usageQuotasResource: {
|
|
3
|
+
uri: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function readUsageQuotas(client: ArelisPlatform): Promise<string>;
|
|
9
|
+
//# sourceMappingURL=usage-quotas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-quotas.d.ts","sourceRoot":"","sources":["../../src/resources/usage-quotas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,eAAO,MAAM,mBAAmB;;;;;CAK/B,CAAC;AAEF,wBAAsB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG7E"}
|