@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.
Files changed (52) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/README.md +223 -16
  3. package/dist/audit-5LUDXZLG.js +18 -0
  4. package/dist/audit-5LUDXZLG.js.map +1 -0
  5. package/dist/chunk-2QDPPTPY.js +179 -0
  6. package/dist/chunk-2QDPPTPY.js.map +1 -0
  7. package/dist/chunk-4WTFMFRY.js +1270 -0
  8. package/dist/chunk-4WTFMFRY.js.map +1 -0
  9. package/dist/chunk-5WRI5ZAA.js +31 -0
  10. package/dist/chunk-5WRI5ZAA.js.map +1 -0
  11. package/dist/chunk-DEVXG3IB.js +113 -0
  12. package/dist/chunk-DEVXG3IB.js.map +1 -0
  13. package/dist/chunk-F73VDY3W.js +202 -0
  14. package/dist/chunk-F73VDY3W.js.map +1 -0
  15. package/dist/chunk-IEJK7N3B.js +275 -0
  16. package/dist/chunk-IEJK7N3B.js.map +1 -0
  17. package/dist/chunk-IS3DAHZI.js +1698 -0
  18. package/dist/chunk-IS3DAHZI.js.map +1 -0
  19. package/dist/chunk-JSELR4SG.js +780 -0
  20. package/dist/chunk-JSELR4SG.js.map +1 -0
  21. package/dist/chunk-OM5L7A32.js +199 -0
  22. package/dist/chunk-OM5L7A32.js.map +1 -0
  23. package/dist/chunk-SWZQMPDG.js +206 -0
  24. package/dist/chunk-SWZQMPDG.js.map +1 -0
  25. package/dist/chunk-TJXZBOHL.js +529 -0
  26. package/dist/chunk-TJXZBOHL.js.map +1 -0
  27. package/dist/chunk-XOBFANL4.js +119 -0
  28. package/dist/chunk-XOBFANL4.js.map +1 -0
  29. package/dist/chunk-XPNBYSIN.js +23 -0
  30. package/dist/chunk-XPNBYSIN.js.map +1 -0
  31. package/dist/chunk-YBVD6HTT.js +1036 -0
  32. package/dist/chunk-YBVD6HTT.js.map +1 -0
  33. package/dist/chunk-ZG4LGUJE.js +847 -0
  34. package/dist/chunk-ZG4LGUJE.js.map +1 -0
  35. package/dist/cli.js +10 -4775
  36. package/dist/cli.js.map +1 -1
  37. package/dist/fixtures/crm-server.js +6 -1272
  38. package/dist/fixtures/crm-server.js.map +1 -1
  39. package/dist/fixtures/demo-agent.js +4 -115
  40. package/dist/fixtures/demo-agent.js.map +1 -1
  41. package/dist/index.d.ts +73 -14
  42. package/dist/index.js +247 -5138
  43. package/dist/index.js.map +1 -1
  44. package/dist/init-MKPQU2JG.js +17 -0
  45. package/dist/init-MKPQU2JG.js.map +1 -0
  46. package/dist/proxy-6GP63TLD.js +146 -0
  47. package/dist/proxy-6GP63TLD.js.map +1 -0
  48. package/dist/tools-XS7PMTLT.js +15 -0
  49. package/dist/tools-XS7PMTLT.js.map +1 -0
  50. package/llms.txt +10 -4
  51. package/package.json +16 -4
  52. package/server.json +9 -9
