@agentwares/agentguard 0.1.7 → 0.1.10
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/CHANGELOG.md +108 -0
- package/README.md +223 -16
- package/dist/audit-5LUDXZLG.js +18 -0
- package/dist/audit-5LUDXZLG.js.map +1 -0
- package/dist/chunk-2QDPPTPY.js +179 -0
- package/dist/chunk-2QDPPTPY.js.map +1 -0
- package/dist/chunk-4WTFMFRY.js +1270 -0
- package/dist/chunk-4WTFMFRY.js.map +1 -0
- package/dist/chunk-5WRI5ZAA.js +31 -0
- package/dist/chunk-5WRI5ZAA.js.map +1 -0
- package/dist/chunk-DEVXG3IB.js +113 -0
- package/dist/chunk-DEVXG3IB.js.map +1 -0
- package/dist/chunk-F73VDY3W.js +202 -0
- package/dist/chunk-F73VDY3W.js.map +1 -0
- package/dist/chunk-IEJK7N3B.js +275 -0
- package/dist/chunk-IEJK7N3B.js.map +1 -0
- package/dist/chunk-IS3DAHZI.js +1698 -0
- package/dist/chunk-IS3DAHZI.js.map +1 -0
- package/dist/chunk-JSELR4SG.js +780 -0
- package/dist/chunk-JSELR4SG.js.map +1 -0
- package/dist/chunk-OM5L7A32.js +199 -0
- package/dist/chunk-OM5L7A32.js.map +1 -0
- package/dist/chunk-SWZQMPDG.js +206 -0
- package/dist/chunk-SWZQMPDG.js.map +1 -0
- package/dist/chunk-TJXZBOHL.js +529 -0
- package/dist/chunk-TJXZBOHL.js.map +1 -0
- package/dist/chunk-XOBFANL4.js +119 -0
- package/dist/chunk-XOBFANL4.js.map +1 -0
- package/dist/chunk-XPNBYSIN.js +23 -0
- package/dist/chunk-XPNBYSIN.js.map +1 -0
- package/dist/chunk-YBVD6HTT.js +1036 -0
- package/dist/chunk-YBVD6HTT.js.map +1 -0
- package/dist/chunk-ZG4LGUJE.js +847 -0
- package/dist/chunk-ZG4LGUJE.js.map +1 -0
- package/dist/cli.js +10 -4775
- package/dist/cli.js.map +1 -1
- package/dist/fixtures/crm-server.js +6 -1272
- package/dist/fixtures/crm-server.js.map +1 -1
- package/dist/fixtures/demo-agent.js +4 -115
- package/dist/fixtures/demo-agent.js.map +1 -1
- package/dist/index.d.ts +73 -14
- package/dist/index.js +247 -5138
- package/dist/index.js.map +1 -1
- package/dist/init-MKPQU2JG.js +17 -0
- package/dist/init-MKPQU2JG.js.map +1 -0
- package/dist/proxy-6GP63TLD.js +146 -0
- package/dist/proxy-6GP63TLD.js.map +1 -0
- package/dist/tools-XS7PMTLT.js +15 -0
- package/dist/tools-XS7PMTLT.js.map +1 -0
- package/llms.txt +10 -4
- package/package.json +16 -4
- package/server.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -195,6 +195,11 @@ declare class ProxyRuntime {
|
|
|
195
195
|
redact: boolean;
|
|
196
196
|
include_results: boolean;
|
|
197
197
|
max_chars: number;
|
|
198
|
+
rules: {
|
|
199
|
+
check: string | string[];
|
|
200
|
+
id?: string | undefined;
|
|
201
|
+
text?: string | undefined;
|
|
202
|
+
}[];
|
|
198
203
|
};
|
|
199
204
|
alerts: {
|
|
200
205
|
on: ("KILLED" | "APPROVAL_REQUIRED" | "LOOP_DETECTED" | "CAP_EXCEEDED" | "TOOL_DENIED")[];
|
|
@@ -204,6 +209,31 @@ declare class ProxyRuntime {
|
|
|
204
209
|
state: {
|
|
205
210
|
dir: string;
|
|
206
211
|
};
|
|
212
|
+
hooks: {
|
|
213
|
+
mode: "dry-run" | "enforce";
|
|
214
|
+
shell: {
|
|
215
|
+
deny: string[];
|
|
216
|
+
approval: string[];
|
|
217
|
+
};
|
|
218
|
+
paths: {
|
|
219
|
+
deny: string[];
|
|
220
|
+
approval: string[];
|
|
221
|
+
};
|
|
222
|
+
irreversible: {
|
|
223
|
+
builtins: boolean | ("git-push" | "merge" | "tag-delete" | "rm-outside-workspace" | "publish" | "send" | "guard-config")[];
|
|
224
|
+
rules: {
|
|
225
|
+
name: string;
|
|
226
|
+
shell: string[];
|
|
227
|
+
paths: string[];
|
|
228
|
+
tools: string[];
|
|
229
|
+
mentions: string[];
|
|
230
|
+
}[];
|
|
231
|
+
window_s: number;
|
|
232
|
+
require_mention: boolean;
|
|
233
|
+
require_origin: boolean;
|
|
234
|
+
mentions: Record<string, string[]>;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
207
237
|
allow?: string[] | undefined;
|
|
208
238
|
};
|
|
209
239
|
start(): Promise<void>;
|
|
@@ -260,6 +290,15 @@ declare function toCallToolResult(result: GuardResult, tool: ExposedTool | undef
|
|
|
260
290
|
/** Build the per-session MCP server. */
|
|
261
291
|
declare function createDownstreamServer(runtime: ProxyRuntime, opts?: DownstreamOptions): McpServer;
|
|
262
292
|
|
|
293
|
+
interface HttpRegistration {
|
|
294
|
+
url: string;
|
|
295
|
+
baseUrl: string;
|
|
296
|
+
token: string;
|
|
297
|
+
pid: number;
|
|
298
|
+
startedAt: string;
|
|
299
|
+
}
|
|
300
|
+
declare function registrationPath(stateDir: string): string;
|
|
301
|
+
|
|
263
302
|
interface HttpProxyOptions {
|
|
264
303
|
runtime: ProxyRuntime;
|
|
265
304
|
port?: number;
|
|
@@ -275,14 +314,7 @@ interface HttpProxy {
|
|
|
275
314
|
token: string;
|
|
276
315
|
close(): Promise<void>;
|
|
277
316
|
}
|
|
278
|
-
|
|
279
|
-
url: string;
|
|
280
|
-
baseUrl: string;
|
|
281
|
-
token: string;
|
|
282
|
-
pid: number;
|
|
283
|
-
startedAt: string;
|
|
284
|
-
}
|
|
285
|
-
declare function registrationPath(stateDir: string): string;
|
|
317
|
+
|
|
286
318
|
declare function startHttpProxy(opts: HttpProxyOptions): Promise<HttpProxy>;
|
|
287
319
|
|
|
288
320
|
/** Tiny argv parser: `--flag value`, `--flag=value`, `--bool`, `--no-bool`, repeated flags → arrays. */
|
|
@@ -299,6 +331,8 @@ interface Io {
|
|
|
299
331
|
env: NodeJS.ProcessEnv;
|
|
300
332
|
/** false when stdout is a pipe — an MCP client spawned us and wants a server, not the help text */
|
|
301
333
|
tty?: boolean;
|
|
334
|
+
/** everything on stdin (hook mode reads the harness's JSON from it) */
|
|
335
|
+
stdin?: () => Promise<string>;
|
|
302
336
|
}
|
|
303
337
|
declare function loadPolicyFor(args: ParsedArgs, io: Io, opts?: {
|
|
304
338
|
allowMissingEnv?: boolean;
|
|
@@ -381,11 +415,11 @@ declare function rewriteClientConfig(file: ClientConfigFile, policyPath: string,
|
|
|
381
415
|
backup: string;
|
|
382
416
|
replaced: string[];
|
|
383
417
|
};
|
|
384
|
-
/** `
|
|
418
|
+
/** `okgate init --undo`: restore the backup. */
|
|
385
419
|
declare function restoreClientConfig(file: ClientConfigFile): boolean;
|
|
386
420
|
|
|
387
421
|
/**
|
|
388
|
-
* `
|
|
422
|
+
* `okgate tools` — connect to every upstream and print the tools the agent will see,
|
|
389
423
|
* with their class and why. Also the probe `init` uses to seed the policy.
|
|
390
424
|
*/
|
|
391
425
|
|
|
@@ -473,9 +507,9 @@ declare function createCrmMcpServer(state?: CrmState): McpServer;
|
|
|
473
507
|
/**
|
|
474
508
|
* A scripted "agent" that misbehaves on purpose: reads, then writes, then loops, then bursts
|
|
475
509
|
* writes past the cap. Run it against the proxy to see dry-run diffs, LOOP_DETECTED and
|
|
476
|
-
* CAP_EXCEEDED in `
|
|
510
|
+
* CAP_EXCEEDED in `okgate report`.
|
|
477
511
|
*
|
|
478
|
-
* node dist/fixtures/demo-agent.js --config
|
|
512
|
+
* node dist/fixtures/demo-agent.js --config okgate.yaml # spawns `okgate proxy` over stdio
|
|
479
513
|
*/
|
|
480
514
|
|
|
481
515
|
interface DemoStep {
|
|
@@ -497,7 +531,32 @@ interface DemoOptions {
|
|
|
497
531
|
/** Drive a connected client through the scripted scenario. Returns every step's outcome. */
|
|
498
532
|
declare function runDemoAgent(client: Client, opts?: DemoOptions): Promise<DemoStep[]>;
|
|
499
533
|
|
|
500
|
-
declare const
|
|
534
|
+
declare const AUDIT_CANARIES: readonly ["CANARY-PROMPT-7d1e", "CANARY-ASSISTANT-3b9a", "CANARY-COMMIT-MESSAGE-5c2f", "CANARY-OUTPUT-8e4d", "CANARY-PATH-2a6b", "CANARY-CONTENT-9f0c"];
|
|
535
|
+
interface SyntheticAuditOptions {
|
|
536
|
+
/** the repository: rule files are written here */
|
|
537
|
+
repo: string;
|
|
538
|
+
/** stands in for ~/.claude/projects */
|
|
539
|
+
claudeDir: string;
|
|
540
|
+
/** stands in for ~/.codex/sessions */
|
|
541
|
+
codexDir: string;
|
|
542
|
+
now?: Date;
|
|
543
|
+
}
|
|
544
|
+
interface SyntheticAuditHistory {
|
|
545
|
+
/** sessions in the repository in the last 7 days (5 Claude Code, 1 Codex) */
|
|
546
|
+
sessionsLast7d: number;
|
|
547
|
+
/** and with the one 20 days old */
|
|
548
|
+
sessionsAll: number;
|
|
549
|
+
}
|
|
550
|
+
/** Write the rule files and the transcripts. */
|
|
551
|
+
declare function writeSyntheticAuditHistory(opts: SyntheticAuditOptions): SyntheticAuditHistory;
|
|
552
|
+
|
|
553
|
+
/** The willingness-to-pay test: a page that says what the team view would be, and one button. */
|
|
554
|
+
declare const TEAM_HISTORY_URL = "https://agentwares-agentguard.vercel.app/team-history";
|
|
555
|
+
/** `7d`, `30d`, `24h`, `all`, or a date. Undefined: all history. */
|
|
556
|
+
declare function parseSince(value: string | undefined, now: Date): number | undefined;
|
|
557
|
+
declare function auditCommand(args: ParsedArgs, io: Io): Promise<number>;
|
|
558
|
+
|
|
559
|
+
declare const HELP: string;
|
|
501
560
|
declare function main(argv: readonly string[], io?: Io): Promise<number>;
|
|
502
561
|
|
|
503
|
-
export { type CallContext, type ClientConfigFile, type CrmState, DEFAULT_PERMISSION_PATHS, type DemoOptions, type DemoStep, type DownstreamOptions, type DownstreamSession, type ExposedTool, type FileGuard, HELP, type HttpProxy, type HttpProxyOptions, type HttpRegistration, type Io, type PermissionDiffResult, type ProbeResult, type ProbedTool, ProxyRuntime, type RuntimeOptions, type ServerEntry, type UpstreamStatus, approvalSlackMessage, candidateConfigs, createAlerter, createCrmMcpServer, createDownstreamServer, createFileGuard, crmTools, detectClientConfigs, haltSlackMessage, loadPolicyFor, main, probeUpstreams, proxyEntry, readRegistration, readServers, registrationPath, renderStarterPolicy, restoreClientConfig, rewriteClientConfig, runDemoAgent, runIdFor, runPermissionDiff, seedState, serversToUpstreams, startHttpProxy, toCallToolResult };
|
|
562
|
+
export { AUDIT_CANARIES, type CallContext, type ClientConfigFile, type CrmState, DEFAULT_PERMISSION_PATHS, type DemoOptions, type DemoStep, type DownstreamOptions, type DownstreamSession, type ExposedTool, type FileGuard, HELP, type HttpProxy, type HttpProxyOptions, type HttpRegistration, type Io, type PermissionDiffResult, type ProbeResult, type ProbedTool, ProxyRuntime, type RuntimeOptions, type ServerEntry, type SyntheticAuditHistory, type SyntheticAuditOptions, TEAM_HISTORY_URL, type UpstreamStatus, approvalSlackMessage, auditCommand, candidateConfigs, createAlerter, createCrmMcpServer, createDownstreamServer, createFileGuard, crmTools, detectClientConfigs, haltSlackMessage, loadPolicyFor, main, parseSince, probeUpstreams, proxyEntry, readRegistration, readServers, registrationPath, renderStarterPolicy, restoreClientConfig, rewriteClientConfig, runDemoAgent, runIdFor, runPermissionDiff, seedState, serversToUpstreams, startHttpProxy, toCallToolResult, writeSyntheticAuditHistory };
|