@solongate/proxy 0.59.5 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-client/agents.d.ts +10 -0
- package/dist/api-client/audit.d.ts +22 -0
- package/dist/api-client/client.d.ts +39 -0
- package/dist/api-client/index.d.ts +18 -0
- package/dist/api-client/policies.d.ts +82 -0
- package/dist/api-client/settings.d.ts +22 -0
- package/dist/api-client/stats.d.ts +9 -0
- package/dist/api-client/types.d.ts +224 -0
- package/dist/commands/agents.d.ts +4 -0
- package/dist/commands/args.d.ts +15 -0
- package/dist/commands/audit.d.ts +1 -0
- package/dist/commands/dlp.d.ts +1 -0
- package/dist/commands/format.d.ts +22 -0
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/index.js +938 -0
- package/dist/commands/policy.d.ts +1 -0
- package/dist/commands/ratelimit.d.ts +1 -0
- package/dist/commands/stats.d.ts +1 -0
- package/dist/index.js +2156 -284
- package/dist/tui/App.d.ts +1 -0
- package/dist/tui/components.d.ts +40 -0
- package/dist/tui/hooks.d.ts +13 -0
- package/dist/tui/index.d.ts +1 -0
- package/dist/tui/index.js +999 -0
- package/dist/tui/panels/Agents.d.ts +3 -0
- package/dist/tui/panels/Audit.d.ts +4 -0
- package/dist/tui/panels/Dlp.d.ts +4 -0
- package/dist/tui/panels/Policies.d.ts +4 -0
- package/dist/tui/panels/RateLimit.d.ts +4 -0
- package/dist/tui/panels/Stats.d.ts +3 -0
- package/dist/tui/theme.d.ts +16 -0
- package/package.json +7 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LiveAgents } from './types.js';
|
|
2
|
+
export declare function live(opts?: {
|
|
3
|
+
limit?: number;
|
|
4
|
+
includeDeactivated?: boolean;
|
|
5
|
+
}): Promise<LiveAgents>;
|
|
6
|
+
/** Deep detail for a single agent by agent_id. Loosely typed (rich payload). */
|
|
7
|
+
export declare function get(id: string, scan?: boolean): Promise<Record<string, unknown>>;
|
|
8
|
+
export declare function anomalies(id: string, limit?: number): Promise<{
|
|
9
|
+
anomalies: Array<Record<string, unknown>>;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AuditList } from './types.js';
|
|
2
|
+
export interface AuditQuery {
|
|
3
|
+
filter?: 'ALLOW' | 'DENY' | 'DENIED';
|
|
4
|
+
tool?: string;
|
|
5
|
+
limit?: number;
|
|
6
|
+
offset?: number;
|
|
7
|
+
from?: number;
|
|
8
|
+
to?: number;
|
|
9
|
+
agent_name?: string;
|
|
10
|
+
session_id?: string;
|
|
11
|
+
search?: string;
|
|
12
|
+
signal?: 'dlp' | 'ratelimit';
|
|
13
|
+
}
|
|
14
|
+
export declare function list(query?: AuditQuery): Promise<AuditList>;
|
|
15
|
+
export declare function whitelist(id: string, scope?: 'exact' | 'tool'): Promise<{
|
|
16
|
+
ok: true;
|
|
17
|
+
deduped: boolean;
|
|
18
|
+
scope: string;
|
|
19
|
+
policy_id: string;
|
|
20
|
+
policy_version?: number;
|
|
21
|
+
message?: string;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const DEFAULT_API_URL = "https://api.solongate.com";
|
|
2
|
+
export interface Credentials {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
apiUrl: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Thrown for any non-2xx response. `code`/`message` come from the API's
|
|
8
|
+
* `{ error: { code, message } }` envelope when present; `status` is the HTTP
|
|
9
|
+
* status. Callers render `.message` to the user.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ApiError extends Error {
|
|
12
|
+
readonly status: number;
|
|
13
|
+
readonly code: string;
|
|
14
|
+
constructor(status: number, code: string, message: string);
|
|
15
|
+
}
|
|
16
|
+
/** Raised when no API key can be found — tells the user to run `solongate login`. */
|
|
17
|
+
export declare class NotAuthenticatedError extends Error {
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
20
|
+
/** True when a key is available without prompting. */
|
|
21
|
+
export declare function isAuthenticated(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve API key + URL. `apiUrl` override (from a `--api-url` flag) wins over
|
|
24
|
+
* every source. Throws NotAuthenticatedError when no key is found.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveCredentials(apiUrlOverride?: string): Credentials;
|
|
27
|
+
export interface RequestOptions {
|
|
28
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
29
|
+
body?: unknown;
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
/** Override api URL for this request (rarely needed). */
|
|
32
|
+
apiUrl?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Typed request against the v1 API. Returns the parsed JSON body (as T) for 2xx
|
|
36
|
+
* responses; throws ApiError otherwise. `ArrayBuffer` bodies (e.g. wasm) are not
|
|
37
|
+
* handled here — none of the CLI surfaces need them.
|
|
38
|
+
*/
|
|
39
|
+
export declare function request<T = unknown>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, opts?: RequestOptions): Promise<T>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SolonGate Cloud API client — shared by the CLI commands and the Ink TUI.
|
|
3
|
+
* Import as `import { api } from './api-client/index.js'` then `api.policies.list()`.
|
|
4
|
+
*/
|
|
5
|
+
export * from './client.js';
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
import * as policies from './policies.js';
|
|
8
|
+
import * as settings from './settings.js';
|
|
9
|
+
import * as stats from './stats.js';
|
|
10
|
+
import * as audit from './audit.js';
|
|
11
|
+
import * as agents from './agents.js';
|
|
12
|
+
export declare const api: {
|
|
13
|
+
policies: typeof policies;
|
|
14
|
+
settings: typeof settings;
|
|
15
|
+
stats: typeof stats;
|
|
16
|
+
audit: typeof audit;
|
|
17
|
+
agents: typeof agents;
|
|
18
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ActivePolicy, PolicyDetail, PolicyListEntry, PolicyMode, PolicyRule, PolicySet, PolicyVersion } from './types.js';
|
|
2
|
+
export declare function list(): Promise<{
|
|
3
|
+
policies: PolicyListEntry[];
|
|
4
|
+
}>;
|
|
5
|
+
export declare function get(id: string, version?: number): Promise<PolicyDetail>;
|
|
6
|
+
export declare function create(policy: PolicySet): Promise<PolicyDetail>;
|
|
7
|
+
export declare function update(id: string, policy: PolicySet): Promise<PolicyDetail>;
|
|
8
|
+
export declare function remove(id: string): Promise<{
|
|
9
|
+
deleted: boolean;
|
|
10
|
+
policy_id: string;
|
|
11
|
+
}>;
|
|
12
|
+
export interface RuleSpec {
|
|
13
|
+
toolPattern?: string;
|
|
14
|
+
kind?: 'command' | 'path' | 'url' | 'tool';
|
|
15
|
+
value?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function addRule(id: string, spec: RuleSpec): Promise<{
|
|
18
|
+
ok: true;
|
|
19
|
+
deduped: boolean;
|
|
20
|
+
rule?: PolicyRule;
|
|
21
|
+
policy_id: string;
|
|
22
|
+
policy_version?: number;
|
|
23
|
+
message?: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare function revokeRule(id: string, ruleId: string): Promise<{
|
|
26
|
+
ok: true;
|
|
27
|
+
revoked: string;
|
|
28
|
+
policy_id: string;
|
|
29
|
+
policy_version: number;
|
|
30
|
+
}>;
|
|
31
|
+
export declare function versions(id: string, opts?: {
|
|
32
|
+
limit?: number;
|
|
33
|
+
offset?: number;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
versions: PolicyVersion[];
|
|
36
|
+
pagination: {
|
|
37
|
+
total: number;
|
|
38
|
+
limit: number;
|
|
39
|
+
offset: number;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
export declare function rollback(id: string, version: number): Promise<{
|
|
43
|
+
version: number;
|
|
44
|
+
rolled_back_from: number;
|
|
45
|
+
policy_id: string;
|
|
46
|
+
hash: string;
|
|
47
|
+
}>;
|
|
48
|
+
export declare function active(agentId?: string): Promise<ActivePolicy>;
|
|
49
|
+
export declare function setActive(policyId: string | null): Promise<{
|
|
50
|
+
ok: true;
|
|
51
|
+
active: string | null;
|
|
52
|
+
}>;
|
|
53
|
+
export interface DryRunResult {
|
|
54
|
+
evaluated: number;
|
|
55
|
+
would_allow: number;
|
|
56
|
+
would_deny: number;
|
|
57
|
+
newly_blocked: number;
|
|
58
|
+
newly_allowed: number;
|
|
59
|
+
unchanged: number;
|
|
60
|
+
sample_newly_blocked: Array<{
|
|
61
|
+
tool: string;
|
|
62
|
+
preview: string;
|
|
63
|
+
predicted: string;
|
|
64
|
+
created_at: string;
|
|
65
|
+
}>;
|
|
66
|
+
sample_newly_allowed: Array<{
|
|
67
|
+
tool: string;
|
|
68
|
+
preview: string;
|
|
69
|
+
predicted: string;
|
|
70
|
+
created_at: string;
|
|
71
|
+
}>;
|
|
72
|
+
mode: PolicyMode;
|
|
73
|
+
sampled: number;
|
|
74
|
+
limit: number;
|
|
75
|
+
}
|
|
76
|
+
export declare function dryRun(body: {
|
|
77
|
+
rules: PolicyRule[] | Partial<PolicyRule>[];
|
|
78
|
+
mode?: PolicyMode;
|
|
79
|
+
limit?: number;
|
|
80
|
+
from?: number;
|
|
81
|
+
to?: number;
|
|
82
|
+
}): Promise<DryRunResult>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RateLimitChange, SecurityLayers } from './types.js';
|
|
2
|
+
export declare function getSecurityLayers(): Promise<{
|
|
3
|
+
layers: SecurityLayers;
|
|
4
|
+
availablePatterns: string[];
|
|
5
|
+
}>;
|
|
6
|
+
export declare function setSecurityLayers(layers: SecurityLayers): Promise<{
|
|
7
|
+
layers: SecurityLayers;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function getRateLimitHistory(): Promise<{
|
|
10
|
+
history: RateLimitChange[];
|
|
11
|
+
}>;
|
|
12
|
+
export declare function clearRateLimitHistory(): Promise<{
|
|
13
|
+
history: RateLimitChange[];
|
|
14
|
+
}>;
|
|
15
|
+
export interface GuardStatus {
|
|
16
|
+
latest: number;
|
|
17
|
+
installed: number | null;
|
|
18
|
+
up_to_date: boolean;
|
|
19
|
+
device_count: number;
|
|
20
|
+
outdated_count: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function getGuardStatus(): Promise<GuardStatus>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Drift, Stats, Timeseries } from './types.js';
|
|
2
|
+
export declare function get(): Promise<Stats>;
|
|
3
|
+
export declare function timeseries(opts?: {
|
|
4
|
+
period?: '24h' | '7d' | '30d' | 'all';
|
|
5
|
+
granularity?: '1h' | '1d';
|
|
6
|
+
}): Promise<Timeseries>;
|
|
7
|
+
export declare function drift(days?: number): Promise<Drift>;
|
|
8
|
+
/** Rich insights payload — kept loosely typed; consumers pick fields they need. */
|
|
9
|
+
export declare function securityInsights(days?: number): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire types for the SolonGate v1 API, as consumed by the CLI.
|
|
3
|
+
*
|
|
4
|
+
* NOTE ON CASING: the API is inconsistent — policy list/version/audit responses
|
|
5
|
+
* use snake_case (created_by, _version, tool_name), while settings/alerts/agents
|
|
6
|
+
* baselines use camelCase (perMinute, windowSeconds). These types reflect what
|
|
7
|
+
* the wire actually sends; the command/TUI layers read them as-is.
|
|
8
|
+
*/
|
|
9
|
+
export type TrustLevel = 'UNTRUSTED' | 'VERIFIED' | 'TRUSTED';
|
|
10
|
+
export type Permission = 'READ' | 'WRITE' | 'EXECUTE' | 'NETWORK';
|
|
11
|
+
export type PolicyEffect = 'ALLOW' | 'DENY';
|
|
12
|
+
export type PolicyMode = 'denylist' | 'whitelist';
|
|
13
|
+
export interface Constraint {
|
|
14
|
+
allowed?: string[];
|
|
15
|
+
denied?: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface PolicyRule {
|
|
18
|
+
id: string;
|
|
19
|
+
description: string;
|
|
20
|
+
effect: PolicyEffect;
|
|
21
|
+
priority: number;
|
|
22
|
+
toolPattern: string;
|
|
23
|
+
permission?: Permission | Permission[];
|
|
24
|
+
minimumTrustLevel: TrustLevel;
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
pathConstraints?: Constraint & {
|
|
27
|
+
rootDirectory?: string;
|
|
28
|
+
allowSymlinks?: boolean;
|
|
29
|
+
};
|
|
30
|
+
commandConstraints?: Constraint;
|
|
31
|
+
filenameConstraints?: Constraint;
|
|
32
|
+
urlConstraints?: Constraint;
|
|
33
|
+
argumentConstraints?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
export interface PolicySet {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
version?: number;
|
|
40
|
+
rules: PolicyRule[];
|
|
41
|
+
mode?: PolicyMode;
|
|
42
|
+
agents?: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface PolicyListEntry {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
rules: PolicyRule[];
|
|
48
|
+
mode: PolicyMode;
|
|
49
|
+
version: number;
|
|
50
|
+
hash: string;
|
|
51
|
+
created_by: string;
|
|
52
|
+
created_at: string;
|
|
53
|
+
}
|
|
54
|
+
export interface PolicyDetail extends PolicySet {
|
|
55
|
+
_version: number;
|
|
56
|
+
_hash: string;
|
|
57
|
+
_created_at: string;
|
|
58
|
+
}
|
|
59
|
+
export interface PolicyVersion {
|
|
60
|
+
version: number;
|
|
61
|
+
hash: string;
|
|
62
|
+
reason: string;
|
|
63
|
+
created_by: string | null;
|
|
64
|
+
created_at: string;
|
|
65
|
+
rules_count: number;
|
|
66
|
+
}
|
|
67
|
+
export interface ActivePolicy {
|
|
68
|
+
policy: PolicySet | null;
|
|
69
|
+
version?: number;
|
|
70
|
+
hash?: string;
|
|
71
|
+
matched_by?: 'pinned' | 'policy-id' | 'agent' | 'wildcard';
|
|
72
|
+
self_protection_enabled: boolean;
|
|
73
|
+
security: {
|
|
74
|
+
rateLimit: {
|
|
75
|
+
perMinute: number;
|
|
76
|
+
perHour: number;
|
|
77
|
+
perDay: number;
|
|
78
|
+
} | null;
|
|
79
|
+
dlpBlock: {
|
|
80
|
+
patterns: string[];
|
|
81
|
+
custom: unknown[];
|
|
82
|
+
} | null;
|
|
83
|
+
dlpRedact: {
|
|
84
|
+
patterns: string[];
|
|
85
|
+
custom: unknown[];
|
|
86
|
+
} | null;
|
|
87
|
+
ghost: {
|
|
88
|
+
patterns: string[];
|
|
89
|
+
} | null;
|
|
90
|
+
localLogs: unknown;
|
|
91
|
+
};
|
|
92
|
+
hook_versions: {
|
|
93
|
+
guard: number;
|
|
94
|
+
audit: number;
|
|
95
|
+
shield: number;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export type LayerMode = 'off' | 'detect' | 'block';
|
|
99
|
+
export interface SecurityLayers {
|
|
100
|
+
rateLimit: {
|
|
101
|
+
mode: LayerMode;
|
|
102
|
+
perMinute: number;
|
|
103
|
+
perHour: number;
|
|
104
|
+
perDay: number;
|
|
105
|
+
};
|
|
106
|
+
dlp: {
|
|
107
|
+
mode: LayerMode;
|
|
108
|
+
patterns: string[];
|
|
109
|
+
custom: {
|
|
110
|
+
name: string;
|
|
111
|
+
re: string;
|
|
112
|
+
}[];
|
|
113
|
+
};
|
|
114
|
+
ghost: {
|
|
115
|
+
mode: 'off' | 'on';
|
|
116
|
+
patterns: string[];
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export interface RateLimitChange {
|
|
120
|
+
ts: number;
|
|
121
|
+
minute: number;
|
|
122
|
+
hour: number;
|
|
123
|
+
day: number;
|
|
124
|
+
}
|
|
125
|
+
export interface Stats {
|
|
126
|
+
total_calls: number;
|
|
127
|
+
allowed: number;
|
|
128
|
+
denied: number;
|
|
129
|
+
active_policies: number;
|
|
130
|
+
registered_tools: number;
|
|
131
|
+
recent_activity: Array<{
|
|
132
|
+
id: string;
|
|
133
|
+
tool_name: string;
|
|
134
|
+
decision: string;
|
|
135
|
+
trust_level: string;
|
|
136
|
+
evaluation_time_ms: number | null;
|
|
137
|
+
created_at: string;
|
|
138
|
+
}>;
|
|
139
|
+
}
|
|
140
|
+
export interface TimeseriesPoint {
|
|
141
|
+
timestamp: string;
|
|
142
|
+
total: number;
|
|
143
|
+
allowed: number;
|
|
144
|
+
denied: number;
|
|
145
|
+
avg_eval_time_ms: number;
|
|
146
|
+
}
|
|
147
|
+
export interface Timeseries {
|
|
148
|
+
timeseries: TimeseriesPoint[];
|
|
149
|
+
period: string;
|
|
150
|
+
granularity: 'hour' | 'day' | 'month';
|
|
151
|
+
}
|
|
152
|
+
export interface Drift {
|
|
153
|
+
days: number;
|
|
154
|
+
total_current: number;
|
|
155
|
+
total_previous: number;
|
|
156
|
+
rules: Array<{
|
|
157
|
+
rule_id: string | null;
|
|
158
|
+
reason: string | null;
|
|
159
|
+
last_tool: string | null;
|
|
160
|
+
current: number;
|
|
161
|
+
previous: number;
|
|
162
|
+
delta: number;
|
|
163
|
+
delta_pct: number | null;
|
|
164
|
+
is_new: boolean;
|
|
165
|
+
spike: boolean;
|
|
166
|
+
}>;
|
|
167
|
+
}
|
|
168
|
+
export interface AuditEntry {
|
|
169
|
+
id: string;
|
|
170
|
+
request_id: string;
|
|
171
|
+
session_id: string | null;
|
|
172
|
+
tool_name: string;
|
|
173
|
+
server_name: string;
|
|
174
|
+
permission: string;
|
|
175
|
+
trust_level: string;
|
|
176
|
+
decision: string;
|
|
177
|
+
matched_rule_id: string | null;
|
|
178
|
+
reason: string | null;
|
|
179
|
+
evaluation_time_ms: number | null;
|
|
180
|
+
arguments_summary: Record<string, unknown> | null;
|
|
181
|
+
dlp_matches: string[];
|
|
182
|
+
rate_limit_burst: boolean;
|
|
183
|
+
agent_id: string | null;
|
|
184
|
+
agent_name: string | null;
|
|
185
|
+
created_at: string;
|
|
186
|
+
}
|
|
187
|
+
export interface AuditList {
|
|
188
|
+
entries: AuditEntry[];
|
|
189
|
+
total: number;
|
|
190
|
+
limit: number;
|
|
191
|
+
offset: number;
|
|
192
|
+
rate_limit_per_minute: number;
|
|
193
|
+
}
|
|
194
|
+
export interface LiveAgent {
|
|
195
|
+
session_id: string;
|
|
196
|
+
agent_id: string | null;
|
|
197
|
+
agent_name: string | null;
|
|
198
|
+
status: 'active' | 'idle' | 'deactivated';
|
|
199
|
+
started_at: string;
|
|
200
|
+
last_seen_at: string;
|
|
201
|
+
total_calls: number;
|
|
202
|
+
allowed_calls: number;
|
|
203
|
+
denied_calls: number;
|
|
204
|
+
dlp_events: number;
|
|
205
|
+
rate_limit_events: number;
|
|
206
|
+
pi_detections: number;
|
|
207
|
+
tool_mix: {
|
|
208
|
+
read: number;
|
|
209
|
+
write: number;
|
|
210
|
+
execute: number;
|
|
211
|
+
network: number;
|
|
212
|
+
};
|
|
213
|
+
character: string;
|
|
214
|
+
trust_score: number;
|
|
215
|
+
recent_anomalies: number;
|
|
216
|
+
}
|
|
217
|
+
export interface LiveAgents {
|
|
218
|
+
agents: LiveAgent[];
|
|
219
|
+
counts: {
|
|
220
|
+
active: number;
|
|
221
|
+
idle: number;
|
|
222
|
+
deactivated: number;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal flag parser for the CLI commands. Supports:
|
|
3
|
+
* --flag value → flags.flag = "value"
|
|
4
|
+
* --flag=value → flags.flag = "value"
|
|
5
|
+
* --bool → flags.bool = true (when next token is another flag / absent)
|
|
6
|
+
* Everything else is collected as positional args, in order.
|
|
7
|
+
*/
|
|
8
|
+
export interface ParsedArgs {
|
|
9
|
+
positionals: string[];
|
|
10
|
+
flags: Record<string, string | boolean>;
|
|
11
|
+
}
|
|
12
|
+
export declare function parse(argv: string[]): ParsedArgs;
|
|
13
|
+
export declare function flagStr(flags: Record<string, string | boolean>, name: string): string | undefined;
|
|
14
|
+
export declare function flagNum(flags: Record<string, string | boolean>, name: string): number | undefined;
|
|
15
|
+
export declare function flagBool(flags: Record<string, string | boolean>, name: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function run(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function run(argv: string[]): Promise<number>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const out: (s?: string) => void;
|
|
2
|
+
export declare const err: (s?: string) => void;
|
|
3
|
+
/** Print a value as pretty JSON to stdout (the machine contract). */
|
|
4
|
+
export declare function printJson(value: unknown): void;
|
|
5
|
+
export declare const dim: (s: string) => string;
|
|
6
|
+
export declare const bold: (s: string) => string;
|
|
7
|
+
export declare const green: (s: string) => string;
|
|
8
|
+
export declare const red: (s: string) => string;
|
|
9
|
+
export declare const yellow: (s: string) => string;
|
|
10
|
+
export declare const cyan: (s: string) => string;
|
|
11
|
+
/** Color a decision string (ALLOW green, DENY/DENIED red). */
|
|
12
|
+
export declare function decisionColor(decision: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Render an aligned table to stderr. `headers` are dimmed; each row is an array
|
|
15
|
+
* of already-colored (or plain) strings. Columns size to their widest cell.
|
|
16
|
+
*/
|
|
17
|
+
export declare function table(headers: string[], rows: string[][]): void;
|
|
18
|
+
/** Truncate to n chars with an ellipsis. */
|
|
19
|
+
export declare function truncate(s: string, n: number): string;
|
|
20
|
+
/** Best-effort relative time from an ISO/date string. */
|
|
21
|
+
export declare function ago(ts: string | number): string;
|
|
22
|
+
export declare function sparkline(values: number[]): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run a management command. `command` is the subcommand name (e.g. 'policy'),
|
|
3
|
+
* `argv` are the tokens after it. Never throws — resolves to an exit code.
|
|
4
|
+
*/
|
|
5
|
+
export declare function runCommand(command: string, argv: string[]): Promise<number>;
|
|
6
|
+
/** The subcommand names this router owns (used by src/index.ts to route). */
|
|
7
|
+
export declare const COMMAND_NAMES: readonly ["policy", "ratelimit", "dlp", "stats", "audit", "agents", "agent"];
|