+70
-5
@@ -39,3 +39,3 @@ #!/usr/bin/env node | ||
| name: "aigentify", | ||
| version: "0.4.0", | ||
| version: "0.5.0", | ||
| mcpName: "io.github.pooriaarab/aigentify", | ||
@@ -738,2 +738,64 @@ description: "Audit and generate agent-native product surfaces", | ||
| // src/generators/auth-md.ts | ||
| function generateAuthMd(config) { | ||
| const packageName = config.npmPackage ?? "<NPM_PACKAGE>"; | ||
| const mcp = config.mcpUrl ?? `npx ${packageName}`; | ||
| const apiBase = config.apiBaseUrl; | ||
| const getKey = config.signupUrl ? `## Get a key (no human in the loop) | ||
| \`\`\` | ||
| POST ${config.signupUrl} | ||
| Content-Type: application/json | ||
| { "email": "you@example.com" } | ||
| \`\`\` | ||
| The response returns the API key **once** \u2014 store it in a secret store.` : `## Get a key | ||
| A key is supplied out of band: from the dashboard (${config.repository}) or an | ||
| environment variable the operator already set. Never request a key over chat.`; | ||
| return `# ${config.name} \u2014 Agent Authentication | ||
| ${config.name} authenticates agents with an **API key** sent as a Bearer token. | ||
| The same key works for the REST API and the MCP server. | ||
| ${getKey} | ||
| ## Use the key | ||
| \`\`\` | ||
| Authorization: Bearer <API_KEY> | ||
| \`\`\` | ||
| ${apiBase ? ` | ||
| - REST API base: ${apiBase}` : ""} | ||
| - MCP: ${mcp} | ||
| Read the key at call time. Never log or echo it. | ||
| ## Discovery | ||
| - Agent guide: /AGENTS.md | ||
| - MCP manifest: /.well-known/server.json | ||
| - Machine index: /llms.txt | ||
| ## Errors | ||
| | Status | Meaning | What the agent should do | | ||
| | --- | --- | --- | | ||
| | 401 | Missing or invalid key | Stop and ask for a valid key. Do not retry. | | ||
| | 403 | Key lacks permission | Request the needed scope. Do not retry as-is. | | ||
| | 429 | Rate limited | Back off, then retry after \`Retry-After\`. | | ||
| ## Revocation | ||
| A revoked key returns 401. Rotate the key from the dashboard and update the | ||
| agent's secret store. | ||
| `; | ||
| } | ||
| var init_auth_md = __esm({ | ||
| "src/generators/auth-md.ts"() { | ||
| "use strict"; | ||
| } | ||
| }); | ||
| // src/generators/offer.ts | ||
@@ -798,2 +860,3 @@ function generateOffer(config) { | ||
| if (artifact === "agents-route") return generateAgentsRoute(config, params.framework); | ||
| if (artifact === "auth-md") return generateAuthMd(config); | ||
| throw new Error(`Unknown artifact: ${artifact}`); | ||
@@ -807,2 +870,3 @@ } | ||
| init_agents_route(); | ||
| init_auth_md(); | ||
| init_offer(); | ||
@@ -812,2 +876,3 @@ init_server(); | ||
| init_agents_route(); | ||
| init_auth_md(); | ||
| init_offer(); | ||
@@ -851,3 +916,3 @@ init_server(); | ||
| import_meta2 = {}; | ||
| artifacts = ["agents-md", "server-json", "offer", "agents-route"]; | ||
| artifacts = ["agents-md", "server-json", "offer", "agents-route", "auth-md"]; | ||
| if (import_meta2.url === `file://${process.argv[1]}`) startMcpServer().catch((error) => { | ||
@@ -876,3 +941,3 @@ process.stderr.write(`${error instanceof Error ? error.message : String(error)} | ||
| const result = { created: [], skipped: [] }; | ||
| for (const [name, content] of [["AGENTS.md", generate("agents-md", config)], ["server.json", generate("server-json", config)]]) { | ||
| for (const [name, content] of [["AGENTS.md", generate("agents-md", config)], ["server.json", generate("server-json", config)], ["auth.md", generate("auth-md", config)]]) { | ||
| const file = import_node_path2.default.join(root, name); | ||
@@ -947,5 +1012,5 @@ try { | ||
| }); | ||
| program.command("gen <artifact>").description("Generate an agent-native artifact.").option("-o, --out <path>", "write to a file instead of stdout").option("--name <name>").option("--description <description>").option("--repository <url>").option("--mcp-url <url>").option("--npm-package <name>").option("--price <price>").option("--price-currency <currency>").option("--framework <framework>", "route framework, such as static or next", "static").action(async (artifact, options) => { | ||
| program.command("gen <artifact>").description("Generate an agent-native artifact.").option("-o, --out <path>", "write to a file instead of stdout").option("--name <name>").option("--description <description>").option("--repository <url>").option("--mcp-url <url>").option("--npm-package <name>").option("--api-base-url <url>").option("--signup-url <url>").option("--price <price>").option("--price-currency <currency>").option("--framework <framework>", "route framework, such as static or next", "static").action(async (artifact, options) => { | ||
| const offer = options.price === void 0 && options.priceCurrency === void 0 ? void 0 : { price: options.price, priceCurrency: options.priceCurrency }; | ||
| const params = Object.fromEntries(Object.entries({ name: options.name, description: options.description, repository: options.repository, mcpUrl: options.mcpUrl, npmPackage: options.npmPackage, framework: options.framework, offer }).filter(([, value]) => value !== void 0)); | ||
| const params = Object.fromEntries(Object.entries({ name: options.name, description: options.description, repository: options.repository, mcpUrl: options.mcpUrl, npmPackage: options.npmPackage, apiBaseUrl: options.apiBaseUrl, signupUrl: options.signupUrl, framework: options.framework, offer }).filter(([, value]) => value !== void 0)); | ||
| const content = await generateArtifact(artifact, process.cwd(), params); | ||
@@ -952,0 +1017,0 @@ if (options.out) { |
+70
-5
@@ -18,3 +18,3 @@ #!/usr/bin/env node | ||
| name: "aigentify", | ||
| version: "0.4.0", | ||
| version: "0.5.0", | ||
| mcpName: "io.github.pooriaarab/aigentify", | ||
@@ -717,2 +717,64 @@ description: "Audit and generate agent-native product surfaces", | ||
| // src/generators/auth-md.ts | ||
| function generateAuthMd(config) { | ||
| const packageName = config.npmPackage ?? "<NPM_PACKAGE>"; | ||
| const mcp = config.mcpUrl ?? `npx ${packageName}`; | ||
| const apiBase = config.apiBaseUrl; | ||
| const getKey = config.signupUrl ? `## Get a key (no human in the loop) | ||
| \`\`\` | ||
| POST ${config.signupUrl} | ||
| Content-Type: application/json | ||
| { "email": "you@example.com" } | ||
| \`\`\` | ||
| The response returns the API key **once** \u2014 store it in a secret store.` : `## Get a key | ||
| A key is supplied out of band: from the dashboard (${config.repository}) or an | ||
| environment variable the operator already set. Never request a key over chat.`; | ||
| return `# ${config.name} \u2014 Agent Authentication | ||
| ${config.name} authenticates agents with an **API key** sent as a Bearer token. | ||
| The same key works for the REST API and the MCP server. | ||
| ${getKey} | ||
| ## Use the key | ||
| \`\`\` | ||
| Authorization: Bearer <API_KEY> | ||
| \`\`\` | ||
| ${apiBase ? ` | ||
| - REST API base: ${apiBase}` : ""} | ||
| - MCP: ${mcp} | ||
| Read the key at call time. Never log or echo it. | ||
| ## Discovery | ||
| - Agent guide: /AGENTS.md | ||
| - MCP manifest: /.well-known/server.json | ||
| - Machine index: /llms.txt | ||
| ## Errors | ||
| | Status | Meaning | What the agent should do | | ||
| | --- | --- | --- | | ||
| | 401 | Missing or invalid key | Stop and ask for a valid key. Do not retry. | | ||
| | 403 | Key lacks permission | Request the needed scope. Do not retry as-is. | | ||
| | 429 | Rate limited | Back off, then retry after \`Retry-After\`. | | ||
| ## Revocation | ||
| A revoked key returns 401. Rotate the key from the dashboard and update the | ||
| agent's secret store. | ||
| `; | ||
| } | ||
| var init_auth_md = __esm({ | ||
| "src/generators/auth-md.ts"() { | ||
| "use strict"; | ||
| } | ||
| }); | ||
| // src/generators/offer.ts | ||
@@ -777,2 +839,3 @@ function generateOffer(config) { | ||
| if (artifact === "agents-route") return generateAgentsRoute(config, params.framework); | ||
| if (artifact === "auth-md") return generateAuthMd(config); | ||
| throw new Error(`Unknown artifact: ${artifact}`); | ||
@@ -786,2 +849,3 @@ } | ||
| init_agents_route(); | ||
| init_auth_md(); | ||
| init_offer(); | ||
@@ -791,2 +855,3 @@ init_server(); | ||
| init_agents_route(); | ||
| init_auth_md(); | ||
| init_offer(); | ||
@@ -829,3 +894,3 @@ init_server(); | ||
| init_generators(); | ||
| artifacts = ["agents-md", "server-json", "offer", "agents-route"]; | ||
| artifacts = ["agents-md", "server-json", "offer", "agents-route", "auth-md"]; | ||
| if (import.meta.url === `file://${process.argv[1]}`) startMcpServer().catch((error) => { | ||
@@ -854,3 +919,3 @@ process.stderr.write(`${error instanceof Error ? error.message : String(error)} | ||
| const result = { created: [], skipped: [] }; | ||
| for (const [name, content] of [["AGENTS.md", generate("agents-md", config)], ["server.json", generate("server-json", config)]]) { | ||
| for (const [name, content] of [["AGENTS.md", generate("agents-md", config)], ["server.json", generate("server-json", config)], ["auth.md", generate("auth-md", config)]]) { | ||
| const file = path2.join(root, name); | ||
@@ -924,5 +989,5 @@ try { | ||
| }); | ||
| program.command("gen <artifact>").description("Generate an agent-native artifact.").option("-o, --out <path>", "write to a file instead of stdout").option("--name <name>").option("--description <description>").option("--repository <url>").option("--mcp-url <url>").option("--npm-package <name>").option("--price <price>").option("--price-currency <currency>").option("--framework <framework>", "route framework, such as static or next", "static").action(async (artifact, options) => { | ||
| program.command("gen <artifact>").description("Generate an agent-native artifact.").option("-o, --out <path>", "write to a file instead of stdout").option("--name <name>").option("--description <description>").option("--repository <url>").option("--mcp-url <url>").option("--npm-package <name>").option("--api-base-url <url>").option("--signup-url <url>").option("--price <price>").option("--price-currency <currency>").option("--framework <framework>", "route framework, such as static or next", "static").action(async (artifact, options) => { | ||
| const offer = options.price === void 0 && options.priceCurrency === void 0 ? void 0 : { price: options.price, priceCurrency: options.priceCurrency }; | ||
| const params = Object.fromEntries(Object.entries({ name: options.name, description: options.description, repository: options.repository, mcpUrl: options.mcpUrl, npmPackage: options.npmPackage, framework: options.framework, offer }).filter(([, value]) => value !== void 0)); | ||
| const params = Object.fromEntries(Object.entries({ name: options.name, description: options.description, repository: options.repository, mcpUrl: options.mcpUrl, npmPackage: options.npmPackage, apiBaseUrl: options.apiBaseUrl, signupUrl: options.signupUrl, framework: options.framework, offer }).filter(([, value]) => value !== void 0)); | ||
| const content = await generateArtifact(artifact, process.cwd(), params); | ||
@@ -929,0 +994,0 @@ if (options.out) { |
+61
-1
@@ -45,2 +45,3 @@ "use strict"; | ||
| generateAgentsRoute: () => generateAgentsRoute, | ||
| generateAuthMd: () => generateAuthMd, | ||
| generateOffer: () => generateOffer, | ||
@@ -59,3 +60,3 @@ generateServerJson: () => generateServerJson, | ||
| name: "aigentify", | ||
| version: "0.4.0", | ||
| version: "0.5.0", | ||
| mcpName: "io.github.pooriaarab/aigentify", | ||
@@ -725,2 +726,59 @@ description: "Audit and generate agent-native product surfaces", | ||
| // src/generators/auth-md.ts | ||
| function generateAuthMd(config) { | ||
| const packageName = config.npmPackage ?? "<NPM_PACKAGE>"; | ||
| const mcp = config.mcpUrl ?? `npx ${packageName}`; | ||
| const apiBase = config.apiBaseUrl; | ||
| const getKey = config.signupUrl ? `## Get a key (no human in the loop) | ||
| \`\`\` | ||
| POST ${config.signupUrl} | ||
| Content-Type: application/json | ||
| { "email": "you@example.com" } | ||
| \`\`\` | ||
| The response returns the API key **once** \u2014 store it in a secret store.` : `## Get a key | ||
| A key is supplied out of band: from the dashboard (${config.repository}) or an | ||
| environment variable the operator already set. Never request a key over chat.`; | ||
| return `# ${config.name} \u2014 Agent Authentication | ||
| ${config.name} authenticates agents with an **API key** sent as a Bearer token. | ||
| The same key works for the REST API and the MCP server. | ||
| ${getKey} | ||
| ## Use the key | ||
| \`\`\` | ||
| Authorization: Bearer <API_KEY> | ||
| \`\`\` | ||
| ${apiBase ? ` | ||
| - REST API base: ${apiBase}` : ""} | ||
| - MCP: ${mcp} | ||
| Read the key at call time. Never log or echo it. | ||
| ## Discovery | ||
| - Agent guide: /AGENTS.md | ||
| - MCP manifest: /.well-known/server.json | ||
| - Machine index: /llms.txt | ||
| ## Errors | ||
| | Status | Meaning | What the agent should do | | ||
| | --- | --- | --- | | ||
| | 401 | Missing or invalid key | Stop and ask for a valid key. Do not retry. | | ||
| | 403 | Key lacks permission | Request the needed scope. Do not retry as-is. | | ||
| | 429 | Rate limited | Back off, then retry after \`Retry-After\`. | | ||
| ## Revocation | ||
| A revoked key returns 401. Rotate the key from the dashboard and update the | ||
| agent's secret store. | ||
| `; | ||
| } | ||
| // src/generators/offer.ts | ||
@@ -774,2 +832,3 @@ function generateOffer(config) { | ||
| if (artifact === "agents-route") return generateAgentsRoute(config, params.framework); | ||
| if (artifact === "auth-md") return generateAuthMd(config); | ||
| throw new Error(`Unknown artifact: ${artifact}`); | ||
@@ -791,2 +850,3 @@ } | ||
| generateAgentsRoute, | ||
| generateAuthMd, | ||
| generateOffer, | ||
@@ -793,0 +853,0 @@ generateServerJson, |
+6
-2
@@ -39,2 +39,4 @@ type AuditStatus = 'pass' | 'fail' | 'warn' | 'na'; | ||
| npmPackage?: string; | ||
| apiBaseUrl?: string; | ||
| signupUrl?: string; | ||
| offer?: OfferConfig; | ||
@@ -55,2 +57,4 @@ } | ||
| declare function generateAuthMd(config: AigentifyConfig): string; | ||
| declare function generateOffer(config: AigentifyConfig): string; | ||
@@ -60,3 +64,3 @@ | ||
| type GeneratedArtifact = 'agents-md' | 'server-json' | 'offer' | 'agents-route'; | ||
| type GeneratedArtifact = 'agents-md' | 'server-json' | 'offer' | 'agents-route' | 'auth-md'; | ||
| type GenerateParams = Partial<AigentifyConfig> & { | ||
@@ -67,2 +71,2 @@ framework?: string; | ||
| export { type AigentifyConfig, type AuditCheck, type AuditGap, type AuditOptions, type AuditReport, type AuditStatus, CONFIG_FILENAME, type GenerateParams, type GeneratedArtifact, type OfferConfig, PKG_NAME, SERVER_SCHEMA_RE, SERVER_SCHEMA_URL, VERSION, auditTarget, defaultConfig, defineConfig, formatAuditReport, generate, generateAgentsMd, generateAgentsRoute, generateOffer, generateServerJson, scoreAuditChecks }; | ||
| export { type AigentifyConfig, type AuditCheck, type AuditGap, type AuditOptions, type AuditReport, type AuditStatus, CONFIG_FILENAME, type GenerateParams, type GeneratedArtifact, type OfferConfig, PKG_NAME, SERVER_SCHEMA_RE, SERVER_SCHEMA_URL, VERSION, auditTarget, defaultConfig, defineConfig, formatAuditReport, generate, generateAgentsMd, generateAgentsRoute, generateAuthMd, generateOffer, generateServerJson, scoreAuditChecks }; |
+6
-2
@@ -39,2 +39,4 @@ type AuditStatus = 'pass' | 'fail' | 'warn' | 'na'; | ||
| npmPackage?: string; | ||
| apiBaseUrl?: string; | ||
| signupUrl?: string; | ||
| offer?: OfferConfig; | ||
@@ -55,2 +57,4 @@ } | ||
| declare function generateAuthMd(config: AigentifyConfig): string; | ||
| declare function generateOffer(config: AigentifyConfig): string; | ||
@@ -60,3 +64,3 @@ | ||
| type GeneratedArtifact = 'agents-md' | 'server-json' | 'offer' | 'agents-route'; | ||
| type GeneratedArtifact = 'agents-md' | 'server-json' | 'offer' | 'agents-route' | 'auth-md'; | ||
| type GenerateParams = Partial<AigentifyConfig> & { | ||
@@ -67,2 +71,2 @@ framework?: string; | ||
| export { type AigentifyConfig, type AuditCheck, type AuditGap, type AuditOptions, type AuditReport, type AuditStatus, CONFIG_FILENAME, type GenerateParams, type GeneratedArtifact, type OfferConfig, PKG_NAME, SERVER_SCHEMA_RE, SERVER_SCHEMA_URL, VERSION, auditTarget, defaultConfig, defineConfig, formatAuditReport, generate, generateAgentsMd, generateAgentsRoute, generateOffer, generateServerJson, scoreAuditChecks }; | ||
| export { type AigentifyConfig, type AuditCheck, type AuditGap, type AuditOptions, type AuditReport, type AuditStatus, CONFIG_FILENAME, type GenerateParams, type GeneratedArtifact, type OfferConfig, PKG_NAME, SERVER_SCHEMA_RE, SERVER_SCHEMA_URL, VERSION, auditTarget, defaultConfig, defineConfig, formatAuditReport, generate, generateAgentsMd, generateAgentsRoute, generateAuthMd, generateOffer, generateServerJson, scoreAuditChecks }; |
+60
-1
@@ -8,3 +8,3 @@ // src/audit.ts | ||
| name: "aigentify", | ||
| version: "0.4.0", | ||
| version: "0.5.0", | ||
| mcpName: "io.github.pooriaarab/aigentify", | ||
@@ -674,2 +674,59 @@ description: "Audit and generate agent-native product surfaces", | ||
| // src/generators/auth-md.ts | ||
| function generateAuthMd(config) { | ||
| const packageName = config.npmPackage ?? "<NPM_PACKAGE>"; | ||
| const mcp = config.mcpUrl ?? `npx ${packageName}`; | ||
| const apiBase = config.apiBaseUrl; | ||
| const getKey = config.signupUrl ? `## Get a key (no human in the loop) | ||
| \`\`\` | ||
| POST ${config.signupUrl} | ||
| Content-Type: application/json | ||
| { "email": "you@example.com" } | ||
| \`\`\` | ||
| The response returns the API key **once** \u2014 store it in a secret store.` : `## Get a key | ||
| A key is supplied out of band: from the dashboard (${config.repository}) or an | ||
| environment variable the operator already set. Never request a key over chat.`; | ||
| return `# ${config.name} \u2014 Agent Authentication | ||
| ${config.name} authenticates agents with an **API key** sent as a Bearer token. | ||
| The same key works for the REST API and the MCP server. | ||
| ${getKey} | ||
| ## Use the key | ||
| \`\`\` | ||
| Authorization: Bearer <API_KEY> | ||
| \`\`\` | ||
| ${apiBase ? ` | ||
| - REST API base: ${apiBase}` : ""} | ||
| - MCP: ${mcp} | ||
| Read the key at call time. Never log or echo it. | ||
| ## Discovery | ||
| - Agent guide: /AGENTS.md | ||
| - MCP manifest: /.well-known/server.json | ||
| - Machine index: /llms.txt | ||
| ## Errors | ||
| | Status | Meaning | What the agent should do | | ||
| | --- | --- | --- | | ||
| | 401 | Missing or invalid key | Stop and ask for a valid key. Do not retry. | | ||
| | 403 | Key lacks permission | Request the needed scope. Do not retry as-is. | | ||
| | 429 | Rate limited | Back off, then retry after \`Retry-After\`. | | ||
| ## Revocation | ||
| A revoked key returns 401. Rotate the key from the dashboard and update the | ||
| agent's secret store. | ||
| `; | ||
| } | ||
| // src/generators/offer.ts | ||
@@ -723,2 +780,3 @@ function generateOffer(config) { | ||
| if (artifact === "agents-route") return generateAgentsRoute(config, params.framework); | ||
| if (artifact === "auth-md") return generateAuthMd(config); | ||
| throw new Error(`Unknown artifact: ${artifact}`); | ||
@@ -739,2 +797,3 @@ } | ||
| generateAgentsRoute, | ||
| generateAuthMd, | ||
| generateOffer, | ||
@@ -741,0 +800,0 @@ generateServerJson, |
+60
-2
@@ -49,3 +49,3 @@ #!/usr/bin/env node | ||
| name: "aigentify", | ||
| version: "0.4.0", | ||
| version: "0.5.0", | ||
| mcpName: "io.github.pooriaarab/aigentify", | ||
@@ -707,2 +707,59 @@ description: "Audit and generate agent-native product surfaces", | ||
| // src/generators/auth-md.ts | ||
| function generateAuthMd(config) { | ||
| const packageName = config.npmPackage ?? "<NPM_PACKAGE>"; | ||
| const mcp = config.mcpUrl ?? `npx ${packageName}`; | ||
| const apiBase = config.apiBaseUrl; | ||
| const getKey = config.signupUrl ? `## Get a key (no human in the loop) | ||
| \`\`\` | ||
| POST ${config.signupUrl} | ||
| Content-Type: application/json | ||
| { "email": "you@example.com" } | ||
| \`\`\` | ||
| The response returns the API key **once** \u2014 store it in a secret store.` : `## Get a key | ||
| A key is supplied out of band: from the dashboard (${config.repository}) or an | ||
| environment variable the operator already set. Never request a key over chat.`; | ||
| return `# ${config.name} \u2014 Agent Authentication | ||
| ${config.name} authenticates agents with an **API key** sent as a Bearer token. | ||
| The same key works for the REST API and the MCP server. | ||
| ${getKey} | ||
| ## Use the key | ||
| \`\`\` | ||
| Authorization: Bearer <API_KEY> | ||
| \`\`\` | ||
| ${apiBase ? ` | ||
| - REST API base: ${apiBase}` : ""} | ||
| - MCP: ${mcp} | ||
| Read the key at call time. Never log or echo it. | ||
| ## Discovery | ||
| - Agent guide: /AGENTS.md | ||
| - MCP manifest: /.well-known/server.json | ||
| - Machine index: /llms.txt | ||
| ## Errors | ||
| | Status | Meaning | What the agent should do | | ||
| | --- | --- | --- | | ||
| | 401 | Missing or invalid key | Stop and ask for a valid key. Do not retry. | | ||
| | 403 | Key lacks permission | Request the needed scope. Do not retry as-is. | | ||
| | 429 | Rate limited | Back off, then retry after \`Retry-After\`. | | ||
| ## Revocation | ||
| A revoked key returns 401. Rotate the key from the dashboard and update the | ||
| agent's secret store. | ||
| `; | ||
| } | ||
| // src/generators/offer.ts | ||
@@ -756,2 +813,3 @@ function generateOffer(config) { | ||
| if (artifact === "agents-route") return generateAgentsRoute(config, params.framework); | ||
| if (artifact === "auth-md") return generateAuthMd(config); | ||
| throw new Error(`Unknown artifact: ${artifact}`); | ||
@@ -762,3 +820,3 @@ } | ||
| var import_meta = {}; | ||
| var artifacts = ["agents-md", "server-json", "offer", "agents-route"]; | ||
| var artifacts = ["agents-md", "server-json", "offer", "agents-route", "auth-md"]; | ||
| function createMcpServer() { | ||
@@ -765,0 +823,0 @@ const server = new import_mcp.McpServer({ name: PKG_NAME, version: VERSION }); |
+60
-2
@@ -15,3 +15,3 @@ #!/usr/bin/env node | ||
| name: "aigentify", | ||
| version: "0.4.0", | ||
| version: "0.5.0", | ||
| mcpName: "io.github.pooriaarab/aigentify", | ||
@@ -673,2 +673,59 @@ description: "Audit and generate agent-native product surfaces", | ||
| // src/generators/auth-md.ts | ||
| function generateAuthMd(config) { | ||
| const packageName = config.npmPackage ?? "<NPM_PACKAGE>"; | ||
| const mcp = config.mcpUrl ?? `npx ${packageName}`; | ||
| const apiBase = config.apiBaseUrl; | ||
| const getKey = config.signupUrl ? `## Get a key (no human in the loop) | ||
| \`\`\` | ||
| POST ${config.signupUrl} | ||
| Content-Type: application/json | ||
| { "email": "you@example.com" } | ||
| \`\`\` | ||
| The response returns the API key **once** \u2014 store it in a secret store.` : `## Get a key | ||
| A key is supplied out of band: from the dashboard (${config.repository}) or an | ||
| environment variable the operator already set. Never request a key over chat.`; | ||
| return `# ${config.name} \u2014 Agent Authentication | ||
| ${config.name} authenticates agents with an **API key** sent as a Bearer token. | ||
| The same key works for the REST API and the MCP server. | ||
| ${getKey} | ||
| ## Use the key | ||
| \`\`\` | ||
| Authorization: Bearer <API_KEY> | ||
| \`\`\` | ||
| ${apiBase ? ` | ||
| - REST API base: ${apiBase}` : ""} | ||
| - MCP: ${mcp} | ||
| Read the key at call time. Never log or echo it. | ||
| ## Discovery | ||
| - Agent guide: /AGENTS.md | ||
| - MCP manifest: /.well-known/server.json | ||
| - Machine index: /llms.txt | ||
| ## Errors | ||
| | Status | Meaning | What the agent should do | | ||
| | --- | --- | --- | | ||
| | 401 | Missing or invalid key | Stop and ask for a valid key. Do not retry. | | ||
| | 403 | Key lacks permission | Request the needed scope. Do not retry as-is. | | ||
| | 429 | Rate limited | Back off, then retry after \`Retry-After\`. | | ||
| ## Revocation | ||
| A revoked key returns 401. Rotate the key from the dashboard and update the | ||
| agent's secret store. | ||
| `; | ||
| } | ||
| // src/generators/offer.ts | ||
@@ -722,2 +779,3 @@ function generateOffer(config) { | ||
| if (artifact === "agents-route") return generateAgentsRoute(config, params.framework); | ||
| if (artifact === "auth-md") return generateAuthMd(config); | ||
| throw new Error(`Unknown artifact: ${artifact}`); | ||
@@ -727,3 +785,3 @@ } | ||
| // src/mcp.ts | ||
| var artifacts = ["agents-md", "server-json", "offer", "agents-route"]; | ||
| var artifacts = ["agents-md", "server-json", "offer", "agents-route", "auth-md"]; | ||
| function createMcpServer() { | ||
@@ -730,0 +788,0 @@ const server = new McpServer({ name: PKG_NAME, version: VERSION }); |
+1
-1
| { | ||
| "name": "aigentify", | ||
| "version": "0.4.0", | ||
| "version": "0.5.0", | ||
| "mcpName": "io.github.pooriaarab/aigentify", | ||
@@ -5,0 +5,0 @@ "description": "Audit and generate agent-native product surfaces", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
727139
3.75%5127
5.65%