@agentwares/agentguard 0.1.6 → 0.1.9

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 (48) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +223 -16
  3. package/dist/audit-2YCMHMCP.js +17 -0
  4. package/dist/audit-2YCMHMCP.js.map +1 -0
  5. package/dist/chunk-3O6KWT3E.js +345 -0
  6. package/dist/chunk-3O6KWT3E.js.map +1 -0
  7. package/dist/chunk-5WRI5ZAA.js +31 -0
  8. package/dist/chunk-5WRI5ZAA.js.map +1 -0
  9. package/dist/chunk-6S7LYVOC.js +1033 -0
  10. package/dist/chunk-6S7LYVOC.js.map +1 -0
  11. package/dist/chunk-6TUQD666.js +828 -0
  12. package/dist/chunk-6TUQD666.js.map +1 -0
  13. package/dist/chunk-BKXXTWIS.js +119 -0
  14. package/dist/chunk-BKXXTWIS.js.map +1 -0
  15. package/dist/chunk-D66U3PVB.js +529 -0
  16. package/dist/chunk-D66U3PVB.js.map +1 -0
  17. package/dist/chunk-HPYZ3JDX.js +206 -0
  18. package/dist/chunk-HPYZ3JDX.js.map +1 -0
  19. package/dist/chunk-KRKZGAJ3.js +769 -0
  20. package/dist/chunk-KRKZGAJ3.js.map +1 -0
  21. package/dist/chunk-SUXQTT3X.js +1268 -0
  22. package/dist/chunk-SUXQTT3X.js.map +1 -0
  23. package/dist/chunk-TW5KJREH.js +190 -0
  24. package/dist/chunk-TW5KJREH.js.map +1 -0
  25. package/dist/chunk-VQWQ5TOM.js +113 -0
  26. package/dist/chunk-VQWQ5TOM.js.map +1 -0
  27. package/dist/chunk-X4M7YWQA.js +270 -0
  28. package/dist/chunk-X4M7YWQA.js.map +1 -0
  29. package/dist/chunk-ZSLWPKXI.js +1144 -0
  30. package/dist/chunk-ZSLWPKXI.js.map +1 -0
  31. package/dist/cli.js +8 -4725
  32. package/dist/cli.js.map +1 -1
  33. package/dist/fixtures/crm-server.js +6 -1272
  34. package/dist/fixtures/crm-server.js.map +1 -1
  35. package/dist/fixtures/demo-agent.js +4 -115
  36. package/dist/fixtures/demo-agent.js.map +1 -1
  37. package/dist/index.d.ts +76 -10
  38. package/dist/index.js +246 -5087
  39. package/dist/index.js.map +1 -1
  40. package/dist/init-CWROGV5I.js +15 -0
  41. package/dist/init-CWROGV5I.js.map +1 -0
  42. package/dist/proxy-3Z5YEZ4R.js +154 -0
  43. package/dist/proxy-3Z5YEZ4R.js.map +1 -0
  44. package/dist/tools-3LLDG3XQ.js +15 -0
  45. package/dist/tools-3LLDG3XQ.js.map +1 -0
  46. package/llms.txt +4 -0
  47. package/package.json +9 -3
  48. package/server.json +2 -2
