@twin3-ai/agent-id 0.3.49 → 0.3.51

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/bin/agent-id.js CHANGED
@@ -16,6 +16,7 @@ const { verifyPortableBundle } = require("../trust-verifier.js");
16
16
  const { verifyReleaseManifest } = require("../release-verifier.js");
17
17
  const { runProductionPreflight } = require("../production-preflight.js");
18
18
  const packageMetadata = require("../package.json");
19
+ const { runMcp } = require("../mcp-runtime.js");
19
20
 
20
21
  function shellQuote(value) {
21
22
  return `'${String(value).replace(/'/g, `'"'"'`)}'`;
@@ -455,157 +456,6 @@ function siteAgentFixedActionForTool(name) {
455
456
  return shortName;
456
457
  }
457
458
 
458
- const SITE_AGENT_FIELD_TYPES = {
459
- url: { type: "string" },
460
- agent_key: { type: "string" },
461
- action: { type: "string" },
462
- audit: { type: "object" },
463
- audit_url: { type: "boolean" },
464
- mode: { type: "string" },
465
- page: { type: "object" },
466
- content: { type: "string" },
467
- text: { type: "string" },
468
- questions: { type: "array" },
469
- prompts: { type: "array" },
470
- competitors: { type: "array" },
471
- topics: { type: ["array", "string"] },
472
- engines: { type: ["array", "string"] },
473
- market: { type: "string" },
474
- cadence: { type: "string" },
475
- review_gate: { type: "object" },
476
- c5_repair_history: { type: "object" },
477
- history: { type: "object" },
478
- content_pack: { type: "object" },
479
- pack: { type: "object" },
480
- content_workflow_package: { type: "object" },
481
- package: { type: "object" },
482
- content_plan: { type: "object" },
483
- plan: { type: "object" },
484
- published_items: { type: "array" },
485
- items: { type: "array" },
486
- evidence: { type: "object" },
487
- verify_publication: { type: "boolean" },
488
- sheet: { type: "object" },
489
- run_sheet: { type: "object" },
490
- rows: { type: "array" },
491
- results: { type: "array" },
492
- completed_rows: { type: "array" },
493
- events: { type: "array" },
494
- logs: { type: "array" },
495
- source: { type: "string" },
496
- period: { type: "object" },
497
- sdk_events: { type: "array" },
498
- probes: { type: "array" },
499
- probe_set: { type: "object" },
500
- verify_artifacts: { type: "boolean" },
501
- conversions: { type: "array" },
502
- a2_citation_package: { type: "object" },
503
- feed: { type: "object" },
504
- delivery_targets: { type: "array" },
505
- apply_item_id: { type: "string" },
506
- apply_item: { type: "object" },
507
- apply_plan: { type: "object" },
508
- job_id: { type: "string" },
509
- evidence_uri: { type: "string" },
510
- proof_url: { type: "string" },
511
- receipt: { type: "object" },
512
- receipts: { type: "array" },
513
- pull_request_url: { type: "string" },
514
- deployment_reference: { type: "string" },
515
- source_feed_hash: { type: "string" },
516
- verify_proof: { type: "boolean" },
517
- verify: { type: "boolean" },
518
- insights: { type: "object" },
519
- provider: { type: "string" },
520
- evaluator: { type: "string" },
521
- currency: { type: "string" },
522
- budget: { type: "number" },
523
- draft: { type: "object" },
524
- decision: { type: "string" },
525
- draft_id: { type: "string" },
526
- create_payload: { type: "object" },
527
- reason: { type: "string" },
528
- item_id: { type: "string" }
529
- };
530
-
531
- const SITE_AGENT_TOOL_FIELDS = {
532
- site_agent_install_descriptor: ["url", "agent_key", "action"],
533
- site_agent_implementation_bundle: ["url", "agent_key", "action", "audit", "audit_url"],
534
- site_agent_audit_file_package: ["url", "agent_key", "action", "audit", "audit_url", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence"],
535
- site_agent_skill_package: ["url", "agent_key", "action", "mode"],
536
- site_agent_installation_verification: ["url", "agent_key", "action", "audit", "audit_url"],
537
- site_agent_content_optimization_plan: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "audit", "audit_url"],
538
- site_agent_content_workflow_package: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence", "audit", "audit_url"],
539
- site_agent_content_repair_pack: ["url", "agent_key", "action", "review_gate", "c5_repair_history", "history", "content_pack", "pack", "content_workflow_package", "package", "page", "content", "text", "questions", "prompts", "competitors", "audit", "audit_url"],
540
- site_agent_content_pack: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence", "audit", "audit_url", "content_plan", "plan", "content_workflow_package", "published_items", "items", "evidence", "verify_publication"],
541
- site_agent_content_publication_package: ["url", "agent_key", "action", "content_workflow_package", "package", "published_items", "items", "evidence", "page", "content", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence", "audit", "audit_url"],
542
- site_agent_citation_gap_matrix: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "audit", "audit_url"],
543
- site_agent_community_citation_plan: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "audit", "audit_url"],
544
- site_agent_prompt_test_run_sheet: ["url", "agent_key", "action", "content_plan", "plan", "questions", "prompts", "topics", "engines", "competitors", "market", "cadence"],
545
- site_agent_prompt_test_results_import: ["url", "agent_key", "action", "sheet", "run_sheet", "rows", "results", "completed_rows"],
546
- site_agent_a1_read_evidence_package: ["url", "agent_key", "action", "events", "logs", "source", "period"],
547
- site_agent_a1_dashboard: ["url", "agent_key", "action", "events", "logs", "source", "period"],
548
- site_agent_site_signal_package: ["url", "agent_key", "action", "events", "sdk_events", "period", "source"],
549
- site_agent_a2_citation_evidence_package: ["url", "agent_key", "action", "probes", "events", "probe_set", "period", "source", "verify_artifacts"],
550
- site_agent_b1_conversion_evidence_package: ["url", "agent_key", "action", "events", "conversions", "period", "source"],
551
- site_agent_outcome_report: ["url", "agent_key", "action"],
552
- site_agent_m1_outcome_evidence_package: ["url", "agent_key", "action", "period"],
553
- site_agent_m2_monthly_optimization_package: ["url", "agent_key", "action", "audit", "audit_url", "period"],
554
- site_agent_m3_monthly_execution_tracker: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence"],
555
- site_agent_m4_monthly_outcome_scorecard: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence"],
556
- site_agent_m5_monthly_dashboard: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence"],
557
- site_agent_monthly_evidence_loop: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence", "content_pack", "pack", "content_publication_package", "a2_citation_package"],
558
- site_agent_insights: ["url", "agent_key", "action", "audit", "audit_url"],
559
- site_agent_insights_feed: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence", "content_publication_package", "a2_citation_package"],
560
- site_agent_apply_plan: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence", "content_publication_package", "a2_citation_package", "feed", "delivery_targets"],
561
- site_agent_apply_evidence: ["url", "agent_key", "action", "apply_item_id", "apply_item", "apply_plan", "job_id", "evidence_uri", "proof_url", "pull_request_url", "deployment_reference", "evidence", "source_feed_hash", "verify_proof", "verify"],
562
- site_agent_job_drafts: ["url", "agent_key", "action", "audit", "audit_url", "insights", "review_gate", "provider", "evaluator", "currency"],
563
- site_agent_accept_job_draft: ["url", "agent_key", "action", "draft", "provider", "evaluator", "currency", "budget"],
564
- site_agent_decide_job_draft: ["url", "agent_key", "action", "decision", "draft", "draft_id", "create_payload", "reason", "provider", "evaluator", "currency", "budget"],
565
- site_agent_draft_decisions: ["url", "agent_key", "action", "decision", "draft_id"],
566
- site_agent_decision_reviews: ["url", "agent_key", "action", "decision", "apply_item_id", "item_id"],
567
- site_agent_report_job_evidence: ["url", "agent_key", "action", "job_id", "evidence_uri", "evidence"],
568
- site_agent_jobs: ["url", "agent_key", "action"],
569
- site_agent_c5_repair_history: ["url", "agent_key", "action"],
570
- site_agent_optimization_cycle: ["url", "agent_key", "action", "audit", "audit_url"]
571
- };
572
-
573
- const SITE_AGENT_TOOL_REQUIRED = {
574
- site_agent_apply_evidence: ["apply_item_id"],
575
- site_agent_accept_job_draft: ["draft"],
576
- site_agent_decide_job_draft: ["decision"],
577
- site_agent_report_job_evidence: ["job_id"]
578
- };
579
-
580
- function withSiteAgentFixedActionSchemas(tools) {
581
- return tools.map(tool => {
582
- const action = siteAgentFixedActionForTool(tool?.name);
583
- if (!action) return tool;
584
- const schema = tool.inputSchema && typeof tool.inputSchema === "object" && !Array.isArray(tool.inputSchema) ? tool.inputSchema : {};
585
- const properties = schema.properties && typeof schema.properties === "object" && !Array.isArray(schema.properties) ? schema.properties : {};
586
- const required = Array.isArray(schema.required) ? schema.required.filter(value => typeof value === "string") : [];
587
- const nextProperties = { ...properties };
588
- for (const field of SITE_AGENT_TOOL_FIELDS[tool.name] || []) {
589
- if (!nextProperties[field]) nextProperties[field] = SITE_AGENT_FIELD_TYPES[field] || { type: "object" };
590
- }
591
- if (action) nextProperties.action = { ...(nextProperties.action || { type: "string" }), const: action };
592
- const requiredAdditions = ["action", ...(SITE_AGENT_TOOL_REQUIRED[tool.name] || [])];
593
- const nextRequired = [...required];
594
- for (const field of requiredAdditions) {
595
- if (!nextRequired.includes(field)) nextRequired.push(field);
596
- }
597
- return {
598
- ...tool,
599
- inputSchema: {
600
- ...schema,
601
- type: "object",
602
- properties: nextProperties,
603
- required: nextRequired,
604
- },
605
- };
606
- });
607
- }
608
-
609
459
  function writeSkillPackageFiles(response, outDir) {
610
460
  const pkg = response?.package || response?.bundle || response;
611
461
  if (!pkg || !pkg.files || typeof pkg.files !== "object") throw new Error("Skill package response has no files");
@@ -3350,646 +3200,6 @@ async function runCli(argv) {
3350
3200
  throw new Error(`Unknown command: ${cmd}`);
3351
3201
  }
3352
3202
 
3353
- function send(id, result) {
3354
- process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id, result }) + "\n");
3355
- }
3356
-
3357
- function sendError(id, message) {
3358
- process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id, error: { code: -32000, message } }) + "\n");
3359
- }
3360
-
3361
- function runMcp() {
3362
- process.stdin.setEncoding("utf8");
3363
- let buf = "";
3364
- process.stdin.on("data", chunk => {
3365
- buf += chunk;
3366
- let i;
3367
- while ((i = buf.indexOf("\n")) >= 0) {
3368
- const line = buf.slice(0, i).trim();
3369
- buf = buf.slice(i + 1);
3370
- if (!line) continue;
3371
- handleMcpLine(line).catch(err => sendError(null, err.message));
3372
- }
3373
- });
3374
- }
3375
-
3376
- async function handleMcpLine(line) {
3377
- const msg = JSON.parse(line);
3378
- if (msg.method === "initialize") return send(msg.id, { protocolVersion: "2024-11-05", serverInfo: { name: "agent-id", version: require("../package.json").version } });
3379
- if (msg.method === "tools/list") {
3380
- const tools = [
3381
- { name: "audit_url", description: "Audit a website for SEO/AEO/GEO/Agent readiness.", inputSchema: { type: "object", properties: { url: { type: "string" } }, required: ["url"] } },
3382
- { name: "w1_workflow_router", description: "Route an Agent request to the right executable AEO workflow without overclaiming.", inputSchema: { type: "object", properties: { url: { type: "string" }, intent: { type: "string" }, evidence: { type: "object" } } } },
3383
- { name: "s2_package_review", description: "Return an Agent marketplace review of capabilities, credentials, permissions, metadata consistency, and claim boundaries.", inputSchema: { type: "object", properties: { url: { type: "string" }, public_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3384
- { name: "google_cloud_alignment", description: "Return Google Cloud Enterprise Agent Platform alignment.", inputSchema: { type: "object", properties: {} } },
3385
- { name: "google_agent_identity_bridge", description: "Prepare Google Agent Identity onboarding or validate an unverified effectiveIdentity binding candidate without importing Google credentials.", inputSchema: { type: "object", properties: { twin3_agent_id: { type: "string" }, evidence: { type: "object" } } } },
3386
- { name: "trust_commerce_stack", description: "Return the AgentX.ID Passport, SBT, ERC-8004, x402, ERC-8183, and AP2 architecture plan.", inputSchema: { type: "object", properties: {} } },
3387
- { name: "a1_ai_reads", description: "Ingest or summarize real AI crawler read events from HTTP/CDN logs.", inputSchema: { type: "object", properties: { url: { type: "string" }, events: { type: "array" }, logs: { type: "array" }, user_agent: { type: "string" }, status: { type: "number" } } } },
3388
- { name: "a1_ai_read_dashboard", description: "Summarize A1 AI crawler reads into dashboard KPI cards, provider rows, top paths, and failed reads.", inputSchema: { type: "object", properties: { url: { type: "string" }, events: { type: "array" }, logs: { type: "array" }, period: { type: "object" } } } },
3389
- { name: "a2_ai_citations", description: "Ingest or summarize AI answer probes for citations, mentions, and share-of-voice.", inputSchema: { type: "object", properties: { url: { type: "string" }, target_url: { type: "string" }, probes: { type: "array" }, prompt: { type: "string" }, answer: { type: "string" }, citations: { type: "array" }, engine: { type: "string" }, competitors: { type: "array" } } } },
3390
- { name: "a2_ai_citation_evidence_package", description: "Package imported AI answer probes into reviewable citation evidence files, with optional strict proof URL fetch.", inputSchema: { type: "object", properties: { url: { type: "string" }, probes: { type: "array" }, events: { type: "array" }, probe_set: { type: "object" }, period: { type: "object" }, verify_artifacts: { type: "boolean" } } } },
3391
- { name: "a2_probe_sets", description: "Create stable buyer-question probe sets for comparable monthly AI answer visibility measurement.", inputSchema: { type: "object", properties: { url: { type: "string" }, topics: { type: ["array", "string"] }, engines: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" } }, required: ["url"] } },
3392
- { name: "b1_conversions", description: "Ingest or summarize AI-attributed lead, RFQ, order, and CRM conversion events.", inputSchema: { type: "object", properties: { url: { type: "string" }, events: { type: "array" }, conversions: { type: "array" }, event: { type: "string" }, referrer: { type: "string" }, survey_source: { type: "string" }, value: { type: "number" }, currency: { type: "string" } } } },
3393
- { name: "b1_conversion_evidence_package", description: "Package B1 conversion attribution into reviewable evidence files.", inputSchema: { type: "object", properties: { url: { type: "string" }, events: { type: "array" }, conversions: { type: "array" }, period: { type: "object" } } } },
3394
- { name: "g1_google_official", description: "Ingest or summarize Google PageSpeed / Lighthouse official report evidence.", inputSchema: { type: "object", properties: { url: { type: "string" }, fetch: { type: "boolean" }, report: { type: "object" }, reports: { type: "array" }, result: { type: "object" }, results: { type: "array" } } } },
3395
- { name: "g2_google_delta", description: "Compare before-after Google PageSpeed / Lighthouse snapshots for SEO and Agentic Browsing movement.", inputSchema: { type: "object", properties: { url: { type: "string" }, before: { type: "object" }, after: { type: "object" }, report: { type: "object" }, reports: { type: "array" }, result: { type: "object" }, results: { type: "array" } } } },
3396
- { name: "g3_google_verification_plan", description: "Return a strict PageSpeed / Lighthouse rerun plan for before-after validation.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "boolean" } } } },
3397
- { name: "a0_audit_file_package", description: "Generate one reviewable handoff package with E1/R1/F1/V1/G3/C1/C2 artifacts.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "boolean" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, topics: { type: ["array", "string"] }, engines: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" } } } },
3398
- { name: "s1_skill_package", description: "Generate an installable Skill package with SKILL.md, OpenAPI, MCP, and Agent-readable usage instructions.", inputSchema: { type: "object", properties: { url: { type: "string" }, mode: { type: "string" } } } },
3399
- { name: "s1_skill_package_validation", description: "Validate an S1 Skill package for source-map, OpenAPI, MCP, examples, credentials, and claim-boundary consistency.", inputSchema: { type: "object", properties: { url: { type: "string" }, package: { type: "object" } } } },
3400
- { name: "f1_implementation_bundle", description: "Generate reviewable llms.txt, Agent Card, Schema.org, and WebMCP snippets for a website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "boolean" } } } },
3401
- { name: "e1_evidence_pack", description: "Return deterministic sampled-page evidence details for every SEO/AEO/GEO/AGO audit check.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "object" } } } },
3402
- { name: "v1_installation_verification", description: "Verify deployed F1 files and snippets using audit and E1 evidence.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "object" } } } },
3403
- { name: "c1_content_optimization_plan", description: "Generate answer-first rewrites, schema guidance, citation-gap matrix, and a 30-day content citability plan.", inputSchema: { type: "object", properties: { url: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, audit: { type: "object" } } } },
3404
- { name: "c4_content_workflow_package", description: "Package C1/C2/C3 content workflow outputs into Agent-readable deliverable files with evidence labels.", inputSchema: { type: "object", properties: { url: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, audit: { type: "object" } } } },
3405
- { name: "content_optimization_pack", description: "Bundle C1, C2, C4, and M8 content optimization outputs into one Agent-ready execution pack.", inputSchema: { type: "object", properties: { url: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, audit: { type: "object" }, published_items: { type: "array" }, verify_publication: { type: "boolean" } } } },
3406
- { name: "c5_content_workflow_review", description: "Review a Content Pack or C4 package for complete six-step delivery and evidence-safe claims.", inputSchema: { type: "object", properties: { url: { type: "string" }, content_pack: { type: "object" }, pack: { type: "object" }, content_workflow_package: { type: "object" }, package: { type: "object" }, audit: { type: "object" } } } },
3407
- { name: "m8_content_publication_evidence_package", description: "Track C4 content publication with proof URLs, optional strict HTTP proof fetch, accepted items, rejected items, and pending outputs.", inputSchema: { type: "object", properties: { url: { type: "string" }, content_workflow_package: { type: "object" }, published_items: { type: "array" }, items: { type: "array" }, evidence: { type: "array" }, verify_publication: { type: "boolean" } } } },
3408
- { name: "c1_citation_gap_matrix", description: "Extract a C1 citation-gap matrix without fabricated competitor scores.", inputSchema: { type: "object", properties: { url: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, audit: { type: "object" }, content_plan: { type: "object" } } } },
3409
- { name: "c1_community_citation_plan", description: "Extract a C1 white-hat community citation plan with proof fields and anti-spam guardrails.", inputSchema: { type: "object", properties: { url: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, audit: { type: "object" }, content_plan: { type: "object" } } } },
3410
- { name: "c2_prompt_test_run_sheet", description: "Create a fixed manual AI prompt-test run sheet that imports into A2 citation measurement.", inputSchema: { type: "object", properties: { url: { type: "string" }, content_plan: { type: "object" }, questions: { type: "array" }, topics: { type: ["array", "string"] }, engines: { type: ["array", "string"] }, competitors: { type: "array" }, market: { type: "string" }, cadence: { type: "string" } } } },
3411
- { name: "c3_prompt_test_results_import", description: "Import completed C2 prompt-test rows into A2 citation evidence.", inputSchema: { type: "object", properties: { url: { type: "string" }, sheet: { type: "object" }, rows: { type: "array" }, results: { type: "array" }, completed_rows: { type: "array" } } } },
3412
- { name: "r1_audit_report", description: "Generate a customer-readable SEO/AEO/GEO/AGO audit report and priority action plan.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "object" } } } },
3413
- { name: "o1_optimization_cycle", description: "Return a continuous AEO optimization cycle combining SDK evidence, G3, I1 insights, audit-check job drafts, and M1.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "boolean" } } } },
3414
- { name: "m2_monthly_optimization_package", description: "Return a monthly AEO optimization package combining O1, M1, C4, I1 insights, O1 job drafts, and verification steps.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "boolean" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } } } },
3415
- { name: "m3_monthly_execution_tracker", description: "Return a monthly execution tracker combining M2, job status, content review, blockers, and verification follow-ups.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "boolean" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } } } },
3416
- { name: "m4_monthly_outcome_scorecard", description: "Return a monthly outcome scorecard separating reportable evidence from claim limits.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "boolean" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } } } },
3417
- { name: "m5_monthly_dashboard", description: "Return a monthly dashboard with KPI cards, proof levels, claim limits, and next actions.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "boolean" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } } } },
3418
- { name: "i1_insights", description: "Generate evidence-backed AEO optimization insights from G1/A1/A2/B1 and audit evidence.", inputSchema: { type: "object", properties: { url: { type: "string" }, audit: { type: "object" } } } },
3419
- { name: "i1_job_drafts", description: "Turn standalone I1 optimization insights into scoped AEO job drafts.", inputSchema: { type: "object", properties: { url: { type: "string" }, insights: { type: "object" }, audit: { type: "object" }, provider: { type: "string" }, evaluator: { type: "string" }, currency: { type: "string" } } } },
3420
- { name: "aeo_job_drafts", description: "Turn failed audit checks and Agentic Browsing gaps into scoped AEO job drafts.", inputSchema: { type: "object", properties: { url: { type: "string" }, provider: { type: "string" }, evaluator: { type: "string" }, currency: { type: "string" }, audit: { type: "object" } } } },
3421
- { name: "aeo_job_accept_draft", description: "Accept an AEO job draft into the job ledger without funding it.", inputSchema: { type: "object", properties: { draft: { type: "object" }, create_payload: { type: "object" }, provider: { type: "string" }, evaluator: { type: "string" }, currency: { type: "string" }, budget: { type: "number" } } } },
3422
- { name: "aeo_job_create", description: "Create an ERC-8183-style AEO delivery job.", inputSchema: { type: "object", properties: { url: { type: "string" }, job_type: { type: "string" }, provider: { type: "string" }, evaluator: { type: "string" }, budget: { type: "number" }, currency: { type: "string" } }, required: ["url"] } },
3423
- { name: "aeo_job_fund", description: "Mark an AEO delivery job as funded.", inputSchema: { type: "object", properties: { job_id: { type: "string" }, payment_reference: { type: "string" } }, required: ["job_id"] } },
3424
- { name: "aeo_job_payment_quote", description: "Return an x402-style payment requirement for an open AEO job.", inputSchema: { type: "object", properties: { job_id: { type: "string" } }, required: ["job_id"] } },
3425
- { name: "aeo_job_payment_proof", description: "Accept a payment proof hash and mark an open AEO job as funded.", inputSchema: { type: "object", properties: { job_id: { type: "string" }, payment_proof: { type: "object" }, payment_signature: { type: "string" } }, required: ["job_id"] } },
3426
- { name: "aeo_job_submit", description: "Submit an AEO delivery job by deliverable hash or URI.", inputSchema: { type: "object", properties: { job_id: { type: "string" }, provider: { type: "string" }, deliverable_uri: { type: "string" }, deliverable: { type: "object" } }, required: ["job_id"] } },
3427
- { name: "aeo_job_evaluate", description: "Complete or reject an AEO delivery job.", inputSchema: { type: "object", properties: { job_id: { type: "string" }, evaluator: { type: "string" }, decision: { type: "string" }, reason: { type: "string" } }, required: ["job_id"] } },
3428
- { name: "get_pricing", description: "Return machine-readable plans and checkout endpoint.", inputSchema: { type: "object", properties: {} } },
3429
- { name: "agent_billing_guide", description: "Return free routes, paid routes, checkout intents, and x402-style job payment boundaries.", inputSchema: { type: "object", properties: {} } },
3430
- { name: "marketplace_submission_pack", description: "Return an Agent Store / registry submission pack with listing metadata, attachments, validation, billing boundaries, and non-claims.", inputSchema: { type: "object", properties: { url: { type: "string" }, public_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3431
- { name: "marketplace_readiness_score", description: "Score Agent Store / registry submission readiness and list blockers without claiming marketplace approval.", inputSchema: { type: "object", properties: { url: { type: "string" }, submission: { type: "object" }, public_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3432
- { name: "marketplace_approval_receipts", description: "Read or submit real marketplace approval receipts with claim boundaries.", inputSchema: { type: "object", properties: { url: { type: "string" }, platform_id: { type: "string" }, status: { type: "string" }, listing_url: { type: "string" }, platform_receipt_id: { type: "string" }, proof_url: { type: "string" } } } },
3433
- { name: "google_marketplace_agent_card", description: "Return a Google Cloud Marketplace-oriented A2A Agent Card candidate.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" } } } },
3434
- { name: "google_marketplace_submission_pack", description: "Return Google Cloud Marketplace AI Agent submission materials.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3435
- { name: "google_marketplace_readiness_score", description: "Score Google Cloud Marketplace readiness and list onboarding blockers.", inputSchema: { type: "object", properties: { url: { type: "string" }, submission: { type: "object" }, product_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3436
- { name: "google_marketplace_pricing_pack", description: "Return Google Cloud Marketplace AI Agent pricing review material.", inputSchema: { type: "object", properties: {} } },
3437
- { name: "google_marketplace_develop_flow_gate", description: "Map Google's Marketplace develop flow to AgentX evidence files and blockers.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, product_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3438
- { name: "google_marketplace_listing_requirements_gate", description: "Track Google Cloud Marketplace base listing requirements evidence before Producer Portal submission.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3439
- { name: "google_marketplace_listing_pack", description: "Return Google Cloud Marketplace AI Agent product details and listing metadata.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" } } } },
3440
- { name: "google_marketplace_discovery_metadata_gate", description: "Validate explicit Google Marketplace AI discovery metadata before Product details review.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" } } } },
3441
- { name: "google_marketplace_technical_integration_pack", description: "Return Google Cloud Marketplace technical integration review material for Pub/Sub, Partner Procurement API, account linking, entitlement handling, and Service Control boundaries.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3442
- { name: "google_marketplace_backend_gate", description: "Gate executable Google Marketplace backend evidence for JWT verification, Pub/Sub, account approval, entitlement lifecycle, and usage reporting.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3443
- { name: "google_marketplace_lifecycle_smoke", description: "Run a local Google Marketplace procurement lifecycle smoke test.", inputSchema: { type: "object", properties: { url: { type: "string" }, provider_id: { type: "string" }, account_id: { type: "string" }, entitlement_id: { type: "string" } } } },
3444
- { name: "google_marketplace_runtime_smoke", description: "Run one local Google Marketplace runtime smoke across account linking, procurement lifecycle, and usage-reporting dry-run gates.", inputSchema: { type: "object", properties: { url: { type: "string" }, provider_id: { type: "string" }, account_id: { type: "string" }, entitlement_id: { type: "string" }, pricing_model: { type: "string" } } } },
3445
- { name: "google_marketplace_runtime_receipt", description: "Generate a server-attested runtime receipt from a verified Google Marketplace JWT, Pub/Sub, Procurement API, or Service Control signal.", inputSchema: { type: "object", properties: { url: { type: "string" }, evidence_type: { type: "string" }, evidence: { type: "object" }, jwt: { type: "string" }, token_context: { type: "object" }, expected_audience: { type: "string" }, expected_email: { type: "string" }, certs: { type: "object" }, payload: { type: "object" }, execution: { type: "object" }, store: { type: "boolean" }, pricing_metadata: { type: "object" } } } },
3446
- { name: "google_marketplace_runtime_evidence_ledger", description: "Store redacted Google Marketplace runtime receipts and materialize them for the strict runtime evidence gate.", inputSchema: { type: "object", properties: { url: { type: "string" }, receipt: { type: "object" }, receipts: { type: "array" }, pricing_metadata: { type: "object" } } } },
3447
- { name: "google_marketplace_runtime_evidence_gate", description: "Gate real Google Marketplace runtime evidence separately from local synthetic smoke before technical review.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3448
- { name: "google_marketplace_test_billing_gate", description: "Track Google Marketplace test billing, preview, purchase-flow, and usage evidence.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3449
- { name: "google_marketplace_agent_card_validation_gate", description: "Track Google Marketplace Agent Card same-project Cloud Storage upload and Producer Portal Save and Validate evidence.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3450
- { name: "google_marketplace_agent_card_gcs_upload_pack", description: "Prepare the Google Marketplace Agent Card same-project Cloud Storage upload pack.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3451
- { name: "google_marketplace_product_details_review_gate", description: "Track Google Marketplace Product details completeness and Google review approval evidence.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" }, setup_metadata: { type: "object" } } } },
3452
- { name: "google_marketplace_review_bundle", description: "Export Google Marketplace review files for Producer Portal, Agent Card upload, pricing review, technical integration review, and Partner Engineer handoff.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" }, setup_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3453
- { name: "google_marketplace_review_index", description: "Map Google Marketplace review areas to files, endpoints, commands, evidence keys, and claim boundaries.", inputSchema: { type: "object", properties: { url: { type: "string" }, product_metadata: { type: "object" }, setup_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3454
- { name: "google_marketplace_core_technology_source_map", description: "Map core product capabilities to International AEO, GTMC AEO, and Google Marketplace-specific implementation sources.", inputSchema: { type: "object", properties: { url: { type: "string" } } } },
3455
- { name: "google_marketplace_application_status", description: "Track Google Marketplace external evidence, review readiness, publish readiness, and non-claims.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, product_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3456
- { name: "google_marketplace_application_evidence", description: "Persist Google Marketplace application evidence and recompute the external review gate.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, product_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3457
- { name: "google_marketplace_partner_application_gate", description: "Track Google Partner, vendor, and Producer Portal access evidence before product configuration.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" } } } },
3458
- { name: "google_marketplace_operations_gate", description: "Track Google Marketplace Producer Portal IAM, test billing account, and App Lifecycle Manager readiness.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" } } } },
3459
- { name: "google_marketplace_ops_identity_gate", description: "Track Google Marketplace IAM roles, restricted API access, service accounts, App Lifecycle Manager, and usage-reporting identity evidence.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3460
- { name: "google_marketplace_cloud_run_deployment_gate", description: "Track Cloud Run runtime evidence, public Agent endpoints, service identity, and metadata token sources before Google technical review.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3461
- { name: "google_marketplace_live_surface_gate", description: "Fetch the public HTTPS Agent runtime and verify Google Marketplace reviewer surfaces are reachable.", inputSchema: { type: "object", properties: { url: { type: "string" } } } },
3462
- { name: "google_marketplace_preflight_check", description: "Run one strict Google Marketplace preflight before Producer Portal submit-for-review.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, product_metadata: { type: "object" }, pricing_metadata: { type: "object" } } } },
3463
- { name: "google_marketplace_publish_gate", description: "Track Google Marketplace publish evidence before claiming public availability.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" } } } },
3464
- { name: "google_marketplace_review_receipt_gate", description: "Track external Google and Producer Portal review receipts before submission or publication claims.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" } } } },
3465
- { name: "google_marketplace_evidence_template", description: "Generate a fillable Google Marketplace application evidence template for operators.", inputSchema: { type: "object", properties: {} } },
3466
- { name: "google_marketplace_evidence_example", description: "Generate an example-only Google Marketplace evidence starter file for operators.", inputSchema: { type: "object", properties: {} } },
3467
- { name: "google_marketplace_procurement_event", description: "Normalize a Google Marketplace Pub/Sub procurement event and return a non-executing action plan.", inputSchema: { type: "object", properties: { procurement_event: { type: "object" } } } },
3468
- { name: "google_marketplace_procurement_execute", description: "Execute one explicit Google Partner Procurement API action only when execute=true and server-side OAuth is configured.", inputSchema: { type: "object", properties: { action: { type: "object" }, execute: { type: "boolean" } }, required: ["action"] } },
3469
- { name: "google_marketplace_procurement_state", description: "Read local Google Marketplace procurement state and pending actions.", inputSchema: { type: "object", properties: {} } },
3470
- { name: "google_marketplace_usage_report_payload", description: "Build a Google Service Control usage-report payload for usage or combined pricing.", inputSchema: { type: "object", properties: { service_name: { type: "string" }, usage_reporting_id: { type: "string" }, metric_name: { type: "string" }, metric_value: { type: ["number", "string"] }, start_time: { type: "string" }, end_time: { type: "string" }, operation_id: { type: "string" }, user_labels: { type: "object" } } } },
3471
- { name: "google_marketplace_usage_report_execute", description: "Execute Service Control check/report only when execute=true and server-side OAuth is configured.", inputSchema: { type: "object", properties: { payload: { type: "object" }, execute: { type: "boolean" } }, required: ["payload"] } },
3472
- { name: "google_marketplace_frontend_integration", description: "Return Google Marketplace sign-up/login URLs and JWT verification requirements.", inputSchema: { type: "object", properties: {} } },
3473
- { name: "google_marketplace_account_link", description: "Validate Google Marketplace account-linking input and return a non-executing approval plan.", inputSchema: { type: "object", properties: { jwt: { type: "string" }, claims: { type: "object" }, signature_verified: { type: "boolean" }, expected_audience: { type: "string" } } } },
3474
- { name: "google_marketplace_jwt_verifier_gate", description: "Track Google Marketplace x-gcp-marketplace-token verifier evidence before account linking.", inputSchema: { type: "object", properties: { url: { type: "string" }, setup_metadata: { type: "object" }, jwt: { type: "string" }, token_context: { type: "object" } } } },
3475
- { name: "agent_checkout", description: "Create a checkout session for a paid AEO Agent plan.", inputSchema: { type: "object", properties: { plan: { type: "string" } }, required: ["plan"] } },
3476
- { name: "self_audit", description: "Audit this service's own Agent-first surfaces.", inputSchema: { type: "object", properties: {} } },
3477
- { name: "get_health", description: "Return this service's Agent-first health state.", inputSchema: { type: "object", properties: {} } },
3478
- { name: "self_backlog", description: "Generate this service's self-optimization backlog.", inputSchema: { type: "object", properties: {} } },
3479
- { name: "agentx_passport", description: "Return this service's AgentX.ID Passport.", inputSchema: { type: "object", properties: {} } },
3480
- { name: "proof_graph", description: "Return the proof graph behind the AgentX.ID Passport.", inputSchema: { type: "object", properties: {} } },
3481
- { name: "outcome_report", description: "Return the combined M1 AEO outcome report across G2, A1, A2, B1, and jobs.", inputSchema: { type: "object", properties: { url: { type: "string" } } } },
3482
- { name: "m1_outcome_evidence_package", description: "Return a reviewable M1 outcome evidence package across Google, A1, A2, B1, and jobs.", inputSchema: { type: "object", properties: { url: { type: "string" }, a2_citation_package: { type: "object" } } } },
3483
- { name: "a1_ai_read_evidence_package", description: "Package A1 AI crawler log evidence into reviewable files.", inputSchema: { type: "object", properties: { url: { type: "string" }, events: { type: "array" }, logs: { type: "array" }, period: { type: "object" } } } },
3484
- { name: "site_agent_install_guide", description: "Return the public no-side-effect Site Agent installation guide.", inputSchema: { type: "object", properties: { url: { type: "string" } } } },
3485
- { name: "site_agent_install_descriptor", description: "Return the verified website agent's private install descriptor, including browser SDK install payload.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" } }, required: ["url", "agent_key"] } },
3486
- { name: "register_site_agent", description: "Register a website and return a domain ownership challenge.", inputSchema: { type: "object", properties: { url: { type: "string" }, email: { type: "string" } }, required: ["url"] } },
3487
- { name: "verify_domain_ownership", description: "Verify DNS TXT, well-known JSON, or HTML meta proof and issue the Site Agent Key.", inputSchema: { type: "object", properties: { url: { type: "string" }, method: { type: "string" } }, required: ["url"] } },
3488
- { name: "site_agent_actions", description: "Read the machine-readable Site Agent action catalog.", inputSchema: { type: "object", properties: {} } },
3489
- { name: "site_agent_insights", description: "Generate private I1 optimization insights for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" } }, required: ["url", "agent_key"] } },
3490
- { name: "site_agent_insights_feed", description: "Return a compact private insights feed for an installed website agent to poll.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, period: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, engines: { type: ["array", "string"] }, a2_citation_package: { type: "object" } }, required: ["url", "agent_key"] } },
3491
- { name: "site_agent_apply_plan", description: "Return a private apply plan that turns the insights feed into CMS, worker, or repo PR execution routes.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, period: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, engines: { type: ["array", "string"] }, a2_citation_package: { type: "object" }, feed: { type: "object" }, delivery_targets: { type: "array" } }, required: ["url", "agent_key"] } },
3492
- { name: "site_agent_apply_evidence", description: "Submit proof that an apply-plan item was executed into the shared AEO job ledger.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, action: { type: "string", const: "apply_evidence" }, apply_item_id: { type: "string" }, apply_item: { type: "object" }, apply_plan: { type: "object" }, job_id: { type: "string" }, evidence_uri: { type: "string" }, proof_url: { type: "string" }, pull_request_url: { type: "string" }, deployment_reference: { type: "string" }, verify_proof: { type: "boolean" }, verify: { type: "boolean" }, evidence: { type: "object" } }, required: ["url", "agent_key", "action", "apply_item_id"] } },
3493
- { name: "site_agent_outcome_report", description: "Return the verified website agent's private M1 outcome report.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" } }, required: ["url", "agent_key"] } },
3494
- { name: "site_agent_optimization_cycle", description: "Return the verified website agent's private O1 continuous optimization cycle with audit checks merged into the O1 job queue.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" } }, required: ["url", "agent_key"] } },
3495
- { name: "site_agent_audit_file_package", description: "Return a private A0 audit file package with evidence, report, implementation files, content work, and verification steps.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, topics: { type: ["array", "string"] }, engines: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" } }, required: ["url", "agent_key"] } },
3496
- { name: "site_agent_skill_package", description: "Return a private S1 installable Skill package for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, mode: { type: "string" } }, required: ["url", "agent_key"] } },
3497
- { name: "site_agent_implementation_bundle", description: "Return private F1 implementation files and snippets for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" } }, required: ["url", "agent_key"] } },
3498
- { name: "site_agent_installation_verification", description: "Verify private V1 installation status for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" } }, required: ["url", "agent_key"] } },
3499
- { name: "site_agent_content_optimization_plan", description: "Generate private C1 answer-first rewrites, schema guidance, citation gaps, and 30-day plan.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, action: { type: "string", const: "content_optimization_plan" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, audit_url: { type: "boolean" }, audit: { type: "object" } }, required: ["url", "agent_key", "action"] } },
3500
- { name: "site_agent_content_workflow_package", description: "Return a private C4 agent-ready content workflow package with deliverable files and evidence labels.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" } }, required: ["url", "agent_key"] } },
3501
- { name: "site_agent_content_repair_pack", description: "Return a private C6 content repair package from C5 review items.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, review_gate: { type: "object" }, c5_repair_history: { type: "object" }, history: { type: "object" }, content_pack: { type: "object" }, content_workflow_package: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" } }, required: ["url", "agent_key"] } },
3502
- { name: "site_agent_content_pack", description: "Return one private Agent-ready Content Pack bundling C1, C2, C4, M8, evidence labels, and claim boundaries.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, published_items: { type: "array" }, verify_publication: { type: "boolean" } }, required: ["url", "agent_key"] } },
3503
- { name: "site_agent_content_publication_package", description: "Return a private M8 content publication evidence package for C4 outputs, proof URLs, and optional strict HTTP proof fetch.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, content_workflow_package: { type: "object" }, published_items: { type: "array" }, items: { type: "array" }, evidence: { type: "array" }, verify_publication: { type: "boolean" }, audit_url: { type: "boolean" }, audit: { type: "object" } }, required: ["url", "agent_key"] } },
3504
- { name: "site_agent_a1_read_evidence_package", description: "Return a private A1 AI crawler read evidence package for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, events: { type: "array" }, logs: { type: "array" }, period: { type: "object" } }, required: ["url", "agent_key"] } },
3505
- { name: "site_agent_a1_dashboard", description: "Return a private A1 AI crawler read dashboard with provider, path, status, and failure KPIs.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, events: { type: "array" }, logs: { type: "array" }, source: { type: "string" }, period: { type: "object" } }, required: ["url", "agent_key"] } },
3506
- { name: "site_agent_site_signal_package", description: "Return a private S1 site signal evidence package from observed SDK or connector page-structure signals.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, events: { type: "array" }, sdk_events: { type: "array" }, period: { type: "object" }, source: { type: "string" } }, required: ["url", "agent_key"] } },
3507
- { name: "site_agent_a2_citation_evidence_package", description: "Return a private A2 AI answer citation evidence package for the verified website agent, with optional strict proof URL fetch.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, action: { type: "string", const: "a2_citation_evidence_package" }, probes: { type: "array" }, events: { type: "array" }, probe_set: { type: "object" }, period: { type: "object" }, verify_artifacts: { type: "boolean" } }, required: ["url", "agent_key", "action"] } },
3508
- { name: "site_agent_b1_conversion_evidence_package", description: "Return a private B1 conversion evidence package for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, events: { type: "array" }, conversions: { type: "array" }, period: { type: "object" } }, required: ["url", "agent_key"] } },
3509
- { name: "site_agent_m1_outcome_evidence_package", description: "Return a private M1 outcome evidence package for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, period: { type: "object" }, a2_citation_package: { type: "object" } }, required: ["url", "agent_key"] } },
3510
- { name: "site_agent_m2_monthly_optimization_package", description: "Return a private M2 monthly optimization package for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, period: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } }, required: ["url", "agent_key"] } },
3511
- { name: "site_agent_m3_monthly_execution_tracker", description: "Return a private M3 execution tracker for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, period: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } }, required: ["url", "agent_key"] } },
3512
- { name: "site_agent_m4_monthly_outcome_scorecard", description: "Return a private M4 outcome scorecard for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, period: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } }, required: ["url", "agent_key"] } },
3513
- { name: "site_agent_m5_monthly_dashboard", description: "Return a private M5 dashboard for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, period: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } }, required: ["url", "agent_key"] } },
3514
- { name: "site_agent_monthly_evidence_loop", description: "Run one private monthly workflow: Content Pack, C5 review, M2 package, M3 tracker, M4 scorecard, and M5 dashboard.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, audit: { type: "object" }, period: { type: "object" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, engines: { type: ["array", "string"] }, topics: { type: ["array", "string"] }, market: { type: "string" }, cadence: { type: "string" }, content_pack: { type: "object" }, content_publication_package: { type: "object" }, a2_citation_package: { type: "object" } }, required: ["url", "agent_key"] } },
3515
- { name: "site_agent_citation_gap_matrix", description: "Return a private C1 citation-gap matrix without fabricated competitor scores.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, audit_url: { type: "boolean" }, audit: { type: "object" }, content_plan: { type: "object" } }, required: ["url", "agent_key"] } },
3516
- { name: "site_agent_community_citation_plan", description: "Return a private C1 white-hat community citation plan with proof fields and anti-spam guardrails.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, content: { type: "string" }, page: { type: "object" }, questions: { type: "array" }, competitors: { type: "array" }, audit_url: { type: "boolean" }, audit: { type: "object" }, content_plan: { type: "object" } }, required: ["url", "agent_key"] } },
3517
- { name: "site_agent_prompt_test_run_sheet", description: "Create a private C2 prompt-test run sheet for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, content_plan: { type: "object" }, questions: { type: "array" }, topics: { type: ["array", "string"] }, engines: { type: ["array", "string"] }, competitors: { type: "array" }, market: { type: "string" }, cadence: { type: "string" } }, required: ["url", "agent_key"] } },
3518
- { name: "site_agent_prompt_test_results_import", description: "Import private C3 completed prompt-test rows for the verified website agent.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, sheet: { type: "object" }, rows: { type: "array" }, results: { type: "array" }, completed_rows: { type: "array" } }, required: ["url", "agent_key"] } },
3519
- { name: "site_agent_job_drafts", description: "Create scoped AEO job drafts from I1 insights, audit checks, or C5 repair items for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, audit_url: { type: "boolean" }, insights: { type: "object" }, audit: { type: "object" }, provider: { type: "string" }, evaluator: { type: "string" }, currency: { type: "string" } }, required: ["url", "agent_key"] } },
3520
- { name: "site_agent_accept_job_draft", description: "Accept one of the verified website agent's own drafts into the AEO job ledger.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, draft: { type: "object" }, create_payload: { type: "object" }, provider: { type: "string" }, evaluator: { type: "string" }, currency: { type: "string" }, budget: { type: "number" } }, required: ["url", "agent_key"] } },
3521
- { name: "site_agent_decide_job_draft", description: "Record accept, defer, or reject for the verified website agent's own draft. Defer and reject do not start work.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, decision: { type: "string", enum: ["accept", "defer", "reject"] }, draft: { type: "object" }, draft_id: { type: "string" }, create_payload: { type: "object" }, reason: { type: "string" }, provider: { type: "string" }, evaluator: { type: "string" }, currency: { type: "string" }, budget: { type: "number" } }, required: ["url", "agent_key", "decision"] } },
3522
- { name: "site_agent_draft_decisions", description: "List draft decision receipts for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, decision: { type: "string" }, draft_id: { type: "string" } }, required: ["url", "agent_key"] } },
3523
- { name: "site_agent_decision_reviews", description: "List owner apply-plan decision review receipts for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, decision: { type: "string" }, apply_item_id: { type: "string" }, item_id: { type: "string" } }, required: ["url", "agent_key"] } },
3524
- { name: "site_agent_jobs", description: "List redacted AEO job records for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" } }, required: ["url", "agent_key"] } },
3525
- { name: "jobbank_company", description: "Read the verified website's own source-backed LEI candidates and public TaiwanJobs summaries. Returns no Human ID or person/candidate data.", inputSchema: { type: "object", properties: { url: { type: "string", format: "uri" }, agent_key: { type: "string", writeOnly: true }, registration_id: { type: "string", pattern: "^[0-9]{8}$" }, source_employer_id: { type: "string", pattern: "^[0-9]{1,20}$" }, job_limit: { type: "integer", minimum: 1, maximum: 50, default: 50 }, include_jobs: { type: "boolean", default: true } }, required: ["url", "agent_key"], additionalProperties: false } },
3526
- { name: "company_card_resolve", description: "Resolve one exact Taiwan registration/company ID to an unclaimed public company-card URL. This is not a company directory or candidate search.", inputSchema: { type: "object", properties: { registration_id: { type: "string", pattern: "^[0-9]{8}$" }, company_id: { type: "string", pattern: "^TW:RA000551:[0-9]{8}$" } }, anyOf: [{ required: ["registration_id"] }, { required: ["company_id"] }], additionalProperties: false } },
3527
- { name: "site_agent_c5_repair_history", description: "Return redacted C5 content repair history for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" } }, required: ["url", "agent_key"] } },
3528
- { name: "site_agent_report_job_evidence", description: "Attach implementation evidence to one of the verified website agent's own jobs.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, action: { type: "string", const: "report_job_evidence" }, job_id: { type: "string" }, evidence_uri: { type: "string" }, evidence: { type: "object" } }, required: ["url", "agent_key", "action", "job_id"] } },
3529
- { name: "site_agent_call", description: "Call twin3 with an installed Site Agent Key.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, action: { type: "string" } }, required: ["url", "agent_key"] } }
3530
- ];
3531
- return send(msg.id, { tools: withSiteAgentFixedActionSchemas(tools) });
3532
- }
3533
- if (msg.method === "tools/call") {
3534
- const name = msg.params?.name;
3535
- const args = msg.params?.arguments || {};
3536
- if (name === "audit_url") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/audit", args), null, 2) }] });
3537
- if (name === "w1_workflow_router") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/workflow_router", args), null, 2) }] });
3538
- if (name === "s2_package_review") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/package_review", args), null, 2) }] });
3539
- if (name === "google_cloud_alignment") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/google_alignment"), null, 2) }] });
3540
- if (name === "google_agent_identity_bridge") {
3541
- const out = args.evidence
3542
- ? await post("/api/agent/google_identity_bridge", args)
3543
- : await get(`/api/agent/google_identity_bridge?twin3_agent_id=${encodeURIComponent(args.twin3_agent_id || "agt_0000")}`);
3544
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3545
- }
3546
- if (name === "trust_commerce_stack") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/trust_stack"), null, 2) }] });
3547
- if (name === "a1_ai_reads") {
3548
- const hasEvents = Array.isArray(args.events) || Array.isArray(args.logs) || args.user_agent;
3549
- const out = hasEvents ? await post("/api/agent/a1_reads", args) : await get(args.url ? `/api/agent/a1_reads?url=${encodeURIComponent(args.url)}` : "/api/agent/a1_reads");
3550
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3551
- }
3552
- if (name === "a1_ai_read_dashboard") {
3553
- const hasEvents = Array.isArray(args.events) || Array.isArray(args.logs) || args.user_agent;
3554
- const out = hasEvents ? await post("/api/agent/a1_dashboard", args) : await get(args.url ? `/api/agent/a1_dashboard?url=${encodeURIComponent(args.url)}` : "/api/agent/a1_dashboard");
3555
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3556
- }
3557
- if (name === "a1_ai_read_evidence_package") {
3558
- const hasEvents = Array.isArray(args.events) || Array.isArray(args.logs) || args.user_agent;
3559
- const out = hasEvents ? await post("/api/agent/a1_read_package", args) : await get(args.url ? `/api/agent/a1_read_package?url=${encodeURIComponent(args.url)}` : "/api/agent/a1_read_package");
3560
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3561
- }
3562
- if (name === "a2_ai_citations") {
3563
- const hasProbes = Array.isArray(args.probes) || args.prompt || args.answer || Array.isArray(args.citations);
3564
- const out = hasProbes ? await post("/api/agent/a2_citations", args) : await get(args.url ? `/api/agent/a2_citations?url=${encodeURIComponent(args.url)}` : "/api/agent/a2_citations");
3565
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3566
- }
3567
- if (name === "a2_ai_citation_evidence_package") {
3568
- const hasProbes = Array.isArray(args.probes) || Array.isArray(args.events) || args.prompt || args.answer;
3569
- const out = hasProbes ? await post("/api/agent/a2_citation_package", args) : await get(args.url ? `/api/agent/a2_citation_package?url=${encodeURIComponent(args.url)}` : "/api/agent/a2_citation_package");
3570
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3571
- }
3572
- if (name === "a2_probe_sets") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/a2_probe_sets", args), null, 2) }] });
3573
- if (name === "b1_conversions") {
3574
- const hasEvents = Array.isArray(args.events) || Array.isArray(args.conversions) || args.event || args.referrer || args.survey_source || args.value;
3575
- const out = hasEvents ? await post("/api/agent/b1_conversions", args) : await get(args.url ? `/api/agent/b1_conversions?url=${encodeURIComponent(args.url)}` : "/api/agent/b1_conversions");
3576
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3577
- }
3578
- if (name === "b1_conversion_evidence_package") {
3579
- const hasEvents = Array.isArray(args.events) || Array.isArray(args.conversions);
3580
- const out = hasEvents ? await post("/api/agent/b1_conversion_package", args) : await get(args.url ? `/api/agent/b1_conversion_package?url=${encodeURIComponent(args.url)}` : "/api/agent/b1_conversion_package");
3581
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3582
- }
3583
- if (name === "g1_google_official") {
3584
- const hasReports = Array.isArray(args.reports) || Array.isArray(args.results) || args.report || args.result || args.lighthouseResult;
3585
- const fetchFlag = args.fetch ? "&fetch=1" : "";
3586
- const out = hasReports ? await post("/api/agent/g1_google_official", args) : await get(args.url ? `/api/agent/g1_google_official?url=${encodeURIComponent(args.url)}${fetchFlag}` : "/api/agent/g1_google_official");
3587
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3588
- }
3589
- if (name === "g2_google_delta") {
3590
- const hasReports = Array.isArray(args.reports) || Array.isArray(args.results) || args.before || args.after || args.report || args.result;
3591
- const out = hasReports ? await post("/api/agent/g2_google_delta", args) : await get(args.url ? `/api/agent/g2_google_delta?url=${encodeURIComponent(args.url)}` : "/api/agent/g2_google_delta");
3592
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3593
- }
3594
- if (name === "g3_google_verification_plan") {
3595
- const auditFlag = args.audit ? "&audit=1" : "";
3596
- const out = await get(args.url ? `/api/agent/g3_google_verification_plan?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/g3_google_verification_plan");
3597
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3598
- }
3599
- if (name === "a0_audit_file_package") {
3600
- const hasBody = args.content || args.page || args.questions || args.competitors || args.topics || args.engines;
3601
- const auditFlag = args.audit ? "&audit=1" : "";
3602
- const out = hasBody ? await post("/api/agent/audit_file_package", args) : await get(args.url ? `/api/agent/audit_file_package?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/audit_file_package");
3603
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3604
- }
3605
- if (name === "s1_skill_package") {
3606
- const out = args.mode ? await post("/api/agent/skill_package", args) : await get(args.url ? `/api/agent/skill_package?url=${encodeURIComponent(args.url)}` : "/api/agent/skill_package");
3607
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3608
- }
3609
- if (name === "s1_skill_package_validation") {
3610
- const out = args.package ? await post("/api/agent/skill_package_validate", args) : await get(args.url ? `/api/agent/skill_package_validate?url=${encodeURIComponent(args.url)}` : "/api/agent/skill_package_validate");
3611
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3612
- }
3613
- if (name === "marketplace_submission_pack") {
3614
- const hasBody = args.public_metadata || args.setup_metadata || args.public || args.setup;
3615
- const out = hasBody ? await post("/api/agent/marketplace_submission", args) : await get(args.url ? `/api/agent/marketplace_submission?url=${encodeURIComponent(args.url)}` : "/api/agent/marketplace_submission");
3616
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3617
- }
3618
- if (name === "marketplace_readiness_score") {
3619
- const hasBody = args.submission || args.pack || args.public_metadata || args.setup_metadata || args.public || args.setup;
3620
- const out = hasBody ? await post("/api/agent/marketplace_readiness", args) : await get(args.url ? `/api/agent/marketplace_readiness?url=${encodeURIComponent(args.url)}` : "/api/agent/marketplace_readiness");
3621
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3622
- }
3623
- if (name === "marketplace_approval_receipts") {
3624
- const hasBody = args.platform_id || args.platform || args.listing_url || args.platform_receipt_id || args.proof_url || args.evidence_url;
3625
- const out = hasBody ? await post("/api/agent/marketplace_approval_receipts", args) : await get(args.url ? `/api/agent/marketplace_approval_receipts?url=${encodeURIComponent(args.url)}` : "/api/agent/marketplace_approval_receipts");
3626
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3627
- }
3628
- if (name === "google_marketplace_agent_card") {
3629
- const hasBody = args.product_metadata || args.product || args.public_metadata;
3630
- const out = hasBody ? await post("/api/agent/google_marketplace_agent_card", args) : await get(args.url ? `/api/agent/google_marketplace_agent_card?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_agent_card");
3631
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3632
- }
3633
- if (name === "google_marketplace_submission_pack") {
3634
- const hasBody = args.product_metadata || args.setup_metadata || args.product || args.setup || args.public_metadata;
3635
- const out = hasBody ? await post("/api/agent/google_marketplace_submission", args) : await get(args.url ? `/api/agent/google_marketplace_submission?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_submission");
3636
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3637
- }
3638
- if (name === "google_marketplace_readiness_score") {
3639
- const hasBody = args.submission || args.pack || args.product_metadata || args.setup_metadata || args.product || args.setup || args.public_metadata;
3640
- const out = hasBody ? await post("/api/agent/google_marketplace_readiness", args) : await get(args.url ? `/api/agent/google_marketplace_readiness?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_readiness");
3641
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3642
- }
3643
- if (name === "google_marketplace_pricing_pack") {
3644
- const out = await get("/api/agent/google_marketplace_pricing");
3645
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3646
- }
3647
- if (name === "google_marketplace_develop_flow_gate") {
3648
- const hasBody = args.setup_metadata || args.product_metadata || args.pricing_metadata || args.setup || args.product || args.pricing;
3649
- const out = hasBody ? await post("/api/agent/google_marketplace_develop_flow_gate", args) : await get(args.url ? `/api/agent/google_marketplace_develop_flow_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_develop_flow_gate");
3650
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3651
- }
3652
- if (name === "google_marketplace_listing_requirements_gate") {
3653
- const hasBody = args.product_metadata || args.setup_metadata || args.product || args.setup || args.public_metadata;
3654
- const out = hasBody ? await post("/api/agent/google_marketplace_listing_requirements_gate", args) : await get(args.url ? `/api/agent/google_marketplace_listing_requirements_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_listing_requirements_gate");
3655
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3656
- }
3657
- if (name === "google_marketplace_listing_pack") {
3658
- const hasBody = args.product_metadata || args.product || args.public_metadata;
3659
- const out = hasBody ? await post("/api/agent/google_marketplace_listing", args) : await get("/api/agent/google_marketplace_listing");
3660
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3661
- }
3662
- if (name === "google_marketplace_discovery_metadata_gate") {
3663
- const hasBody = args.product_metadata || args.product || args.public_metadata;
3664
- const out = hasBody ? await post("/api/agent/google_marketplace_discovery_metadata", args) : await get("/api/agent/google_marketplace_discovery_metadata");
3665
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3666
- }
3667
- if (name === "google_marketplace_technical_integration_pack") {
3668
- const hasBody = args.setup_metadata || args.setup || args.pricing_metadata || args.pricing;
3669
- const out = hasBody ? await post("/api/agent/google_marketplace_technical", args) : await get(args.url ? `/api/agent/google_marketplace_technical?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_technical");
3670
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3671
- }
3672
- if (name === "google_marketplace_backend_gate") {
3673
- const hasBody = args.setup_metadata || args.setup || args.pricing_metadata || args.pricing;
3674
- const out = hasBody ? await post("/api/agent/google_marketplace_backend_gate", args) : await get(args.url ? `/api/agent/google_marketplace_backend_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_backend_gate");
3675
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3676
- }
3677
- if (name === "google_marketplace_lifecycle_smoke") {
3678
- const params = new URLSearchParams();
3679
- if (args.url) params.set("url", args.url);
3680
- if (args.provider_id) params.set("provider_id", args.provider_id);
3681
- if (args.account_id) params.set("account_id", args.account_id);
3682
- if (args.entitlement_id) params.set("entitlement_id", args.entitlement_id);
3683
- const out = await get(params.toString() ? `/api/agent/google_marketplace_lifecycle_smoke?${params.toString()}` : "/api/agent/google_marketplace_lifecycle_smoke");
3684
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3685
- }
3686
- if (name === "google_marketplace_runtime_smoke") {
3687
- const params = new URLSearchParams();
3688
- if (args.url) params.set("url", args.url);
3689
- if (args.provider_id) params.set("provider_id", args.provider_id);
3690
- if (args.account_id) params.set("account_id", args.account_id);
3691
- if (args.entitlement_id) params.set("entitlement_id", args.entitlement_id);
3692
- if (args.pricing_model) params.set("pricing_model", args.pricing_model);
3693
- const out = await get(params.toString() ? `/api/agent/google_marketplace_runtime_smoke?${params.toString()}` : "/api/agent/google_marketplace_runtime_smoke");
3694
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3695
- }
3696
- if (name === "google_marketplace_runtime_receipt") {
3697
- const out = await post("/api/agent/google_marketplace_runtime_receipt", args);
3698
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3699
- }
3700
- if (name === "google_marketplace_runtime_evidence_ledger") {
3701
- const hasBody = args.receipt || args.receipts || args.pricing_metadata || args.pricing || args.evidence_kind || args.receipt_type || args.schema;
3702
- const out = hasBody ? await post("/api/agent/google_marketplace_runtime_evidence_ledger", args) : await get(args.url ? `/api/agent/google_marketplace_runtime_evidence_ledger?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_runtime_evidence_ledger");
3703
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3704
- }
3705
- if (name === "google_marketplace_runtime_evidence_gate") {
3706
- const hasBody = args.setup_metadata || args.setup || args.pricing_metadata || args.pricing;
3707
- const out = hasBody ? await post("/api/agent/google_marketplace_runtime_evidence_gate", args) : await get(args.url ? `/api/agent/google_marketplace_runtime_evidence_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_runtime_evidence_gate");
3708
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3709
- }
3710
- if (name === "google_marketplace_test_billing_gate") {
3711
- const hasBody = args.setup_metadata || args.setup || args.pricing_metadata || args.pricing;
3712
- const out = hasBody ? await post("/api/agent/google_marketplace_test_billing_gate", args) : await get(args.url ? `/api/agent/google_marketplace_test_billing_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_test_billing_gate");
3713
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3714
- }
3715
- if (name === "google_marketplace_agent_card_validation_gate") {
3716
- const hasBody = args.setup_metadata || args.setup || args.product_metadata || args.product || args.public_metadata;
3717
- const out = hasBody ? await post("/api/agent/google_marketplace_agent_card_validation_gate", args) : await get(args.url ? `/api/agent/google_marketplace_agent_card_validation_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_agent_card_validation_gate");
3718
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3719
- }
3720
- if (name === "google_marketplace_agent_card_gcs_upload_pack") {
3721
- const hasBody = args.setup_metadata || args.setup || args.product_metadata || args.product || args.public_metadata;
3722
- const out = hasBody ? await post("/api/agent/google_marketplace_agent_card_gcs_pack", args) : await get(args.url ? `/api/agent/google_marketplace_agent_card_gcs_pack?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_agent_card_gcs_pack");
3723
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3724
- }
3725
- if (name === "google_marketplace_product_details_review_gate") {
3726
- const hasBody = args.setup_metadata || args.setup || args.product_metadata || args.product || args.public_metadata;
3727
- const out = hasBody ? await post("/api/agent/google_marketplace_product_details_review_gate", args) : await get(args.url ? `/api/agent/google_marketplace_product_details_review_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_product_details_review_gate");
3728
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3729
- }
3730
- if (name === "google_marketplace_review_bundle") {
3731
- const hasBody = args.product_metadata || args.setup_metadata || args.pricing_metadata || args.product || args.setup || args.pricing || args.public_metadata;
3732
- const out = hasBody ? await post("/api/agent/google_marketplace_review_bundle", args) : await get(args.url ? `/api/agent/google_marketplace_review_bundle?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_review_bundle");
3733
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3734
- }
3735
- if (name === "google_marketplace_review_index") {
3736
- const hasBody = args.product_metadata || args.setup_metadata || args.pricing_metadata || args.product || args.setup || args.pricing || args.public_metadata;
3737
- const out = hasBody ? await post("/api/agent/google_marketplace_review_index", args) : await get(args.url ? `/api/agent/google_marketplace_review_index?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_review_index");
3738
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3739
- }
3740
- if (name === "google_marketplace_core_technology_source_map") {
3741
- const out = await get(args.url ? `/api/agent/google_marketplace_core_source_map?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_core_source_map");
3742
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3743
- }
3744
- if (name === "google_marketplace_application_status") {
3745
- const hasBody = args.setup_metadata || args.product_metadata || args.pricing_metadata || args.setup || args.product || args.pricing || args.public_metadata;
3746
- const out = hasBody ? await post("/api/agent/google_marketplace_application_status", args) : await get("/api/agent/google_marketplace_application_status");
3747
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3748
- }
3749
- if (name === "google_marketplace_application_evidence") {
3750
- const hasBody = args.setup_metadata || args.product_metadata || args.pricing_metadata || args.setup || args.product || args.pricing || args.public_metadata;
3751
- const out = hasBody ? await post("/api/agent/google_marketplace_application_evidence", args) : await get("/api/agent/google_marketplace_application_evidence");
3752
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3753
- }
3754
- if (name === "google_marketplace_partner_application_gate") {
3755
- const hasBody = args.setup_metadata || args.setup || args.project_info_form || args.partner_network || args.vendor_account || args.producer_portal_access || args.producer_portal_product_id;
3756
- const out = hasBody ? await post("/api/agent/google_marketplace_partner_application_gate", args) : await get("/api/agent/google_marketplace_partner_application_gate");
3757
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3758
- }
3759
- if (name === "google_marketplace_operations_gate") {
3760
- const hasBody = args.setup_metadata || args.setup;
3761
- const out = hasBody ? await post("/api/agent/google_marketplace_operations_gate", args) : await get(args.url ? `/api/agent/google_marketplace_operations_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_operations_gate");
3762
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3763
- }
3764
- if (name === "google_marketplace_ops_identity_gate") {
3765
- const hasBody = args.setup_metadata || args.pricing_metadata || args.setup || args.pricing || args.producer_portal_iam || args.partner_procurement_api;
3766
- const out = hasBody ? await post("/api/agent/google_marketplace_ops_identity_gate", args) : await get(args.url ? `/api/agent/google_marketplace_ops_identity_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_ops_identity_gate");
3767
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3768
- }
3769
- if (name === "google_marketplace_cloud_run_deployment_gate") {
3770
- const hasBody = args.setup_metadata || args.pricing_metadata || args.setup || args.pricing || args.cloud_run || args.cloud_run_deployment;
3771
- const out = hasBody ? await post("/api/agent/google_marketplace_cloud_run_deployment_gate", args) : await get(args.url ? `/api/agent/google_marketplace_cloud_run_deployment_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_cloud_run_deployment_gate");
3772
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3773
- }
3774
- if (name === "google_marketplace_live_surface_gate") {
3775
- const out = await get(args.url ? `/api/agent/google_marketplace_live_surface_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_live_surface_gate");
3776
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3777
- }
3778
- if (name === "google_marketplace_preflight_check") {
3779
- const hasBody = args.setup_metadata || args.product_metadata || args.pricing_metadata || args.setup || args.product || args.pricing || args.public_metadata;
3780
- const out = hasBody ? await post("/api/agent/google_marketplace_preflight", args) : await get(args.url ? `/api/agent/google_marketplace_preflight?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_preflight");
3781
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3782
- }
3783
- if (name === "google_marketplace_publish_gate") {
3784
- const hasBody = args.setup_metadata || args.setup;
3785
- const out = hasBody ? await post("/api/agent/google_marketplace_publish_gate", args) : await get(args.url ? `/api/agent/google_marketplace_publish_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_publish_gate");
3786
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3787
- }
3788
- if (name === "google_marketplace_review_receipt_gate") {
3789
- const hasBody = args.setup_metadata || args.setup;
3790
- const out = hasBody ? await post("/api/agent/google_marketplace_review_receipt_gate", args) : await get(args.url ? `/api/agent/google_marketplace_review_receipt_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_review_receipt_gate");
3791
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3792
- }
3793
- if (name === "google_marketplace_evidence_template") {
3794
- const out = await get("/api/agent/google_marketplace_evidence_template");
3795
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3796
- }
3797
- if (name === "google_marketplace_evidence_example") {
3798
- const out = await get("/api/agent/google_marketplace_evidence_example");
3799
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3800
- }
3801
- if (name === "google_marketplace_procurement_event") {
3802
- const payload = args.procurement_event || args.event || args.payload || args;
3803
- const out = await post("/api/agent/google_marketplace_procurement_event", payload);
3804
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3805
- }
3806
- if (name === "google_marketplace_procurement_execute") {
3807
- const out = await post("/api/agent/google_marketplace_procurement_execute", args);
3808
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3809
- }
3810
- if (name === "google_marketplace_procurement_state") {
3811
- const out = await get("/api/agent/google_marketplace_procurement_state");
3812
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3813
- }
3814
- if (name === "google_marketplace_usage_report_payload") {
3815
- const hasBody = args.service_name || args.usage_reporting_id || args.metric_name || args.metric_value || args.start_time || args.end_time || args.operation_id || args.user_labels;
3816
- const out = hasBody ? await post("/api/agent/google_marketplace_usage_report_payload", args) : await get("/api/agent/google_marketplace_usage_report_payload");
3817
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3818
- }
3819
- if (name === "google_marketplace_usage_report_execute") {
3820
- const out = await post("/api/agent/google_marketplace_usage_report_execute", args);
3821
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3822
- }
3823
- if (name === "google_marketplace_frontend_integration") {
3824
- const out = await get("/api/agent/google_marketplace_frontend_integration");
3825
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3826
- }
3827
- if (name === "google_marketplace_account_link") {
3828
- const out = await post("/api/agent/google_marketplace_account_link", args);
3829
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3830
- }
3831
- if (name === "google_marketplace_jwt_verifier_gate") {
3832
- const hasBody = args.setup_metadata || args.setup || args.jwt || args.token || args.token_context || args["x-gcp-marketplace-token"];
3833
- const out = hasBody ? await post("/api/agent/google_marketplace_jwt_verifier_gate", args) : await get("/api/agent/google_marketplace_jwt_verifier_gate");
3834
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3835
- }
3836
- if (name === "f1_implementation_bundle") {
3837
- const auditFlag = args.audit ? "&audit=1" : "";
3838
- const out = await get(args.url ? `/api/agent/implementation_bundle?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/implementation_bundle");
3839
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3840
- }
3841
- if (name === "e1_evidence_pack") {
3842
- const out = args.audit ? await post("/api/agent/evidence_pack", args) : await get(args.url ? `/api/agent/evidence_pack?url=${encodeURIComponent(args.url)}` : "/api/agent/evidence_pack");
3843
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3844
- }
3845
- if (name === "v1_installation_verification") {
3846
- const out = args.audit ? await post("/api/agent/installation_verification", args) : await get(args.url ? `/api/agent/installation_verification?url=${encodeURIComponent(args.url)}` : "/api/agent/installation_verification");
3847
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3848
- }
3849
- if (name === "c1_content_optimization_plan") {
3850
- const out = (args.content || args.page || args.questions || args.competitors || args.audit) ? await post("/api/agent/content_optimization_plan", args) : await get(args.url ? `/api/agent/content_optimization_plan?url=${encodeURIComponent(args.url)}` : "/api/agent/content_optimization_plan");
3851
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3852
- }
3853
- if (name === "c4_content_workflow_package") {
3854
- const out = (args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.audit) ? await post("/api/agent/content_workflow_package", args) : await get(args.url ? `/api/agent/content_workflow_package?url=${encodeURIComponent(args.url)}` : "/api/agent/content_workflow_package");
3855
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3856
- }
3857
- if (name === "content_optimization_pack") {
3858
- const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.audit || args.published_items || args.items || args.evidence;
3859
- const out = hasBody ? await post("/api/agent/content_pack", args) : await get(args.url ? `/api/agent/content_pack?url=${encodeURIComponent(args.url)}` : "/api/agent/content_pack");
3860
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3861
- }
3862
- if (name === "c5_content_workflow_review") {
3863
- const hasPackage = args.content_pack || args.pack || args.content_workflow_package || args.package;
3864
- const out = hasPackage ? await post("/api/agent/content_workflow_review", args) : await get(args.url ? `/api/agent/content_workflow_review?url=${encodeURIComponent(args.url)}` : "/api/agent/content_workflow_review");
3865
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3866
- }
3867
- if (name === "m8_content_publication_evidence_package") {
3868
- const out = (args.published_items || args.items || args.evidence || args.content_workflow_package) ? await post("/api/agent/content_publication_package", args) : await get(args.url ? `/api/agent/content_publication_package?url=${encodeURIComponent(args.url)}` : "/api/agent/content_publication_package");
3869
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3870
- }
3871
- if (name === "c1_citation_gap_matrix") {
3872
- const out = (args.content || args.page || args.questions || args.competitors || args.audit || args.content_plan) ? await post("/api/agent/citation_gap_matrix", args) : await get(args.url ? `/api/agent/citation_gap_matrix?url=${encodeURIComponent(args.url)}` : "/api/agent/citation_gap_matrix");
3873
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3874
- }
3875
- if (name === "c1_community_citation_plan") {
3876
- const out = (args.content || args.page || args.questions || args.competitors || args.audit || args.content_plan) ? await post("/api/agent/community_citation_plan", args) : await get(args.url ? `/api/agent/community_citation_plan?url=${encodeURIComponent(args.url)}` : "/api/agent/community_citation_plan");
3877
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3878
- }
3879
- if (name === "c2_prompt_test_run_sheet") {
3880
- const out = (args.content_plan || args.questions || args.topics || args.engines || args.competitors) ? await post("/api/agent/prompt_test_run_sheet", args) : await get(args.url ? `/api/agent/prompt_test_run_sheet?url=${encodeURIComponent(args.url)}` : "/api/agent/prompt_test_run_sheet");
3881
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3882
- }
3883
- if (name === "c3_prompt_test_results_import") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/prompt_test_results", args), null, 2) }] });
3884
- if (name === "r1_audit_report") {
3885
- const out = args.audit ? await post("/api/agent/audit_report", args) : await get(args.url ? `/api/agent/audit_report?url=${encodeURIComponent(args.url)}` : "/api/agent/audit_report");
3886
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3887
- }
3888
- if (name === "o1_optimization_cycle") {
3889
- const auditFlag = args.audit ? "&audit=1" : "";
3890
- const out = await get(args.url ? `/api/agent/optimization_cycle?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/optimization_cycle");
3891
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3892
- }
3893
- if (name === "m2_monthly_optimization_package") {
3894
- const auditFlag = args.audit ? "&audit=1" : "";
3895
- const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.content_publication_package || args.a2_citation_package;
3896
- const out = hasBody ? await post("/api/agent/monthly_package", args) : await get(args.url ? `/api/agent/monthly_package?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/monthly_package");
3897
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3898
- }
3899
- if (name === "m3_monthly_execution_tracker") {
3900
- const auditFlag = args.audit ? "&audit=1" : "";
3901
- const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.content_publication_package || args.a2_citation_package;
3902
- const out = hasBody ? await post("/api/agent/monthly_tracker", args) : await get(args.url ? `/api/agent/monthly_tracker?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/monthly_tracker");
3903
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3904
- }
3905
- if (name === "m4_monthly_outcome_scorecard") {
3906
- const auditFlag = args.audit ? "&audit=1" : "";
3907
- const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.content_publication_package || args.a2_citation_package;
3908
- const out = hasBody ? await post("/api/agent/monthly_scorecard", args) : await get(args.url ? `/api/agent/monthly_scorecard?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/monthly_scorecard");
3909
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3910
- }
3911
- if (name === "m5_monthly_dashboard") {
3912
- const auditFlag = args.audit ? "&audit=1" : "";
3913
- const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.content_publication_package || args.a2_citation_package;
3914
- const out = hasBody ? await post("/api/agent/monthly_dashboard", args) : await get(args.url ? `/api/agent/monthly_dashboard?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/monthly_dashboard");
3915
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3916
- }
3917
- if (name === "i1_insights") {
3918
- const out = args.audit ? await post("/api/agent/insights", args) : await get(args.url ? `/api/agent/insights?url=${encodeURIComponent(args.url)}` : "/api/agent/insights");
3919
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
3920
- }
3921
- if (name === "i1_job_drafts") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/insights/job_drafts", args), null, 2) }] });
3922
- if (name === "aeo_job_drafts") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/job_drafts", args), null, 2) }] });
3923
- if (name === "aeo_job_accept_draft") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/job_drafts/accept", args), null, 2) }] });
3924
- if (name === "aeo_job_create") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/create", args), null, 2) }] });
3925
- if (name === "aeo_job_fund") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/fund", args), null, 2) }] });
3926
- if (name === "aeo_job_payment_quote") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/payment_quote", args), null, 2) }] });
3927
- if (name === "aeo_job_payment_proof") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/fund_with_proof", args), null, 2) }] });
3928
- if (name === "aeo_job_submit") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/submit", args), null, 2) }] });
3929
- if (name === "aeo_job_evaluate") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/evaluate", args), null, 2) }] });
3930
- if (name === "get_pricing") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/pricing"), null, 2) }] });
3931
- if (name === "agent_billing_guide") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/billing_guide"), null, 2) }] });
3932
- if (name === "agent_checkout") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/checkout", args), null, 2) }] });
3933
- if (name === "self_audit") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/self_audit"), null, 2) }] });
3934
- if (name === "get_health") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/agent/health.json"), null, 2) }] });
3935
- if (name === "self_backlog") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/self_backlog"), null, 2) }] });
3936
- if (name === "agentx_passport") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/passport"), null, 2) }] });
3937
- if (name === "proof_graph") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/proof_graph"), null, 2) }] });
3938
- if (name === "outcome_report") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get(args.url ? `/api/agent/outcome_report?url=${encodeURIComponent(args.url)}` : "/api/agent/outcome_report"), null, 2) }] });
3939
- if (name === "m1_outcome_evidence_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get(args.url ? `/api/agent/outcome_package?url=${encodeURIComponent(args.url)}` : "/api/agent/outcome_package"), null, 2) }] });
3940
- if (name === "site_agent_install_guide") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get(args.url ? `/api/site_agents/install_guide?url=${encodeURIComponent(args.url)}` : "/api/site_agents/install_guide"), null, 2) }] });
3941
- if (name === "site_agent_install_descriptor") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "install_descriptor" }), null, 2) }] });
3942
- if (name === "register_site_agent") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/register", args), null, 2) }] });
3943
- if (name === "verify_domain_ownership") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/verify_domain", args), null, 2) }] });
3944
- if (name === "site_agent_actions") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/site_agents/actions"), null, 2) }] });
3945
- if (name === "site_agent_insights") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "insights" }), null, 2) }] });
3946
- if (name === "site_agent_insights_feed") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "insights_feed" }), null, 2) }] });
3947
- if (name === "site_agent_apply_plan") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "apply_plan" }), null, 2) }] });
3948
- if (name === "site_agent_apply_evidence") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "apply_evidence" }), null, 2) }] });
3949
- if (name === "site_agent_outcome_report") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "outcome_report" }), null, 2) }] });
3950
- if (name === "site_agent_optimization_cycle") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "optimization_cycle" }), null, 2) }] });
3951
- if (name === "site_agent_audit_file_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "audit_file_package" }), null, 2) }] });
3952
- if (name === "site_agent_skill_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "skill_package" }), null, 2) }] });
3953
- if (name === "site_agent_implementation_bundle") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "implementation_bundle" }), null, 2) }] });
3954
- if (name === "site_agent_installation_verification") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "installation_verification" }), null, 2) }] });
3955
- if (name === "site_agent_content_optimization_plan") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "content_optimization_plan" }), null, 2) }] });
3956
- if (name === "site_agent_content_workflow_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "content_workflow_package" }), null, 2) }] });
3957
- if (name === "site_agent_content_repair_pack") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "content_repair_pack" }), null, 2) }] });
3958
- if (name === "site_agent_content_pack") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "content_pack" }), null, 2) }] });
3959
- if (name === "site_agent_content_publication_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "content_publication_package" }), null, 2) }] });
3960
- if (name === "site_agent_a1_read_evidence_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "a1_read_evidence_package" }), null, 2) }] });
3961
- if (name === "site_agent_a1_dashboard") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "a1_dashboard" }), null, 2) }] });
3962
- if (name === "site_agent_site_signal_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "site_signal_package" }), null, 2) }] });
3963
- if (name === "site_agent_a2_citation_evidence_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "a2_citation_evidence_package" }), null, 2) }] });
3964
- if (name === "site_agent_b1_conversion_evidence_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "b1_conversion_evidence_package" }), null, 2) }] });
3965
- if (name === "site_agent_m1_outcome_evidence_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "m1_outcome_evidence_package" }), null, 2) }] });
3966
- if (name === "site_agent_m2_monthly_optimization_package") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "m2_monthly_optimization_package" }), null, 2) }] });
3967
- if (name === "site_agent_m3_monthly_execution_tracker") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "m3_monthly_execution_tracker" }), null, 2) }] });
3968
- if (name === "site_agent_m4_monthly_outcome_scorecard") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "m4_monthly_outcome_scorecard" }), null, 2) }] });
3969
- if (name === "site_agent_m5_monthly_dashboard") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "m5_monthly_dashboard" }), null, 2) }] });
3970
- if (name === "site_agent_monthly_evidence_loop") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "monthly_evidence_loop" }), null, 2) }] });
3971
- if (name === "site_agent_citation_gap_matrix") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "citation_gap_matrix" }), null, 2) }] });
3972
- if (name === "site_agent_community_citation_plan") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "community_citation_plan" }), null, 2) }] });
3973
- if (name === "site_agent_prompt_test_run_sheet") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "prompt_test_run_sheet" }), null, 2) }] });
3974
- if (name === "site_agent_prompt_test_results_import") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "prompt_test_results" }), null, 2) }] });
3975
- if (name === "site_agent_job_drafts") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "job_drafts" }), null, 2) }] });
3976
- if (name === "site_agent_accept_job_draft") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "accept_job_draft" }), null, 2) }] });
3977
- if (name === "site_agent_decide_job_draft") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "decide_job_draft" }), null, 2) }] });
3978
- if (name === "site_agent_draft_decisions") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "draft_decisions" }), null, 2) }] });
3979
- if (name === "site_agent_decision_reviews") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "decision_reviews" }), null, 2) }] });
3980
- if (name === "site_agent_jobs") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "jobs" }), null, 2) }] });
3981
- if (name === "jobbank_company") {
3982
- const request = jobbankCompanyRequest(args);
3983
- return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get(request.path, request.headers), null, 2) }] });
3984
- }
3985
- if (name === "company_card_resolve") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get(companyCardResolveRequest(args)), null, 2) }] });
3986
- if (name === "site_agent_c5_repair_history") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "c5_repair_history" }), null, 2) }] });
3987
- if (name === "site_agent_report_job_evidence") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "report_job_evidence" }), null, 2) }] });
3988
- if (name === "site_agent_call") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", args), null, 2) }] });
3989
- return sendError(msg.id, `Unknown tool: ${name}`);
3990
- }
3991
- }
3992
-
3993
3203
  runCli(process.argv.slice(2)).catch(err => {
3994
3204
  console.error(err.code && !String(err.message).includes(err.code) ? `${err.code}: ${err.message}` : err.message);
3995
3205
  process.exit(1);