@@ -0,0 +1,119 @@
1
+ // src/fixtures/demo-agent.ts
2
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
3
+ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
4
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
5
+ import { fileURLToPath } from "url";
6
+ import path from "path";
7
+ function summarize(result) {
8
+ const text = result.content.find((c) => c.type === "text")?.text;
9
+ const meta = result._meta?.okgate;
10
+ if (result.isError) {
11
+ let code;
12
+ try {
13
+ code = JSON.parse(text ?? "{}").code;
14
+ } catch {
15
+ }
16
+ return { ok: false, code, text };
17
+ }
18
+ return { ok: true, dryRun: meta?.dryRun, text };
19
+ }
20
+ async function runDemoAgent(client, opts = {}) {
21
+ const steps = [];
22
+ const log = opts.log ?? (() => void 0);
23
+ const meta = opts.runId ? { runId: opts.runId } : void 0;
24
+ const call = async (step, tool, args) => {
25
+ const result = await client.callTool({
26
+ name: tool,
27
+ arguments: args,
28
+ _meta: meta
29
+ });
30
+ const s = { step, tool, ...summarize(result) };
31
+ steps.push(s);
32
+ log(
33
+ `${s.ok ? s.dryRun ? "faked " : "ok " : `${s.code ?? "error"}`.padEnd(6)} ${step}: ${tool}`
34
+ );
35
+ return s;
36
+ };
37
+ await call("read: list contacts", "crm_list_contacts", { limit: 10 });
38
+ await call("read: get one", "crm_get_contact", { id: "c_1" });
39
+ await call("write: create", "crm_create_contact", {
40
+ name: "Demo Person",
41
+ email: "demo@example.com"
42
+ });
43
+ await call("write: update", "crm_update_contact", { id: "c_1", fields: { name: "Ada L." } });
44
+ await call("write: delete (destructive)", "crm_delete_contact", { id: "c_2" });
45
+ await call("write: send email", "crm_send_email", {
46
+ to: "ada@example.com",
47
+ subject: "Hi",
48
+ body: "Hello from the demo agent"
49
+ });
50
+ await call("spend: charge $12", "crm_charge_card", {
51
+ customer_id: "c_1",
52
+ amount_cents: 1200,
53
+ currency: "usd"
54
+ });
55
+ const loops = opts.loop ?? 5;
56
+ for (let i = 0; i < loops; i += 1) {
57
+ const s = await call(`loop ${i + 1}/${loops}: identical update`, "crm_update_contact", {
58
+ id: "c_3",
59
+ fields: { name: "Same Thing" }
60
+ });
61
+ if (s.code === "LOOP_DETECTED") break;
62
+ }
63
+ const burst = opts.burst ?? 60;
64
+ for (let i = 0; i < burst; i += 1) {
65
+ const s = await call(`burst ${i + 1}/${burst}: create`, "crm_create_contact", {
66
+ name: `Bulk ${i}`,
67
+ email: `bulk${i}@example.com`
68
+ });
69
+ if (s.code === "CAP_EXCEEDED") break;
70
+ }
71
+ return steps;
72
+ }
73
+ var isMain = process.argv[1] !== void 0 && /demo-agent\.[cm]?[jt]s$/.test(process.argv[1]);
74
+ if (isMain) {
75
+ const argv = process.argv.slice(2);
76
+ const arg = (name) => {
77
+ const i = argv.indexOf(name);
78
+ return i >= 0 ? argv[i + 1] : void 0;
79
+ };
80
+ const url = arg("--url");
81
+ const config = arg("--config") ?? "okgate.yaml";
82
+ const client = new Client({ name: "okgate-demo-agent", version: "0.1.0" });
83
+ if (url) {
84
+ await client.connect(
85
+ new StreamableHTTPClientTransport(new URL(url), {
86
+ requestInit: {
87
+ headers: { "X-Run-Id": arg("--run-id") ?? `demo_${Date.now().toString(36)}` }
88
+ }
89
+ })
90
+ );
91
+ } else {
92
+ const cli = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../cli.js");
93
+ await client.connect(
94
+ new StdioClientTransport({
95
+ command: process.execPath,
96
+ args: [cli, "proxy", "--config", config],
97
+ stderr: "inherit"
98
+ })
99
+ );
100
+ }
101
+ try {
102
+ const steps = await runDemoAgent(client, {
103
+ log: (l) => console.log(l),
104
+ runId: arg("--run-id")
105
+ });
106
+ const halts = steps.filter((s) => !s.ok).map((s) => s.code);
107
+ console.log(
108
+ `
109
+ ${steps.length} calls; halts: ${halts.join(", ") || "none"}. Now run: okgate report`
110
+ );
111
+ } finally {
112
+ await client.close();
113
+ }
114
+ }
115
+
116
+ export {
117
+ runDemoAgent
118
+ };
119
+ //# sourceMappingURL=chunk-XOBFANL4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/fixtures/demo-agent.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * A scripted \"agent\" that misbehaves on purpose: reads, then writes, then loops, then bursts\n * writes past the cap. Run it against the proxy to see dry-run diffs, LOOP_DETECTED and\n * CAP_EXCEEDED in `okgate report`.\n *\n * node dist/fixtures/demo-agent.js --config okgate.yaml # spawns `okgate proxy` over stdio\n */\nimport { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { StdioClientTransport } from \"@modelcontextprotocol/sdk/client/stdio.js\";\nimport { StreamableHTTPClientTransport } from \"@modelcontextprotocol/sdk/client/streamableHttp.js\";\nimport type { CallToolResult } from \"@modelcontextprotocol/sdk/types.js\";\nimport { fileURLToPath } from \"node:url\";\nimport path from \"node:path\";\n\nexport interface DemoStep {\n step: string;\n tool: string;\n ok: boolean;\n code?: string;\n dryRun?: boolean;\n text?: string;\n}\n\nexport interface DemoOptions {\n /** how many writes to burst at the end (default 60 — past a `writes: 50` cap) */\n burst?: number;\n /** how many times to repeat the identical update (default 5 — past `max_repeats: 3`) */\n loop?: number;\n runId?: string;\n log?: (line: string) => void;\n}\n\nfunction summarize(result: CallToolResult): {\n ok: boolean;\n code?: string;\n dryRun?: boolean;\n text?: string;\n} {\n const text = result.content.find((c) => c.type === \"text\")?.text;\n const meta = (result._meta as { okgate?: { dryRun?: boolean } } | undefined)?.okgate;\n if (result.isError) {\n let code: string | undefined;\n try {\n code = (JSON.parse(text ?? \"{}\") as { code?: string }).code;\n } catch {\n // not JSON\n }\n return { ok: false, code, text };\n }\n return { ok: true, dryRun: meta?.dryRun, text };\n}\n\n/** Drive a connected client through the scripted scenario. Returns every step's outcome. */\nexport async function runDemoAgent(client: Client, opts: DemoOptions = {}): Promise<DemoStep[]> {\n const steps: DemoStep[] = [];\n const log = opts.log ?? (() => undefined);\n const meta = opts.runId ? { runId: opts.runId } : undefined;\n const call = async (\n step: string,\n tool: string,\n args: Record<string, unknown>,\n ): Promise<DemoStep> => {\n const result = (await client.callTool({\n name: tool,\n arguments: args,\n _meta: meta,\n })) as CallToolResult;\n const s = { step, tool, ...summarize(result) };\n steps.push(s);\n log(\n `${s.ok ? (s.dryRun ? \"faked \" : \"ok \") : `${s.code ?? \"error\"}`.padEnd(6)} ${step}: ${tool}`,\n );\n return s;\n };\n\n await call(\"read: list contacts\", \"crm_list_contacts\", { limit: 10 });\n await call(\"read: get one\", \"crm_get_contact\", { id: \"c_1\" });\n await call(\"write: create\", \"crm_create_contact\", {\n name: \"Demo Person\",\n email: \"demo@example.com\",\n });\n await call(\"write: update\", \"crm_update_contact\", { id: \"c_1\", fields: { name: \"Ada L.\" } });\n await call(\"write: delete (destructive)\", \"crm_delete_contact\", { id: \"c_2\" });\n await call(\"write: send email\", \"crm_send_email\", {\n to: \"ada@example.com\",\n subject: \"Hi\",\n body: \"Hello from the demo agent\",\n });\n await call(\"spend: charge $12\", \"crm_charge_card\", {\n customer_id: \"c_1\",\n amount_cents: 1200,\n currency: \"usd\",\n });\n\n const loops = opts.loop ?? 5;\n for (let i = 0; i < loops; i += 1) {\n const s = await call(`loop ${i + 1}/${loops}: identical update`, \"crm_update_contact\", {\n id: \"c_3\",\n fields: { name: \"Same Thing\" },\n });\n if (s.code === \"LOOP_DETECTED\") break;\n }\n\n const burst = opts.burst ?? 60;\n for (let i = 0; i < burst; i += 1) {\n const s = await call(`burst ${i + 1}/${burst}: create`, \"crm_create_contact\", {\n name: `Bulk ${i}`,\n email: `bulk${i}@example.com`,\n });\n if (s.code === \"CAP_EXCEEDED\") break;\n }\n return steps;\n}\n\nconst isMain = process.argv[1] !== undefined && /demo-agent\\.[cm]?[jt]s$/.test(process.argv[1]);\nif (isMain) {\n const argv = process.argv.slice(2);\n const arg = (name: string): string | undefined => {\n const i = argv.indexOf(name);\n return i >= 0 ? argv[i + 1] : undefined;\n };\n const url = arg(\"--url\");\n const config = arg(\"--config\") ?? \"okgate.yaml\";\n const client = new Client({ name: \"okgate-demo-agent\", version: \"0.1.0\" });\n if (url) {\n await client.connect(\n new StreamableHTTPClientTransport(new URL(url), {\n requestInit: {\n headers: { \"X-Run-Id\": arg(\"--run-id\") ?? `demo_${Date.now().toString(36)}` },\n },\n }),\n );\n } else {\n const cli = path.resolve(path.dirname(fileURLToPath(import.meta.url)), \"../cli.js\");\n await client.connect(\n new StdioClientTransport({\n command: process.execPath,\n args: [cli, \"proxy\", \"--config\", config],\n stderr: \"inherit\",\n }),\n );\n }\n try {\n const steps = await runDemoAgent(client, {\n log: (l) => console.log(l),\n runId: arg(\"--run-id\"),\n });\n const halts = steps.filter((s) => !s.ok).map((s) => s.code);\n console.log(\n `\\n${steps.length} calls; halts: ${halts.join(\", \") || \"none\"}. Now run: okgate report`,\n );\n } finally {\n await client.close();\n }\n}\n"],"mappings":";AAQA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,qCAAqC;AAE9C,SAAS,qBAAqB;AAC9B,OAAO,UAAU;AAoBjB,SAAS,UAAU,QAKjB;AACA,QAAM,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AAK;AACP,UAAM,OAAO;AAAA,MACX,IAAI,8BAA8B,IAAI,IAAI,GAAG,GAAG;AAAA,QAC9C,aAAa;AAAA,UACX,SAAS,EAAE,YAAY,IAAI,UAAU,KAAK,QAAQ,KAAK,IAAI,EAAE,SAAS,EAAE,CAAC,GAAG;AAAA,QAC9E;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,OAAO;AACL,UAAM,MAAM,KAAK,QAAQ,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,WAAW;AAClF,UAAM,OAAO;AAAA,MACX,IAAI,qBAAqB;AAAA,QACvB,SAAS,QAAQ;AAAA,QACjB,MAAM,CAAC,KAAK,SAAS,YAAY,MAAM;AAAA,QACvC,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AACA,MAAI;AACF,UAAM,QAAQ,MAAM,aAAa,QAAQ;AAAA,MACvC,KAAK,CAAC,MAAM,QAAQ,IAAI,CAAC;AAAA,MACzB,OAAO,IAAI,UAAU;AAAA,IACvB,CAAC;AACD,UAAM,QAAQ,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI;AAC1D,YAAQ;AAAA,MACN;AAAA,EAAK,MAAM,MAAM,kBAAkB,MAAM,KAAK,IAAI,KAAK,MAAM;AAAA,IAC/D;AAAA,EACF,UAAE;AACA,UAAM,OAAO,MAAM;AAAA,EACrB;AACF;","names":[]}
@@ -0,0 +1,23 @@
1
+ // src/install.ts
2
+ var NEW_NPM_NAMES = false;
3
+ var FROM_GITHUB = false;
4
+ var BIN = "okgate";
5
+ var PACKAGE = NEW_NPM_NAMES ? "@agentwares/okgate" : "@agentwares/agentguard";
6
+ var GITHUB = "--allow-git=root github:agentwares/okgate";
7
+ function npxArgs(opts = {}) {
8
+ const pkg = `${PACKAGE}${opts.version ? `@${opts.version}` : ""}`;
9
+ return [...opts.yes ? ["-y"] : [], ...NEW_NPM_NAMES ? [pkg] : ["-p", pkg, BIN]];
10
+ }
11
+ var INSTALL = FROM_GITHUB ? `npx ${GITHUB}` : ["npx", ...npxArgs()].join(" ");
12
+ var RUN = FROM_GITHUB ? `npx -y ${GITHUB}` : ["npx", ...npxArgs({ yes: true })].join(" ");
13
+ function npxCommand(version) {
14
+ return ["npx", ...npxArgs({ yes: true, version })].join(" ");
15
+ }
16
+
17
+ export {
18
+ npxArgs,
19
+ INSTALL,
20
+ RUN,
21
+ npxCommand
22
+ };
23
+ //# sourceMappingURL=chunk-XPNBYSIN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/install.ts"],"sourcesContent":["/**\n * How to run okgate: the one constant behind every place the command is shown, printed or\n * written into someone's config: `--help` and the CLI's own hints, the hook command `hooks\n * install` writes, the MCP server entry `init` writes, the README, llms.txt, server.json and the\n * plugin files. src/distribution.test.ts fails while any of them names a form that does not run.\n *\n * agentguard was renamed okgate on 8 Oct 2026 (brief REN-1). The new npm names need the owner's\n * security key for their first publish, so until then npm serves okgate as a second bin of the\n * package it always was: `npx -p @agentwares/agentguard okgate`.\n *\n * - NEW_NPM_NAMES: flip when `@agentwares/okgate`, `-core` and `-sdk` 0.2.0 are on npm (and the\n * old names have become shims). Hook commands and MCP entries then name `@agentwares/okgate`.\n * The rest of the flip is listed in docs/handoff/briefs/REN-1.md's PR and in shims/README.md.\n * - FROM_GITHUB: the npm-free form REL-1 uses for the doors,\n * `npx --allow-git=root github:agentwares/okgate` (npm 12 refuses a git spec unless\n * `--allow-git` permits it; `root` permits only the one named; npm 10 and 11 accept the flag).\n * It needs the public repo renamed AND a runnable package at its root, which it does not have\n * today: scripts/sync-oss-repos.sh generates agentguard as a private pnpm workspace. Leave it\n * off until `npx --allow-git=root github:agentwares/okgate --version` prints a version.\n */\nexport const NEW_NPM_NAMES: boolean = false;\nexport const FROM_GITHUB: boolean = false;\n\nexport const BIN = \"okgate\";\n/** The npm package that serves the CLI. */\nexport const PACKAGE = NEW_NPM_NAMES ? \"@agentwares/okgate\" : \"@agentwares/agentguard\";\n/** The npm package the policy engine is published as. */\nexport const CORE_PACKAGE = NEW_NPM_NAMES\n ? \"@agentwares/okgate-core\"\n : \"@agentwares/agentguard-core\";\n/** The npm package the SDK is published as. */\nexport const SDK_PACKAGE = NEW_NPM_NAMES ? \"@agentwares/okgate-sdk\" : \"@agentwares/agentguard-sdk\";\n\nconst GITHUB = \"--allow-git=root github:agentwares/okgate\";\n\n/** `npx` arguments that run the CLI from npm; `version` pins it. */\nexport function npxArgs(opts: { yes?: boolean; version?: string } = {}): string[] {\n const pkg = `${PACKAGE}${opts.version ? `@${opts.version}` : \"\"}`;\n return [...(opts.yes ? [\"-y\"] : []), ...(NEW_NPM_NAMES ? [pkg] : [\"-p\", pkg, BIN])];\n}\n\n/** What a person types. */\nexport const INSTALL = FROM_GITHUB ? `npx ${GITHUB}` : [\"npx\", ...npxArgs()].join(\" \");\n\n/** What an agent runs unattended: no install prompt. */\nexport const RUN = FROM_GITHUB ? `npx -y ${GITHUB}` : [\"npx\", ...npxArgs({ yes: true })].join(\" \");\n\n/**\n * The command a hook or an MCP client config runs: always from npm, pinned when `version` is\n * given, so a committed settings file keeps running the build that wrote it.\n */\nexport function npxCommand(version?: string): string {\n return [\"npx\", ...npxArgs({ yes: true, version })].join(\" \");\n}\n"],"mappings":";AAoBO,IAAM,gBAAyB;AAC/B,IAAM,cAAuB;AAE7B,IAAM,MAAM;AAEZ,IAAM,UAAU,gBAAgB,uBAAuB;AAQ9D,IAAM,SAAS;AAGR,SAAS,QAAQ,OAA4C,CAAC,GAAa;AAChF,QAAM,MAAM,GAAG,OAAO,GAAG,KAAK,UAAU,IAAI,KAAK,OAAO,KAAK,EAAE;AAC/D,SAAO,CAAC,GAAI,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,GAAI,GAAI,gBAAgB,CAAC,GAAG,IAAI,CAAC,MAAM,KAAK,GAAG,CAAE;AACpF;AAGO,IAAM,UAAU,cAAc,OAAO,MAAM,KAAK,CAAC,OAAO,GAAG,QAAQ,CAAC,EAAE,KAAK,GAAG;AAG9E,IAAM,MAAM,cAAc,UAAU,MAAM,KAAK,CAAC,OAAO,GAAG,QAAQ,EAAE,KAAK,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG;AAM1F,SAAS,WAAW,SAA0B;AACnD,SAAO,CAAC,OAAO,GAAG,QAAQ,EAAE,KAAK,MAAM,QAAQ,CAAC,CAAC,EAAE,KAAK,GAAG;AAC7D;","names":[]}