@@ -0,0 +1,206 @@
1
+ import {
2
+ createHttpHandler,
3
+ createMcpServer,
4
+ defineTool,
5
+ handleHealth,
6
+ localhostHosts,
7
+ serveNodeHttp,
8
+ serveStdio,
9
+ toolError
10
+ } from "./chunk-ZSLWPKXI.js";
11
+
12
+ // src/fixtures/crm-server.ts
13
+ import { z } from "zod";
14
+ function seedState() {
15
+ const contacts = /* @__PURE__ */ new Map();
16
+ for (const [id, name, email] of [
17
+ ["c_1", "Ada Lovelace", "ada@example.com"],
18
+ ["c_2", "Grace Hopper", "grace@example.com"],
19
+ ["c_3", "Linus Torvalds", "linus@example.com"]
20
+ ]) {
21
+ contacts.set(id, { id, name, email, updated_at: "2026-01-01T00:00:00.000Z" });
22
+ }
23
+ return { contacts, mutations: [], emails: [], charges: [] };
24
+ }
25
+ var counter = 0;
26
+ var nextId = (prefix) => `${prefix}_${(++counter).toString(36).padStart(4, "0")}`;
27
+ function crmTools(state) {
28
+ const contactSchema = z.object({
29
+ id: z.string(),
30
+ name: z.string(),
31
+ email: z.string(),
32
+ updated_at: z.string()
33
+ });
34
+ return [
35
+ defineTool({
36
+ name: "crm_list_contacts",
37
+ description: "List every contact in the CRM. Read-only; returns id, name, email and updated_at.",
38
+ input: z.object({ limit: z.number().int().min(1).max(500).default(100) }),
39
+ output: z.object({ contacts: z.array(contactSchema), total: z.number() }),
40
+ annotations: { readOnlyHint: true },
41
+ handler: ({ limit }) => ({
42
+ contacts: [...state.contacts.values()].slice(0, limit),
43
+ total: state.contacts.size
44
+ })
45
+ }),
46
+ defineTool({
47
+ name: "crm_get_contact",
48
+ description: "Fetch one contact by id. Read-only; NOT_FOUND when the id does not exist.",
49
+ input: z.object({ id: z.string() }),
50
+ output: contactSchema,
51
+ annotations: { readOnlyHint: true },
52
+ handler: ({ id }) => {
53
+ const c = state.contacts.get(id);
54
+ if (!c)
55
+ throw toolError(
56
+ "NOT_FOUND",
57
+ `no contact ${id}`,
58
+ "call crm_list_contacts and use an existing id"
59
+ );
60
+ return c;
61
+ }
62
+ }),
63
+ defineTool({
64
+ name: "crm_search",
65
+ description: "Search contacts by name or email substring. Returns matching contacts (no annotations on purpose).",
66
+ input: z.object({ query: z.string() }),
67
+ handler: ({ query }) => ({
68
+ contacts: [...state.contacts.values()].filter(
69
+ (c) => `${c.name} ${c.email}`.toLowerCase().includes(query.toLowerCase())
70
+ )
71
+ })
72
+ }),
73
+ defineTool({
74
+ name: "crm_create_contact",
75
+ description: "Create a contact. Returns the new id and created_at timestamp.",
76
+ input: z.object({ name: z.string(), email: z.string() }),
77
+ output: z.object({ id: z.string(), created_at: z.string() }),
78
+ annotations: { readOnlyHint: false, destructiveHint: false },
79
+ handler: ({ name, email }) => {
80
+ const id = nextId("c");
81
+ const now = (/* @__PURE__ */ new Date()).toISOString();
82
+ state.contacts.set(id, { id, name, email, updated_at: now });
83
+ state.mutations.push({ tool: "crm_create_contact", args: { name, email } });
84
+ return { id, created_at: now };
85
+ }
86
+ }),
87
+ defineTool({
88
+ name: "crm_update_contact",
89
+ description: "Update fields on a contact. Returns the id and updated_at; NOT_FOUND for unknown ids.",
90
+ input: z.object({
91
+ id: z.string(),
92
+ fields: z.object({ name: z.string().optional(), email: z.string().optional() })
93
+ }),
94
+ output: z.object({ id: z.string(), updated_at: z.string() }),
95
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
96
+ handler: ({ id, fields }) => {
97
+ const c = state.contacts.get(id);
98
+ if (!c)
99
+ throw toolError(
100
+ "NOT_FOUND",
101
+ `no contact ${id}`,
102
+ "call crm_list_contacts and use an existing id"
103
+ );
104
+ Object.assign(c, fields, { updated_at: (/* @__PURE__ */ new Date()).toISOString() });
105
+ state.mutations.push({ tool: "crm_update_contact", args: { id, fields } });
106
+ return { id, updated_at: c.updated_at };
107
+ }
108
+ }),
109
+ defineTool({
110
+ name: "crm_delete_contact",
111
+ description: "Permanently delete a contact. Irreversible. Returns { deleted, id }.",
112
+ input: z.object({ id: z.string() }),
113
+ output: z.object({ deleted: z.boolean(), id: z.string() }),
114
+ annotations: { readOnlyHint: false, destructiveHint: true },
115
+ handler: ({ id }) => {
116
+ const existed = state.contacts.delete(id);
117
+ state.mutations.push({ tool: "crm_delete_contact", args: { id } });
118
+ return { deleted: existed, id };
119
+ }
120
+ }),
121
+ defineTool({
122
+ name: "crm_send_email",
123
+ description: "Send an email to a contact through the CRM. Returns the message id and sent_at.",
124
+ input: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
125
+ output: z.object({ message_id: z.string(), sent_at: z.string() }),
126
+ handler: ({ to, subject }) => {
127
+ state.emails.push({ to, subject });
128
+ state.mutations.push({ tool: "crm_send_email", args: { to, subject } });
129
+ return { message_id: nextId("msg"), sent_at: (/* @__PURE__ */ new Date()).toISOString() };
130
+ }
131
+ }),
132
+ defineTool({
133
+ name: "crm_charge_card",
134
+ description: "Charge a customer's card on file (amount in cents). Returns the charge id and amount_usd.",
135
+ input: z.object({
136
+ customer_id: z.string(),
137
+ amount_cents: z.number().int().positive(),
138
+ currency: z.string().default("usd")
139
+ }),
140
+ output: z.object({ charge_id: z.string(), amount_usd: z.number() }),
141
+ handler: ({ customer_id, amount_cents }) => {
142
+ const amount_usd = amount_cents / 100;
143
+ state.charges.push({ customer_id, amount_usd });
144
+ state.mutations.push({ tool: "crm_charge_card", args: { customer_id, amount_usd } });
145
+ return { charge_id: nextId("ch"), amount_usd };
146
+ }
147
+ }),
148
+ defineTool({
149
+ name: "crm_frobnicate",
150
+ description: "A tool with no annotations and no recognizable verb \u2014 exists to test `unknown` handling.",
151
+ input: z.object({}),
152
+ handler: () => {
153
+ state.mutations.push({ tool: "crm_frobnicate", args: {} });
154
+ return { frobnicated: true };
155
+ }
156
+ }),
157
+ defineTool({
158
+ name: "crm_fail",
159
+ description: "Always returns a structured UPSTREAM_ERROR result, for error-path tests.",
160
+ input: z.object({}),
161
+ annotations: { readOnlyHint: true },
162
+ handler: () => {
163
+ throw toolError("UPSTREAM_ERROR", "the CRM is having a bad day", "retry in a minute", {
164
+ retryable: true
165
+ });
166
+ }
167
+ })
168
+ ];
169
+ }
170
+ function createCrmMcpServer(state = seedState()) {
171
+ return createMcpServer({
172
+ name: "fake-crm",
173
+ version: "0.1.0",
174
+ instructions: "A fake CRM for agentguard tests. Nothing here is real.",
175
+ tools: crmTools(state)
176
+ });
177
+ }
178
+ var isMain = process.argv[1] !== void 0 && /crm-server\.[cm]?[jt]s$/.test(process.argv[1]);
179
+ if (isMain) {
180
+ const state = seedState();
181
+ if (process.argv.includes("--http")) {
182
+ const portArg = process.argv.find((a) => a.startsWith("--port="));
183
+ const port = portArg ? Number(portArg.slice("--port=".length)) : 0;
184
+ const handler = createHttpHandler(() => createCrmMcpServer(state), {
185
+ sessions: true,
186
+ jsonResponse: false,
187
+ allowedHosts: port ? localhostHosts(port) : void 0
188
+ });
189
+ const server = await serveNodeHttp({
190
+ handler,
191
+ port,
192
+ health: () => handleHealth({ name: "fake-crm", version: "0.1.0", tools: crmTools(state).length })
193
+ });
194
+ console.log(`fake-crm listening at ${server.url}`);
195
+ } else {
196
+ for (const signal of ["SIGTERM", "SIGINT"]) process.on(signal, () => process.exit(0));
197
+ await serveStdio(createCrmMcpServer(state));
198
+ }
199
+ }
200
+
201
+ export {
202
+ seedState,
203
+ crmTools,
204
+ createCrmMcpServer
205
+ };
206
+ //# sourceMappingURL=chunk-HPYZ3JDX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/fixtures/crm-server.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Fake CRM MCP server used by the tests, the demo agent and the README walkthrough. In-memory\n * contacts; every mutation is recorded so tests can assert what really happened upstream.\n *\n * node dist/fixtures/crm-server.js # stdio\n * node dist/fixtures/crm-server.js --http # Streamable HTTP on 127.0.0.1:<port> (prints the URL)\n */\nimport {\n createHttpHandler,\n createMcpServer,\n defineTool,\n handleHealth,\n localhostHosts,\n serveNodeHttp,\n serveStdio,\n toolError,\n type ToolDef,\n} from \"@agentwares/mcp-kit\";\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\n\nexport interface Contact {\n id: string;\n name: string;\n email: string;\n updated_at: string;\n}\n\nexport interface CrmState {\n contacts: Map<string, Contact>;\n mutations: { tool: string; args: unknown }[];\n emails: { to: string; subject: string }[];\n charges: { customer_id: string; amount_usd: number }[];\n}\n\nexport function seedState(): CrmState {\n const contacts = new Map<string, Contact>();\n for (const [id, name, email] of [\n [\"c_1\", \"Ada Lovelace\", \"ada@example.com\"],\n [\"c_2\", \"Grace Hopper\", \"grace@example.com\"],\n [\"c_3\", \"Linus Torvalds\", \"linus@example.com\"],\n ] as const) {\n contacts.set(id, { id, name, email, updated_at: \"2026-01-01T00:00:00.000Z\" });\n }\n return { contacts, mutations: [], emails: [], charges: [] };\n}\n\nlet counter = 0;\nconst nextId = (prefix: string): string => `${prefix}_${(++counter).toString(36).padStart(4, \"0\")}`;\n\nexport function crmTools(state: CrmState): ToolDef[] {\n const contactSchema = z.object({\n id: z.string(),\n name: z.string(),\n email: z.string(),\n updated_at: z.string(),\n });\n return [\n defineTool({\n name: \"crm_list_contacts\",\n description:\n \"List every contact in the CRM. Read-only; returns id, name, email and updated_at.\",\n input: z.object({ limit: z.number().int().min(1).max(500).default(100) }),\n output: z.object({ contacts: z.array(contactSchema), total: z.number() }),\n annotations: { readOnlyHint: true },\n handler: ({ limit }) => ({\n contacts: [...state.contacts.values()].slice(0, limit),\n total: state.contacts.size,\n }),\n }),\n defineTool({\n name: \"crm_get_contact\",\n description: \"Fetch one contact by id. Read-only; NOT_FOUND when the id does not exist.\",\n input: z.object({ id: z.string() }),\n output: contactSchema,\n annotations: { readOnlyHint: true },\n handler: ({ id }) => {\n const c = state.contacts.get(id);\n if (!c)\n throw toolError(\n \"NOT_FOUND\",\n `no contact ${id}`,\n \"call crm_list_contacts and use an existing id\",\n );\n return c;\n },\n }),\n defineTool({\n name: \"crm_search\",\n description:\n \"Search contacts by name or email substring. Returns matching contacts (no annotations on purpose).\",\n input: z.object({ query: z.string() }),\n handler: ({ query }) => ({\n contacts: [...state.contacts.values()].filter((c) =>\n `${c.name} ${c.email}`.toLowerCase().includes(query.toLowerCase()),\n ),\n }),\n }),\n defineTool({\n name: \"crm_create_contact\",\n description: \"Create a contact. Returns the new id and created_at timestamp.\",\n input: z.object({ name: z.string(), email: z.string() }),\n output: z.object({ id: z.string(), created_at: z.string() }),\n annotations: { readOnlyHint: false, destructiveHint: false },\n handler: ({ name, email }) => {\n const id = nextId(\"c\");\n const now = new Date().toISOString();\n state.contacts.set(id, { id, name, email, updated_at: now });\n state.mutations.push({ tool: \"crm_create_contact\", args: { name, email } });\n return { id, created_at: now };\n },\n }),\n defineTool({\n name: \"crm_update_contact\",\n description:\n \"Update fields on a contact. Returns the id and updated_at; NOT_FOUND for unknown ids.\",\n input: z.object({\n id: z.string(),\n fields: z.object({ name: z.string().optional(), email: z.string().optional() }),\n }),\n output: z.object({ id: z.string(), updated_at: z.string() }),\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n handler: ({ id, fields }) => {\n const c = state.contacts.get(id);\n if (!c)\n throw toolError(\n \"NOT_FOUND\",\n `no contact ${id}`,\n \"call crm_list_contacts and use an existing id\",\n );\n Object.assign(c, fields, { updated_at: new Date().toISOString() });\n state.mutations.push({ tool: \"crm_update_contact\", args: { id, fields } });\n return { id, updated_at: c.updated_at };\n },\n }),\n defineTool({\n name: \"crm_delete_contact\",\n description: \"Permanently delete a contact. Irreversible. Returns { deleted, id }.\",\n input: z.object({ id: z.string() }),\n output: z.object({ deleted: z.boolean(), id: z.string() }),\n annotations: { readOnlyHint: false, destructiveHint: true },\n handler: ({ id }) => {\n const existed = state.contacts.delete(id);\n state.mutations.push({ tool: \"crm_delete_contact\", args: { id } });\n return { deleted: existed, id };\n },\n }),\n defineTool({\n name: \"crm_send_email\",\n description:\n \"Send an email to a contact through the CRM. Returns the message id and sent_at.\",\n input: z.object({ to: z.string(), subject: z.string(), body: z.string() }),\n output: z.object({ message_id: z.string(), sent_at: z.string() }),\n handler: ({ to, subject }) => {\n state.emails.push({ to, subject });\n state.mutations.push({ tool: \"crm_send_email\", args: { to, subject } });\n return { message_id: nextId(\"msg\"), sent_at: new Date().toISOString() };\n },\n }),\n defineTool({\n name: \"crm_charge_card\",\n description:\n \"Charge a customer's card on file (amount in cents). Returns the charge id and amount_usd.\",\n input: z.object({\n customer_id: z.string(),\n amount_cents: z.number().int().positive(),\n currency: z.string().default(\"usd\"),\n }),\n output: z.object({ charge_id: z.string(), amount_usd: z.number() }),\n handler: ({ customer_id, amount_cents }) => {\n const amount_usd = amount_cents / 100;\n state.charges.push({ customer_id, amount_usd });\n state.mutations.push({ tool: \"crm_charge_card\", args: { customer_id, amount_usd } });\n return { charge_id: nextId(\"ch\"), amount_usd };\n },\n }),\n defineTool({\n name: \"crm_frobnicate\",\n description:\n \"A tool with no annotations and no recognizable verb — exists to test `unknown` handling.\",\n input: z.object({}),\n handler: () => {\n state.mutations.push({ tool: \"crm_frobnicate\", args: {} });\n return { frobnicated: true };\n },\n }),\n defineTool({\n name: \"crm_fail\",\n description: \"Always returns a structured UPSTREAM_ERROR result, for error-path tests.\",\n input: z.object({}),\n annotations: { readOnlyHint: true },\n handler: () => {\n throw toolError(\"UPSTREAM_ERROR\", \"the CRM is having a bad day\", \"retry in a minute\", {\n retryable: true,\n });\n },\n }),\n ];\n}\n\nexport function createCrmMcpServer(state: CrmState = seedState()): McpServer {\n return createMcpServer({\n name: \"fake-crm\",\n version: \"0.1.0\",\n instructions: \"A fake CRM for agentguard tests. Nothing here is real.\",\n tools: crmTools(state),\n });\n}\n\nconst isMain = process.argv[1] !== undefined && /crm-server\\.[cm]?[jt]s$/.test(process.argv[1]);\nif (isMain) {\n const state = seedState();\n if (process.argv.includes(\"--http\")) {\n const portArg = process.argv.find((a) => a.startsWith(\"--port=\"));\n const port = portArg ? Number(portArg.slice(\"--port=\".length)) : 0;\n const handler = createHttpHandler(() => createCrmMcpServer(state), {\n sessions: true,\n jsonResponse: false,\n allowedHosts: port ? localhostHosts(port) : undefined,\n });\n const server = await serveNodeHttp({\n handler,\n port,\n health: () =>\n handleHealth({ name: \"fake-crm\", version: \"0.1.0\", tools: crmTools(state).length }),\n });\n console.log(`fake-crm listening at ${server.url}`);\n } else {\n // The proxy stops us with SIGTERM; exit on it so Node does not warn about the unsettled\n // top-level await into the parent's stderr at the end of the demo.\n for (const signal of [\"SIGTERM\", \"SIGINT\"] as const) process.on(signal, () => process.exit(0));\n await serveStdio(createCrmMcpServer(state));\n }\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,SAAS,SAAS;AAgBX,SAAS,YAAsB;AACpC,QAAM,WAAW,oBAAI,IAAqB;AAC1C,aAAW,CAAC,IAAI,MAAM,KAAK,KAAK;AAAA,IAC9B,CAAC,OAAO,gBAAgB,iBAAiB;AAAA,IACzC,CAAC,OAAO,gBAAgB,mBAAmB;AAAA,IAC3C,CAAC,OAAO,kBAAkB,mBAAmB;AAAA,EAC/C,GAAY;AACV,aAAS,IAAI,IAAI,EAAE,IAAI,MAAM,OAAO,YAAY,2BAA2B,CAAC;AAAA,EAC9E;AACA,SAAO,EAAE,UAAU,WAAW,CAAC,GAAG,QAAQ,CAAC,GAAG,SAAS,CAAC,EAAE;AAC5D;AAEA,IAAI,UAAU;AACd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