@agledger/mcp-server 2.0.0 → 2.0.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/README.md +18 -20
- package/dist/api-client.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +68 -11
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/src/api-client.ts +1 -1
- package/src/index.ts +1 -1
- package/src/server.ts +79 -11
- package/tests/server.test.ts +76 -6
- package/dist/enums.d.ts +0 -110
- package/dist/enums.d.ts.map +0 -1
- package/dist/enums.js +0 -42
- package/dist/enums.js.map +0 -1
- package/dist/errors.d.ts +0 -10
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -49
- package/dist/errors.js.map +0 -1
- package/dist/resources/contract-types.d.ts +0 -4
- package/dist/resources/contract-types.d.ts.map +0 -1
- package/dist/resources/contract-types.js +0 -104
- package/dist/resources/contract-types.js.map +0 -1
- package/dist/tool-scopes.d.ts +0 -11
- package/dist/tool-scopes.d.ts.map +0 -1
- package/dist/tool-scopes.js +0 -164
- package/dist/tool-scopes.js.map +0 -1
- package/dist/tools/a2a.d.ts +0 -8
- package/dist/tools/a2a.d.ts.map +0 -1
- package/dist/tools/a2a.js +0 -360
- package/dist/tools/a2a.js.map +0 -1
- package/dist/tools/agent-mandates.d.ts +0 -4
- package/dist/tools/agent-mandates.d.ts.map +0 -1
- package/dist/tools/agent-mandates.js +0 -222
- package/dist/tools/agent-mandates.js.map +0 -1
- package/dist/tools/agents-refs.d.ts +0 -4
- package/dist/tools/agents-refs.d.ts.map +0 -1
- package/dist/tools/agents-refs.js +0 -196
- package/dist/tools/agents-refs.js.map +0 -1
- package/dist/tools/capabilities.d.ts +0 -4
- package/dist/tools/capabilities.d.ts.map +0 -1
- package/dist/tools/capabilities.js +0 -54
- package/dist/tools/capabilities.js.map +0 -1
- package/dist/tools/code-mode.d.ts +0 -4
- package/dist/tools/code-mode.d.ts.map +0 -1
- package/dist/tools/code-mode.js +0 -389
- package/dist/tools/code-mode.js.map +0 -1
- package/dist/tools/compliance.d.ts +0 -4
- package/dist/tools/compliance.d.ts.map +0 -1
- package/dist/tools/compliance.js +0 -63
- package/dist/tools/compliance.js.map +0 -1
- package/dist/tools/dashboard.d.ts +0 -4
- package/dist/tools/dashboard.d.ts.map +0 -1
- package/dist/tools/dashboard.js +0 -57
- package/dist/tools/dashboard.js.map +0 -1
- package/dist/tools/disputes.d.ts +0 -4
- package/dist/tools/disputes.d.ts.map +0 -1
- package/dist/tools/disputes.js +0 -103
- package/dist/tools/disputes.js.map +0 -1
- package/dist/tools/enterprises.d.ts +0 -4
- package/dist/tools/enterprises.d.ts.map +0 -1
- package/dist/tools/enterprises.js +0 -173
- package/dist/tools/enterprises.js.map +0 -1
- package/dist/tools/events.d.ts +0 -4
- package/dist/tools/events.d.ts.map +0 -1
- package/dist/tools/events.js +0 -28
- package/dist/tools/events.js.map +0 -1
- package/dist/tools/federation-admin.d.ts +0 -4
- package/dist/tools/federation-admin.d.ts.map +0 -1
- package/dist/tools/federation-admin.js +0 -567
- package/dist/tools/federation-admin.js.map +0 -1
- package/dist/tools/federation.d.ts +0 -4
- package/dist/tools/federation.d.ts.map +0 -1
- package/dist/tools/federation.js +0 -505
- package/dist/tools/federation.js.map +0 -1
- package/dist/tools/health.d.ts +0 -4
- package/dist/tools/health.d.ts.map +0 -1
- package/dist/tools/health.js +0 -25
- package/dist/tools/health.js.map +0 -1
- package/dist/tools/mandates.d.ts +0 -4
- package/dist/tools/mandates.d.ts.map +0 -1
- package/dist/tools/mandates.js +0 -227
- package/dist/tools/mandates.js.map +0 -1
- package/dist/tools/openclaw.d.ts +0 -4
- package/dist/tools/openclaw.d.ts.map +0 -1
- package/dist/tools/openclaw.js +0 -110
- package/dist/tools/openclaw.js.map +0 -1
- package/dist/tools/receipts.d.ts +0 -8
- package/dist/tools/receipts.d.ts.map +0 -1
- package/dist/tools/receipts.js +0 -111
- package/dist/tools/receipts.js.map +0 -1
- package/dist/tools/reputation.d.ts +0 -4
- package/dist/tools/reputation.d.ts.map +0 -1
- package/dist/tools/reputation.js +0 -62
- package/dist/tools/reputation.js.map +0 -1
- package/dist/tools/schemas.d.ts +0 -4
- package/dist/tools/schemas.d.ts.map +0 -1
- package/dist/tools/schemas.js +0 -453
- package/dist/tools/schemas.js.map +0 -1
- package/dist/tools/verification-keys.d.ts +0 -4
- package/dist/tools/verification-keys.d.ts.map +0 -1
- package/dist/tools/verification-keys.js +0 -27
- package/dist/tools/verification-keys.js.map +0 -1
- package/dist/tools/verification.d.ts +0 -4
- package/dist/tools/verification.d.ts.map +0 -1
- package/dist/tools/verification.js +0 -50
- package/dist/tools/verification.js.map +0 -1
package/dist/tools/code-mode.js
DELETED
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { AgledgerApiError } from '@agledger/sdk';
|
|
3
|
-
import { apiErrorResult } from '../errors.js';
|
|
4
|
-
import { toolMeta } from '../tool-scopes.js';
|
|
5
|
-
const RESOURCE_MANIFEST = {
|
|
6
|
-
mandates: `## client.mandates
|
|
7
|
-
- create(params: CreateMandateParams): Promise<Mandate>
|
|
8
|
-
- createAgent(params: CreateAgentMandateParams): Promise<Mandate>
|
|
9
|
-
- get(id: string): Promise<Mandate>
|
|
10
|
-
- list(params: ListMandatesParams): Promise<Page<Mandate>>
|
|
11
|
-
- listAll(params: ListMandatesParams): AsyncGenerator<Mandate>
|
|
12
|
-
- search(params: SearchMandatesParams): Promise<Page<Mandate>>
|
|
13
|
-
- update(id: string, params: UpdateMandateParams): Promise<Mandate>
|
|
14
|
-
- transition(id: string, action: MandateTransitionAction, reason?: string): Promise<Mandate>
|
|
15
|
-
- cancel(id: string, reason?: string): Promise<Mandate>
|
|
16
|
-
- accept(id: string): Promise<Mandate>
|
|
17
|
-
- reject(id: string, reason?: string): Promise<Mandate>
|
|
18
|
-
- counterPropose(id: string, params: CounterProposeParams): Promise<Mandate>
|
|
19
|
-
- acceptCounter(id: string): Promise<Mandate>
|
|
20
|
-
- getChain(id: string): Promise<Mandate[]>
|
|
21
|
-
- getSubMandates(id: string): Promise<Page<Mandate>>
|
|
22
|
-
- delegate(id: string, params: DelegateMandateParams): Promise<Mandate>
|
|
23
|
-
- bulkCreate(mandates: CreateMandateParams[]): Promise<BulkCreateResult>
|
|
24
|
-
- getAudit(id: string): Promise<AuditChain>
|
|
25
|
-
- listAsPrincipal(): Promise<Page<Mandate>>
|
|
26
|
-
- listProposals(): Promise<Page<Mandate>>
|
|
27
|
-
- requestRevision(id: string, reason?: string): Promise<Mandate>
|
|
28
|
-
- createAndActivate(params: CreateMandateParams): Promise<Mandate>
|
|
29
|
-
- reportOutcome(id: string, params: ReportOutcomeParams): Promise<OutcomeResult>
|
|
30
|
-
- getSummary(params?: { enterpriseId?: string }): Promise<MandateStatusSummary>
|
|
31
|
-
- getGraph(id: string): Promise<Record<string, unknown>>
|
|
32
|
-
- batchGet(ids: string[]): Promise<Mandate[]>
|
|
33
|
-
- getValidTransitions(mandate: Mandate): readonly string[] (client-side, no API call)`,
|
|
34
|
-
receipts: `## client.receipts
|
|
35
|
-
- submit(mandateId: string, params: SubmitReceiptParams): Promise<Receipt>
|
|
36
|
-
- get(mandateId: string, receiptId: string): Promise<Receipt>
|
|
37
|
-
- list(mandateId: string, params?: ListParams): Promise<Page<Receipt>>
|
|
38
|
-
- listAll(mandateId: string, params?: ListParams): AsyncGenerator<Receipt>`,
|
|
39
|
-
verification: `## client.verification
|
|
40
|
-
- verify(mandateId: string, receiptIds?: string[]): Promise<VerificationResult>
|
|
41
|
-
- getStatus(mandateId: string): Promise<VerificationStatus>`,
|
|
42
|
-
disputes: `## client.disputes
|
|
43
|
-
- create(mandateId: string, params: CreateDisputeParams): Promise<Dispute>
|
|
44
|
-
- get(mandateId: string): Promise<DisputeResponse>
|
|
45
|
-
- escalate(mandateId: string): Promise<Dispute>
|
|
46
|
-
- submitEvidence(mandateId: string, params: { evidenceType: EvidenceType; payload: Record<string, unknown> }): Promise<Record<string, unknown>>`,
|
|
47
|
-
webhooks: `## client.webhooks
|
|
48
|
-
- create(params: CreateWebhookParams): Promise<Webhook>
|
|
49
|
-
- list(params?: ListWebhooksParams): Promise<Page<Webhook>>
|
|
50
|
-
- get(webhookId: string): Promise<Webhook>
|
|
51
|
-
- update(webhookId: string, params: Partial<CreateWebhookParams>): Promise<Webhook>
|
|
52
|
-
- delete(webhookId: string): Promise<void>
|
|
53
|
-
- pause(webhookId: string): Promise<Webhook>
|
|
54
|
-
- resume(webhookId: string): Promise<Webhook>
|
|
55
|
-
- rotate(webhookId: string): Promise<Webhook>
|
|
56
|
-
- ping(webhookId: string): Promise<WebhookTestResult>
|
|
57
|
-
- listDeliveries(webhookId: string, params?: ListParams & { status?: string }): Promise<Page<WebhookDelivery>>
|
|
58
|
-
- listDlq(webhookId: string, params?: ListParams): Promise<Page<WebhookDlqEntry>>
|
|
59
|
-
- retryAllDlq(webhookId: string): Promise<{ retried: number }>
|
|
60
|
-
- retryDlq(webhookId: string, dlqId: string): Promise<Record<string, unknown>>`,
|
|
61
|
-
reputation: `## client.reputation
|
|
62
|
-
- getAgent(agentId: string): Promise<Page<ReputationScore>>
|
|
63
|
-
- getByContractType(agentId: string, contractType: string): Promise<ReputationScore>
|
|
64
|
-
- getHistory(agentId: string, params?: ListParams & { from?: string; to?: string; contractType?: string; outcome?: 'PASS' | 'FAIL' }): Promise<Page<ReputationHistoryEntry>>`,
|
|
65
|
-
events: `## client.events
|
|
66
|
-
- list(params: { since: string; order?: 'asc' | 'desc' } & ListParams): Promise<Page<AgledgerEvent>>
|
|
67
|
-
- listAll(params: { since: string; order?: 'asc' | 'desc' } & ListParams): AsyncGenerator<AgledgerEvent>
|
|
68
|
-
- getAuditChain(mandateId: string): Promise<AuditChain>`,
|
|
69
|
-
schemas: `## client.schemas
|
|
70
|
-
- list(params?: { enterpriseId?: string }): Promise<Page<ContractType>>
|
|
71
|
-
- get(contractType: string): Promise<ContractSchema>
|
|
72
|
-
- delete(contractType: string): Promise<void>
|
|
73
|
-
- getRules(contractType: string): Promise<{ contractType; syncRuleIds; asyncRuleIds }>
|
|
74
|
-
- validateReceipt(contractType: string, evidence: Record<string, unknown>): Promise<SchemaValidationResult>
|
|
75
|
-
- getMetaSchema(): Promise<MetaSchema>
|
|
76
|
-
- getTemplate(contractType: string): Promise<SchemaTemplate>
|
|
77
|
-
- getBlankTemplate(): Promise<SchemaTemplate>
|
|
78
|
-
- getVersions(contractType: string): Promise<SchemaVersionDetail[]>
|
|
79
|
-
- getVersion(contractType: string, version: number): Promise<SchemaVersionDetail>
|
|
80
|
-
- diff(contractType: string, from: number, to: number): Promise<SchemaDiffResult>
|
|
81
|
-
- preview(input: SchemaPreviewInput): Promise<SchemaPreviewResult>
|
|
82
|
-
- checkCompatibility(contractType: string, schemas: { mandateSchema; receiptSchema }): Promise<SchemaCompatibilityResult>
|
|
83
|
-
- register(input: RegisterSchemaParams): Promise<SchemaVersionDetail>
|
|
84
|
-
- updateVersion(contractType: string, version: number, params: UpdateSchemaVersionParams): Promise<SchemaVersionDetail>
|
|
85
|
-
- exportSchema(contractType: string, opts?: ExportSchemaOptions): Promise<SchemaExportResult>
|
|
86
|
-
- importSchema(payload: SchemaImportPayload, opts?: ImportSchemaOptions): Promise<SchemaImportResult>
|
|
87
|
-
- previewImport(payload: SchemaImportPayload, opts?: ImportSchemaOptions): Promise<SchemaImportDryRunResult>`,
|
|
88
|
-
dashboard: `## client.dashboard
|
|
89
|
-
- getSummary(): Promise<DashboardSummary>
|
|
90
|
-
- getMetrics(params?: DashboardMetricsParams): Promise<DashboardMetrics>
|
|
91
|
-
- listAgents(params?: DashboardAgentParams): Promise<Page<DashboardAgent>>
|
|
92
|
-
- getAlerts(params?: ListParams): Promise<Page<DashboardAlert>>
|
|
93
|
-
- getDisputes(params?: ListParams): Promise<Page<Record<string, unknown>>>
|
|
94
|
-
- getAuditTrail(params?: ListParams): Promise<Page<Record<string, unknown>>>`,
|
|
95
|
-
compliance: `## client.compliance
|
|
96
|
-
- export(params: ExportComplianceParams): Promise<ComplianceExport>
|
|
97
|
-
- getExportStatus(exportId: string): Promise<ComplianceExport>
|
|
98
|
-
- downloadExport(exportId: string): Promise<Record<string, unknown>>
|
|
99
|
-
- waitForExport(exportId: string, opts?: { pollIntervalMs?; timeoutMs?; signal? }): Promise<ComplianceExport>
|
|
100
|
-
- createAssessment(mandateId: string, params: CreateAiImpactAssessmentParams): Promise<AiImpactAssessment>
|
|
101
|
-
- getAssessment(mandateId: string): Promise<AiImpactAssessment>
|
|
102
|
-
- getEuAiActReport(params?: { from?; to? }): Promise<EuAiActReport>
|
|
103
|
-
- getEnterpriseReport(params?: { from?; to?; format? }): Promise<Record<string, unknown>>
|
|
104
|
-
- analyzeAudit(mandateId: string): Promise<Record<string, unknown>>
|
|
105
|
-
- createRecord(mandateId: string, params: CreateComplianceRecordParams): Promise<ComplianceRecord>
|
|
106
|
-
- listRecords(mandateId: string, params?: ListParams): Promise<Page<ComplianceRecord>>
|
|
107
|
-
- getRecord(mandateId: string, recordId: string): Promise<ComplianceRecord>
|
|
108
|
-
- exportMandate(mandateId: string, params?: { format?: 'json' | 'csv' | 'ndjson' }): Promise<MandateAuditExport>
|
|
109
|
-
- stream(params: AuditStreamParams): Promise<AuditStreamResult>
|
|
110
|
-
- streamAll(params: AuditStreamParams): AsyncGenerator<Record<string, unknown>>`,
|
|
111
|
-
registration: `## client.registration
|
|
112
|
-
- getMe(): Promise<AccountProfile>
|
|
113
|
-
- register(params: RegisterParams): Promise<RegisterResult>
|
|
114
|
-
- registerEnterprise(params: { name: string; email?: string }): Promise<RegisterResult>
|
|
115
|
-
- registerAgent(params: { name: string; email?: string; agentCardUrl?: string; enterpriseId?: string }): Promise<RegisterResult>
|
|
116
|
-
- verifyAgentCard(agentCardUrl: string): Promise<Record<string, unknown>>
|
|
117
|
-
- rotateApiKey(): Promise<{ apiKey: string }>
|
|
118
|
-
- verifyEmail(token: string): Promise<{ sandboxMode: boolean; status: string }>
|
|
119
|
-
- sendVerificationEmail(email: string): Promise<{ sandboxMode: boolean; status: string }>`,
|
|
120
|
-
health: `## client.health
|
|
121
|
-
- check(): Promise<HealthResponse>
|
|
122
|
-
- status(): Promise<StatusResponse>
|
|
123
|
-
- conformance(): Promise<ConformanceResponse>`,
|
|
124
|
-
proxy: `## client.proxy
|
|
125
|
-
Unified resource with sub-resources for governance sidecar proxy operations.
|
|
126
|
-
- syncSession(params: SyncSessionParams): Promise<SyncSessionResult>
|
|
127
|
-
|
|
128
|
-
### client.proxy.sessions
|
|
129
|
-
- create(params: CreateSessionParams): Promise<ProxySession>
|
|
130
|
-
- get(sessionId: string): Promise<ProxySession>
|
|
131
|
-
- list(params?: ListParams): Promise<Page<ProxySession>>
|
|
132
|
-
- sync(params: SyncSessionParams): Promise<SyncSessionResult>
|
|
133
|
-
|
|
134
|
-
### client.proxy.toolCalls
|
|
135
|
-
- ingest(sessionId: string, items: ToolCallBatchItem[]): Promise<BatchResult<ProxyToolCall>>
|
|
136
|
-
- list(sessionId: string, params?: ListParams): Promise<Page<ProxyToolCall>>
|
|
137
|
-
|
|
138
|
-
### client.proxy.sidecarMandates
|
|
139
|
-
- ingest(sessionId: string, items: SidecarMandateBatchItem[]): Promise<BatchResult<ProxySidecarMandate>>
|
|
140
|
-
- list(params?: ListParams & { sessionId?: string }): Promise<Page<ProxySidecarMandate>>
|
|
141
|
-
- listBySession(sessionId: string, params?: ListParams): Promise<Page<ProxySidecarMandate>>
|
|
142
|
-
- update(id: string, params: UpdateSidecarMandateParams): Promise<ProxySidecarMandate>
|
|
143
|
-
- formalize(id: string, formalizedMandateId: string): Promise<ProxySidecarMandate>
|
|
144
|
-
- dismiss(id: string): Promise<ProxySidecarMandate>
|
|
145
|
-
|
|
146
|
-
### client.proxy.sidecarReceipts
|
|
147
|
-
- ingest(sessionId: string, items: SidecarReceiptBatchItem[]): Promise<BatchResult<ProxySidecarReceipt>>
|
|
148
|
-
- listBySession(sessionId: string, params?: ListParams): Promise<Page<ProxySidecarReceipt>>
|
|
149
|
-
|
|
150
|
-
### client.proxy.toolCatalog
|
|
151
|
-
- ingest(sessionId: string, items: ToolCatalogBatchItem[]): Promise<BatchResult<ProxyToolCatalogEntry>>
|
|
152
|
-
- list(sessionId: string): Promise<Page<ProxyToolCatalogEntry>>
|
|
153
|
-
|
|
154
|
-
### client.proxy.analytics
|
|
155
|
-
- getSession(sessionId: string): Promise<SessionAnalytics>
|
|
156
|
-
- getSummary(params?: { from?; to? }): Promise<AnalyticsSummary>
|
|
157
|
-
- getMandateSummary(sessionId: string): Promise<MandateSummary>
|
|
158
|
-
- getAlignment(sessionId: string): Promise<AlignmentAnalysis>`,
|
|
159
|
-
admin: `## client.admin
|
|
160
|
-
Platform-level administration. Requires platform API key.
|
|
161
|
-
- listEnterprises(params?: ListParams): Promise<Page<AdminEnterprise>>
|
|
162
|
-
- createEnterprise(params: CreateEnterpriseParams): Promise<AdminEnterprise>
|
|
163
|
-
- listAgents(params?: ListParams): Promise<Page<AdminAgent>>
|
|
164
|
-
- createAgent(params: CreateAgentParams): Promise<AdminAgent>
|
|
165
|
-
- updateTrustLevel(accountId: string, params: UpdateTrustLevelParams): Promise<Record<string, unknown>>
|
|
166
|
-
- deactivateAccount(accountId: string, params: { accountType: 'enterprise' | 'agent'; reason?: string }): Promise<Record<string, unknown>>
|
|
167
|
-
- setCapabilities(agentId: string, params: SetCapabilitiesParams): Promise<Record<string, unknown>>
|
|
168
|
-
- getFleetCapabilities(): Promise<Page<{ agentId; capabilities }>>
|
|
169
|
-
- getEnterpriseConfig(enterpriseId: string): Promise<EnterpriseConfig>
|
|
170
|
-
- replaceEnterpriseConfig(enterpriseId: string, params: SetEnterpriseConfigParams): Promise<EnterpriseConfig>
|
|
171
|
-
- updateEnterpriseConfig(enterpriseId: string, params: SetEnterpriseConfigParams): Promise<EnterpriseConfig>
|
|
172
|
-
- listApiKeys(params?: ListParams): Promise<Page<AdminApiKey>>
|
|
173
|
-
- createApiKey(params: CreateApiKeyParams): Promise<CreateApiKeyResult>
|
|
174
|
-
- toggleApiKey(keyId: string, isActive: boolean): Promise<AdminApiKey>
|
|
175
|
-
- bulkRevokeApiKeys(keyIds: string[]): Promise<{ revoked: number }>
|
|
176
|
-
- getLicense(): Promise<LicenseInfo>
|
|
177
|
-
- listMandates(params?: QueryAdminMandatesParams): Promise<Page<Record<string, unknown>>>
|
|
178
|
-
- listDlq(params?: ListParams): Promise<Page<WebhookDlqEntry>>
|
|
179
|
-
- retryDlq(dlqId: string): Promise<Record<string, unknown>>
|
|
180
|
-
- retryAllDlq(): Promise<{ retried: number }>
|
|
181
|
-
- getSystemHealth(): Promise<SystemHealth>
|
|
182
|
-
- listRateLimitExemptions(): Promise<Page<string>>
|
|
183
|
-
- setRateLimitExemption(ip: string): Promise<{ ip; exempt }>
|
|
184
|
-
- deleteRateLimitExemption(ip: string): Promise<{ ip; exempt }>
|
|
185
|
-
- getWebhookHealth(params?: ListParams): Promise<Page<Record<string, unknown>>>
|
|
186
|
-
- updateCircuitBreaker(webhookId: string, params: UpdateCircuitBreakerParams): Promise<CircuitBreakerResult>
|
|
187
|
-
- listVaultSigningKeys(): Promise<VaultSigningKey[]>
|
|
188
|
-
- rotateVaultSigningKey(): Promise<VaultSigningKey>
|
|
189
|
-
- listVaultAnchors(): Promise<VaultAnchor[]>
|
|
190
|
-
- verifyVaultAnchors(): Promise<VaultAnchorVerifyResult>
|
|
191
|
-
- startVaultScan(): Promise<VaultScanJob>
|
|
192
|
-
- getVaultScanStatus(jobId: string): Promise<VaultScanJob>
|
|
193
|
-
- flushAuthCache(): Promise<{ flushed: boolean }>
|
|
194
|
-
- getAuthCacheStats(): Promise<AuthCacheStats>
|
|
195
|
-
- flushSchemaCache(): Promise<{ flushed: boolean }>
|
|
196
|
-
- listOwnerRateLimitExemptions(): Promise<Record<string, unknown>[]>
|
|
197
|
-
- setOwnerRateLimitExemption(ownerId: string): Promise<Record<string, unknown>>
|
|
198
|
-
- deleteOwnerRateLimitExemption(ownerId: string): Promise<Record<string, unknown>>`,
|
|
199
|
-
a2a: `## client.a2a
|
|
200
|
-
Agent-to-Agent protocol (A2A). JSON-RPC 2.0 dispatch.
|
|
201
|
-
- getAgentCard(): Promise<AgentCard>
|
|
202
|
-
- dispatch(request: JsonRpcRequest): Promise<JsonRpcResponse>
|
|
203
|
-
- call(method: string, params?: Record<string, unknown>): Promise<JsonRpcResponse>`,
|
|
204
|
-
capabilities: `## client.capabilities
|
|
205
|
-
- get(agentId: string): Promise<{ agentId; capabilities: ContractType[] }>
|
|
206
|
-
- set(agentId: string, params: SetCapabilitiesParams): Promise<{ agentId; capabilities: ContractType[] }> (PUT — replaces all)`,
|
|
207
|
-
notarize: `## client.notarize
|
|
208
|
-
Agent-to-agent agreement notarization (OpenClaw flow).
|
|
209
|
-
- createMandate(params: NotarizeMandateParams): Promise<NotarizeMandateResult>
|
|
210
|
-
- getMandate(id: string): Promise<NotarizedMandate>
|
|
211
|
-
- getHistory(id: string): Promise<NotarizeHistory>
|
|
212
|
-
- acceptMandate(id: string): Promise<NotarizedMandate>
|
|
213
|
-
- counterPropose(id: string, params: NotarizeCounterProposeParams): Promise<NotarizeMandateResult>
|
|
214
|
-
- submitReceipt(id: string, params: NotarizeReceiptParams): Promise<NotarizeReceiptResult>
|
|
215
|
-
- renderVerdict(id: string, params: NotarizeVerdictParams): Promise<NotarizedMandate>
|
|
216
|
-
- verify(params: NotarizeVerifyParams): Promise<NotarizeVerifyResult>`,
|
|
217
|
-
enterprises: `## client.enterprises
|
|
218
|
-
Enterprise agent approval registry.
|
|
219
|
-
- approveAgent(enterpriseId: string, agentId: string, params?: ApproveAgentParams): Promise<EnterpriseAgentRecord>
|
|
220
|
-
- revokeAgent(enterpriseId: string, agentId: string, params?: RevokeAgentParams): Promise<void>
|
|
221
|
-
- updateAgentStatus(enterpriseId: string, agentId: string, params: UpdateAgentStatusParams): Promise<EnterpriseAgentRecord>
|
|
222
|
-
- bulkApprove(enterpriseId: string, params: BulkApproveAgentParams): Promise<BulkApproveResult>
|
|
223
|
-
- listAgents(enterpriseId: string, params?: ListEnterpriseAgentsParams): Promise<Page<EnterpriseAgentRecord>>
|
|
224
|
-
- getAgent(enterpriseId: string, agentId: string): Promise<EnterpriseAgentRecord>
|
|
225
|
-
`,
|
|
226
|
-
projects: `## client.projects
|
|
227
|
-
- create(params: CreateProjectParams): Promise<Project>
|
|
228
|
-
- list(params?: ListParams): Promise<Page<Project>>
|
|
229
|
-
- get(projectId: string): Promise<Project>
|
|
230
|
-
- update(projectId: string, params: UpdateProjectParams): Promise<Project>
|
|
231
|
-
- delete(projectId: string): Promise<void>`,
|
|
232
|
-
federation: `## client.federation
|
|
233
|
-
Gateway-facing federation operations. Most methods require a bearer token from register().
|
|
234
|
-
- register(params: RegisterGatewayParams): Promise<RegisterGatewayResult> (no auth header)
|
|
235
|
-
- heartbeat(params: HeartbeatParams): Promise<HeartbeatResult>
|
|
236
|
-
- registerAgent(params: RegisterFederatedAgentParams): Promise<{ registered: boolean }>
|
|
237
|
-
- listAgents(params?: ListFederatedAgentsParams): Promise<Page<FederationAgent>>
|
|
238
|
-
- submitStateTransition(params: SubmitStateTransitionParams): Promise<StateTransitionResult>
|
|
239
|
-
- relaySignal(params: RelaySignalParams): Promise<SignalRelayResult>
|
|
240
|
-
- rotateKey(gatewayId: string, params: RotateGatewayKeyParams): Promise<{ rotated: boolean }>
|
|
241
|
-
- revoke(gatewayId: string, params: RevokeGatewayParams): Promise<{ revoked; revokedAt }> (no auth header)
|
|
242
|
-
- catchUp(params: FederationCatchUpParams): Promise<{ data: FederationAuditEntry[]; hasMore }>
|
|
243
|
-
- stream(params?: { since?: string }): Promise<Record<string, unknown>>
|
|
244
|
-
- publishSchema(contractType: string, params: SchemaPublishParams): Promise<ContractSchema>
|
|
245
|
-
- confirmSchemaPublish(contractType: string, params: SchemaConfirmParams): Promise<ContractSchema>
|
|
246
|
-
- listContractTypes(): Promise<ContractSchema[]>
|
|
247
|
-
- getContractType(contractType: string): Promise<ContractSchema>
|
|
248
|
-
- getMandateCriteria(mandateId: string): Promise<FederationMandateCriteria>
|
|
249
|
-
- submitMandateCriteria(mandateId: string, params: SubmitMandateCriteriaParams): Promise<FederationMandateCriteria>
|
|
250
|
-
- contributeReputation(params: ContributeReputationParams): Promise<{ contributed: boolean }>
|
|
251
|
-
- getAgentReputation(agentId: string): Promise<FederationAgentReputation>
|
|
252
|
-
- broadcastRevocations(params: RevocationBroadcastParams): Promise<{ broadcast: boolean }>
|
|
253
|
-
- syncAgentDirectory(params: AgentDirectorySyncParams): Promise<{ synced: boolean }>`,
|
|
254
|
-
federationAdmin: `## client.federationAdmin
|
|
255
|
-
Platform admin operations for federation. Requires admin:system scope.
|
|
256
|
-
- createRegistrationToken(params?: CreateRegistrationTokenParams): Promise<FederationRegistrationToken>
|
|
257
|
-
- listGateways(params?: ListFederationGatewaysParams): Promise<Page<FederationGateway>>
|
|
258
|
-
- revokeGateway(gatewayId: string, params: AdminRevokeGatewayParams): Promise<{ revoked; nextSteps }>
|
|
259
|
-
- queryMandates(params?: QueryFederationMandatesParams): Promise<Page<FederationMandate>>
|
|
260
|
-
- getAuditLog(params?: FederationAuditLogParams): Promise<Page<FederationAuditEntry>>
|
|
261
|
-
- getHealth(): Promise<FederationHealthSummary>
|
|
262
|
-
- resetSequence(gatewayId: string, params?: ResetSequenceParams): Promise<{ reset; nextSteps }>
|
|
263
|
-
- listDlq(params?: ListOutboundDlqParams): Promise<Page<FederationDlqEntry>>
|
|
264
|
-
- retryDlq(dlqId: string): Promise<{ retried; nextSteps }>
|
|
265
|
-
- deleteDlq(dlqId: string): Promise<{ deleted: boolean }>
|
|
266
|
-
- rotateHubKey(): Promise<HubSigningKey>
|
|
267
|
-
- listHubKeys(): Promise<HubSigningKey[]>
|
|
268
|
-
- activateHubKey(keyId: string): Promise<HubSigningKey>
|
|
269
|
-
- expireHubKey(keyId: string): Promise<HubSigningKey>
|
|
270
|
-
- registerPeer(params: PeerRegistrationParams): Promise<FederationPeer>
|
|
271
|
-
- listPeers(): Promise<Page<FederationPeer>>
|
|
272
|
-
- getPeer(hubId: string): Promise<FederationPeer>
|
|
273
|
-
- revokePeer(hubId: string): Promise<{ revoked: boolean }>
|
|
274
|
-
- resyncPeer(hubId: string): Promise<{ synced: boolean }>
|
|
275
|
-
- createPeeringToken(): Promise<PeeringToken>
|
|
276
|
-
- deleteSchemaVersion(contractType: string, version: string): Promise<{ deleted: boolean }>
|
|
277
|
-
- listReputationContributions(agentId: string): Promise<ReputationContribution[]>
|
|
278
|
-
- resetReputation(agentId: string): Promise<{ reset: boolean }>
|
|
279
|
-
- getMandateCriteriaStatus(mandateId: string): Promise<MandateCriteriaStatus>`,
|
|
280
|
-
agents: `## client.agents
|
|
281
|
-
Agent identity management.
|
|
282
|
-
- get(agentId: string): Promise<AgentProfile>
|
|
283
|
-
- update(agentId: string, params: UpdateAgentParams): Promise<AgentProfile>
|
|
284
|
-
- addReferences(agentId: string, references: Record<string, unknown>[]): Promise<Record<string, unknown>>
|
|
285
|
-
- getReferences(agentId: string): Promise<Record<string, unknown>>`,
|
|
286
|
-
references: `## client.references
|
|
287
|
-
Reverse lookup for external references.
|
|
288
|
-
- lookup(params: { system: string; refType: string; refId: string }): Promise<ReferenceLookupResult>
|
|
289
|
-
- addMandateReferences(mandateId: string, references: Record<string, unknown>[]): Promise<Record<string, unknown>>
|
|
290
|
-
- getMandateReferences(mandateId: string): Promise<Record<string, unknown>>`,
|
|
291
|
-
verificationKeys: `## client.verificationKeys
|
|
292
|
-
Public vault signing keys for independent audit chain verification. No auth required.
|
|
293
|
-
- list(): Promise<VerificationKeysResponse> — returns { data: VerificationKey[], canonicalization, hashAlgorithm, signatureAlgorithm }`,
|
|
294
|
-
};
|
|
295
|
-
const RESOURCE_NAMES = Object.keys(RESOURCE_MANIFEST);
|
|
296
|
-
function buildFullManifest() {
|
|
297
|
-
const header = `# AGLedger SDK — Resource Manifest
|
|
298
|
-
24 resources, ~200 methods. Use \`sdk_execute\` to call any method.
|
|
299
|
-
The \`client\` variable is a pre-configured AgledgerClient instance.
|
|
300
|
-
|
|
301
|
-
**Pagination**: \`list()\` returns \`Page<T>\` with \`.data\`, \`.total\`, \`.hasMore\`, \`.cursor\`. Use \`listAll()\` for auto-paginating async iterators.
|
|
302
|
-
**Options**: All methods accept an optional trailing \`RequestOptions\` parameter (timeout, idempotencyKey, authOverride).
|
|
303
|
-
**Errors**: SDK throws typed errors — \`AgledgerApiError\`, \`AuthenticationError\`, \`PermissionError\`, \`NotFoundError\`, \`RateLimitError\`, etc.
|
|
304
|
-
|
|
305
|
-
---
|
|
306
|
-
|
|
307
|
-
`;
|
|
308
|
-
return header + RESOURCE_NAMES.map((name) => RESOURCE_MANIFEST[name]).join('\n\n');
|
|
309
|
-
}
|
|
310
|
-
const FULL_MANIFEST = buildFullManifest();
|
|
311
|
-
export function registerCodeModeTools(mcp, client) {
|
|
312
|
-
mcp.registerTool('sdk_execute', {
|
|
313
|
-
title: 'Execute SDK Code',
|
|
314
|
-
description: `Execute TypeScript/JavaScript code against the AGLedger SDK client. The \`client\` variable is a pre-configured AgledgerClient instance with all 23 resources available.
|
|
315
|
-
|
|
316
|
-
Example usage:
|
|
317
|
-
- \`const mandate = await client.mandates.get("mnd-abc123"); return mandate;\`
|
|
318
|
-
- \`const page = await client.mandates.list({ status: "ACTIVE", limit: 10 }); return page.data;\`
|
|
319
|
-
- \`await client.mandates.transition("mnd-abc123", { action: "register" }); return "done";\`
|
|
320
|
-
|
|
321
|
-
The code runs in an async context — use \`await\` freely. Return a value to see it in the response. Use \`sdk_describe\` first to discover available resources and method signatures.
|
|
322
|
-
|
|
323
|
-
Available resources: ${RESOURCE_NAMES.join(', ')}.
|
|
324
|
-
|
|
325
|
-
SECURITY: This tool executes code in the MCP server process. It is intended for trusted agents only — the caller has the same access as the API key. Do not expose this tool to untrusted clients. A 30-second timeout prevents runaway execution.`,
|
|
326
|
-
inputSchema: {
|
|
327
|
-
code: z.string().describe('TypeScript/JavaScript code to execute. Use `client` to access the SDK. Return a value to see results.'),
|
|
328
|
-
},
|
|
329
|
-
annotations: {
|
|
330
|
-
readOnlyHint: false,
|
|
331
|
-
destructiveHint: true,
|
|
332
|
-
idempotentHint: false,
|
|
333
|
-
openWorldHint: true,
|
|
334
|
-
},
|
|
335
|
-
_meta: toolMeta('sdk_execute'),
|
|
336
|
-
}, async (args) => {
|
|
337
|
-
const TIMEOUT_MS = 30_000;
|
|
338
|
-
const start = Date.now();
|
|
339
|
-
try {
|
|
340
|
-
const AsyncFunction = Object.getPrototypeOf(async function () { }).constructor;
|
|
341
|
-
const fn = new AsyncFunction('client', args.code);
|
|
342
|
-
const timeout = new Promise((_, reject) => setTimeout(() => reject(new Error(`Execution timed out after ${TIMEOUT_MS}ms`)), TIMEOUT_MS));
|
|
343
|
-
const result = await Promise.race([fn(client), timeout]);
|
|
344
|
-
const executionTimeMs = Date.now() - start;
|
|
345
|
-
return { content: [], structuredContent: { result, executionTimeMs } };
|
|
346
|
-
}
|
|
347
|
-
catch (err) {
|
|
348
|
-
if (err instanceof AgledgerApiError) {
|
|
349
|
-
return apiErrorResult(err);
|
|
350
|
-
}
|
|
351
|
-
return {
|
|
352
|
-
content: [{ type: 'text', text: `Execution error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
353
|
-
isError: true,
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
mcp.registerTool('sdk_describe', {
|
|
358
|
-
title: 'Describe SDK Resources',
|
|
359
|
-
description: `Returns the AGLedger SDK resource manifest — all 23 resources with method signatures, parameters, and return types. Use this to discover what code to write for \`sdk_execute\`.
|
|
360
|
-
|
|
361
|
-
Pass a \`resource\` name (e.g., "mandates", "federation") for detailed info on one resource, or omit it for the full manifest.
|
|
362
|
-
|
|
363
|
-
Available resources: ${RESOURCE_NAMES.join(', ')}.`,
|
|
364
|
-
inputSchema: {
|
|
365
|
-
resource: z.string().optional().describe('Resource name to describe (e.g., "mandates", "federation"). Omit for full manifest.'),
|
|
366
|
-
},
|
|
367
|
-
annotations: {
|
|
368
|
-
readOnlyHint: true,
|
|
369
|
-
destructiveHint: false,
|
|
370
|
-
idempotentHint: true,
|
|
371
|
-
openWorldHint: false,
|
|
372
|
-
},
|
|
373
|
-
_meta: toolMeta('sdk_describe'),
|
|
374
|
-
}, async (args) => {
|
|
375
|
-
if (args.resource) {
|
|
376
|
-
const name = args.resource.toLowerCase().replace(/[-_\s]/g, '');
|
|
377
|
-
const key = RESOURCE_NAMES.find((k) => k === args.resource || k.toLowerCase().replace(/[-_\s]/g, '') === name);
|
|
378
|
-
if (!key) {
|
|
379
|
-
return {
|
|
380
|
-
content: [{ type: 'text', text: `Unknown resource "${args.resource}". Available: ${RESOURCE_NAMES.join(', ')}` }],
|
|
381
|
-
isError: true,
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
return { content: [], structuredContent: { manifest: RESOURCE_MANIFEST[key], resourceCount: 1 } };
|
|
385
|
-
}
|
|
386
|
-
return { content: [], structuredContent: { manifest: FULL_MANIFEST, resourceCount: RESOURCE_NAMES.length } };
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
//# sourceMappingURL=code-mode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-mode.js","sourceRoot":"","sources":["../../src/tools/code-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,iBAAiB,GAA2B;IAChD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;uFA2B2E;IAErF,QAAQ,EAAE;;;;2EAI+D;IAEzE,YAAY,EAAE;;4DAE4C;IAE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AI,CAAC,GAAG,EAAE,CAAC;gBACT,OAAO;oBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,IAAI,CAAC,QAAQ,iBAAiB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;oBACjH,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC;QACpG,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC;IAC/G,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compliance.d.ts","sourceRoot":"","sources":["../../src/tools/compliance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAIpD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CA+DpF"}
|
package/dist/tools/compliance.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { apiErrorResult, toStructuredContent } from '../errors.js';
|
|
3
|
-
import { toolMeta } from '../tool-scopes.js';
|
|
4
|
-
export function registerComplianceTools(mcp, client) {
|
|
5
|
-
mcp.registerTool('create_compliance_record', {
|
|
6
|
-
title: 'Create Compliance Record',
|
|
7
|
-
description: 'Create a per-mandate compliance attestation. Record types: workplace_notification, affected_persons, input_data_quality, fundamental_rights_impact_assessment.',
|
|
8
|
-
inputSchema: {
|
|
9
|
-
mandateId: z.string().describe('Mandate ID to attach the record to'),
|
|
10
|
-
recordType: z.string().describe('Record type (e.g. workplace_notification, affected_persons)'),
|
|
11
|
-
attestation: z.record(z.string(), z.unknown()).describe('Attestation data'),
|
|
12
|
-
attestedBy: z.string().describe('Who attested (name or ID)'),
|
|
13
|
-
},
|
|
14
|
-
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
15
|
-
_meta: toolMeta('create_compliance_record'),
|
|
16
|
-
}, async (args) => {
|
|
17
|
-
try {
|
|
18
|
-
const record = await client.compliance.createRecord(args.mandateId, {
|
|
19
|
-
recordType: args.recordType,
|
|
20
|
-
attestation: args.attestation,
|
|
21
|
-
attestedBy: args.attestedBy,
|
|
22
|
-
});
|
|
23
|
-
return { content: [], structuredContent: toStructuredContent(record) };
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
return apiErrorResult(err);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
mcp.registerTool('list_compliance_records', {
|
|
30
|
-
title: 'List Compliance Records',
|
|
31
|
-
description: 'List compliance attestation records for a mandate.',
|
|
32
|
-
inputSchema: {
|
|
33
|
-
mandateId: z.string().describe('Mandate ID'),
|
|
34
|
-
limit: z.number().optional().describe('Page size'),
|
|
35
|
-
},
|
|
36
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
37
|
-
_meta: toolMeta('list_compliance_records'),
|
|
38
|
-
}, async (args) => {
|
|
39
|
-
try {
|
|
40
|
-
const result = await client.compliance.listRecords(args.mandateId, { limit: args.limit });
|
|
41
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
42
|
-
}
|
|
43
|
-
catch (err) {
|
|
44
|
-
return apiErrorResult(err);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
mcp.registerTool('get_eu_ai_act_report', {
|
|
48
|
-
title: 'EU AI Act Report',
|
|
49
|
-
description: 'Get EU AI Act compliance report showing risk classifications, human oversight designations, and audit status across all mandates.',
|
|
50
|
-
inputSchema: {},
|
|
51
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
52
|
-
_meta: toolMeta('get_eu_ai_act_report'),
|
|
53
|
-
}, async () => {
|
|
54
|
-
try {
|
|
55
|
-
const report = await client.compliance.getEuAiActReport();
|
|
56
|
-
return { content: [], structuredContent: toStructuredContent(report) };
|
|
57
|
-
}
|
|
58
|
-
catch (err) {
|
|
59
|
-
return apiErrorResult(err);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=compliance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compliance.js","sourceRoot":"","sources":["../../src/tools/compliance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,UAAU,uBAAuB,CAAC,GAAc,EAAE,MAAsB;IAC5E,GAAG,CAAC,YAAY,CACd,0BAA0B,EAC1B;QACE,KAAK,EAAE,0BAA0B;QACjC,WAAW,EAAE,gKAAgK;QAC7K,WAAW,EAAE;YACX,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;YACpE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6DAA6D,CAAC;YAC9F,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAC3E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;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AG,IAAI,CAyDnF"}
|
package/dist/tools/dashboard.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { apiErrorResult, toStructuredContent } from '../errors.js';
|
|
3
|
-
import { toolMeta } from '../tool-scopes.js';
|
|
4
|
-
export function registerDashboardTools(mcp, client) {
|
|
5
|
-
mcp.registerTool('get_dashboard_summary', {
|
|
6
|
-
title: 'Dashboard Summary',
|
|
7
|
-
description: 'Get a high-level dashboard summary: mandate counts, active agents, fulfillment rates, settlement signals. Start here for situational awareness.',
|
|
8
|
-
inputSchema: {},
|
|
9
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
10
|
-
_meta: toolMeta('get_dashboard_summary'),
|
|
11
|
-
}, async () => {
|
|
12
|
-
try {
|
|
13
|
-
const summary = await client.dashboard.getSummary();
|
|
14
|
-
return { content: [], structuredContent: toStructuredContent(summary) };
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
return apiErrorResult(err);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
mcp.registerTool('get_dashboard_metrics', {
|
|
21
|
-
title: 'Dashboard Metrics',
|
|
22
|
-
description: 'Get time-series dashboard metrics (mandates, receipts, disputes) over a date range. Use for trend analysis.',
|
|
23
|
-
inputSchema: {
|
|
24
|
-
from: z.string().optional().describe('Start date (ISO 8601)'),
|
|
25
|
-
to: z.string().optional().describe('End date (ISO 8601)'),
|
|
26
|
-
granularity: z.enum(['daily', 'weekly', 'monthly']).optional().describe('Time bucket size'),
|
|
27
|
-
},
|
|
28
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
29
|
-
_meta: toolMeta('get_dashboard_metrics'),
|
|
30
|
-
}, async (args) => {
|
|
31
|
-
try {
|
|
32
|
-
const metrics = await client.dashboard.getMetrics(args);
|
|
33
|
-
return { content: [], structuredContent: toStructuredContent(metrics) };
|
|
34
|
-
}
|
|
35
|
-
catch (err) {
|
|
36
|
-
return apiErrorResult(err);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
mcp.registerTool('get_dashboard_alerts', {
|
|
40
|
-
title: 'Dashboard Alerts',
|
|
41
|
-
description: 'Get active dashboard alerts (overdue mandates, failed verifications, circuit-breaker trips). Check this for issues requiring attention.',
|
|
42
|
-
inputSchema: {
|
|
43
|
-
limit: z.number().optional().describe('Page size'),
|
|
44
|
-
},
|
|
45
|
-
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
46
|
-
_meta: toolMeta('get_dashboard_alerts'),
|
|
47
|
-
}, async (args) => {
|
|
48
|
-
try {
|
|
49
|
-
const result = await client.dashboard.getAlerts(args);
|
|
50
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
51
|
-
}
|
|
52
|
-
catch (err) {
|
|
53
|
-
return apiErrorResult(err);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=dashboard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/tools/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,UAAU,sBAAsB,CAAC,GAAc,EAAE,MAAsB;IAC3E,GAAG,CAAC,YAAY,CACd,uBAAuB,EACvB;QACE,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,iJAAiJ;QAC9J,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;QACtG,KAAK,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