import { $Fetch } from 'ofetch'; import { ActionResponse } from '../content/content.type'; import { GovActionOpts, GovAggregateTasksParams, GovAggregateUsageParams, GovAssignmentMatrixParams, GovComputeCostParams, GovCreateConsumerParams, GovDeleteProviderParams, GovDeleteRouteParams, GovGenerateCostReportParams, GovLifecycleParams, GovMatrixRow, GovOnboardParams, GovPluginsResponse, GovProjectTasksOutput, GovPublishPolicyParams, GovResolveConfigParams, GovRevokeConsumerParams, GovRunMonitoringParams, GovSyncConsumerLimitsParams, GovSyncProviderParams, GovSyncRouteParams, GovSyncStatusParams, GovTeamParams, GovUpdateConfigParams, GovUsageCost, GovUsageDashboard, GovUsageDashboardParams, GovUsageExport, GovUsageExportParams, GovUsageQuery, GovWorkerGatewayKeyOutput, GovWorkerStatusOutput } from './gov.type'; export interface IGovServiceOptions { /** The CMS `$Fetch` instance (one of `sdk.apis`). */ api: $Fetch; } export interface IGovService { getAssignmentMatrix(): Promise; getProjectTasks(name: string): Promise; /** * Gateway plugins currently deployed, read from the git source of truth * (`gateway/`). Plugins the portal manages carry a `portalEdit` hint * (CT + action); fleet plugins do not. Caller supplies `githubToken` only * to override the engine's configured token. */ listPlugins(query?: { githubToken?: string; }): Promise; /** * Worker CR phase + Matrix MXID, realtime from the cluster (engine K8s * client required — `503` when missing). Read endpoint keyed by agent name. */ getWorkerStatus(agent: string, query?: { namespace?: string; }): Promise; /** Worker gateway key straight from Secret `agentteams-creds-` — the DB copy may be rotated/stale. */ getWorkerGatewayKey(agent: string): Promise; getUsageCost(query?: GovUsageQuery): Promise; getUsageDashboard(query?: GovUsageQuery): Promise; exportUsageCsv(query?: GovUsageQuery): Promise; onboard(uuid: string, params?: GovOnboardParams, opts?: GovActionOpts): Promise; suspend(uuid: string, params?: GovLifecycleParams, opts?: GovActionOpts): Promise; resume(uuid: string, params?: GovLifecycleParams, opts?: GovActionOpts): Promise; decommission(uuid: string, params?: GovLifecycleParams, opts?: GovActionOpts): Promise; updateConfig(uuid: string, params?: GovUpdateConfigParams, opts?: GovActionOpts): Promise; syncAgentStatus(uuid: string, params?: GovSyncStatusParams, opts?: GovActionOpts): Promise; workerStatus(uuid: string, params?: { namespace?: string; }, opts?: GovActionOpts): Promise; workerGatewayKey(uuid: string, opts?: GovActionOpts): Promise; resolveConfig(uuid: string, params?: GovResolveConfigParams, opts?: GovActionOpts): Promise; ensureAgentTypeSeeds(uuid: string, opts?: GovActionOpts): Promise; ensureCoordinator(uuid: string, opts?: GovActionOpts): Promise; createConsumer(uuid: string, params: GovCreateConsumerParams, opts?: GovActionOpts): Promise; revokeConsumer(uuid: string, params: GovRevokeConsumerParams, opts?: GovActionOpts): Promise; syncProvider(uuid: string, params?: GovSyncProviderParams, opts?: GovActionOpts): Promise; deleteProvider(uuid: string, params?: GovDeleteProviderParams, opts?: GovActionOpts): Promise; syncRoute(uuid: string, params?: GovSyncRouteParams, opts?: GovActionOpts): Promise; deleteRoute(uuid: string, params: GovDeleteRouteParams, opts?: GovActionOpts): Promise; syncConsumerLimits(uuid: string, params?: GovSyncConsumerLimitsParams, opts?: GovActionOpts): Promise; publishContentPolicy(uuid: string, params?: GovPublishPolicyParams, opts?: GovActionOpts): Promise; assignmentMatrix(uuid: string, params?: GovAssignmentMatrixParams, opts?: GovActionOpts): Promise; aggregateTasks(uuid: string, params?: GovAggregateTasksParams, opts?: GovActionOpts): Promise; runMonitoring(uuid: string, params?: GovRunMonitoringParams, opts?: GovActionOpts): Promise; createTeam(uuid: string, params?: GovTeamParams, opts?: GovActionOpts): Promise; archiveTeam(uuid: string, params?: GovTeamParams, opts?: GovActionOpts): Promise; aggregateUsage(uuid: string, params?: GovAggregateUsageParams, opts?: GovActionOpts): Promise; generateCostReport(uuid: string, params: GovGenerateCostReportParams, opts?: GovActionOpts): Promise; computeCost(uuid: string, params: GovComputeCostParams, opts?: GovActionOpts): Promise; usageDashboard(uuid: string, params?: GovUsageDashboardParams, opts?: GovActionOpts): Promise; usageExport(uuid: string, params?: GovUsageExportParams, opts?: GovActionOpts): Promise; } /** * AI Government Portal service — typed surface for the * `eaera-agent-government` pack. * * Two groups of calls: * 1. Portal REST reads mounted by the engine pack router (§6) — * matrix/tasks/usage aggregations + realtime worker status/gateway key. * Plain lists (agents, providers) have no dedicated endpoint; read them * via `useContentStore.fetchByType` with the `GOV_CONTENT_TYPE` names (§3). * 2. Typed wrappers (29) over the generic action route * `POST /api/v1/content/{uuid}/actions/{actionName}` (§5). * * Every wrapper returns the raw `ActionResponse` envelope — handler failures * arrive as HTTP 200 with `success: false`; check `success` before casting * `output` to the per-action type (e.g. `GovOnboardOutput`). * * This service does NOT participate in mock mode — the pack backend is live, * so every call goes to `api` regardless of `sdk.setMock()`. */ export declare function createGovService(opts: IGovServiceOptions): IGovService; //# sourceMappingURL=index.d.ts.map