@twin3-ai/agent-id 0.1.0
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-sync.js +80 -0
- package/bin/agent-id.js +3397 -0
- package/browser-sdk.js +149 -0
- package/cloudflare-worker-adapter.js +100 -0
- package/domain-proof.js +208 -0
- package/enterprise-identity.js +202 -0
- package/installer.js +722 -0
- package/local-policy.js +118 -0
- package/package.json +44 -0
- package/production-preflight.js +123 -0
- package/release-verifier.js +83 -0
- package/repository-connector.js +306 -0
- package/runtime-config.js +10 -0
- package/site-agent.js +1010 -0
- package/sync-service.js +312 -0
- package/task-executor.js +129 -0
- package/telemetry-collector.js +163 -0
- package/trust-verifier.js +206 -0
package/bin/agent-id.js
ADDED
|
@@ -0,0 +1,3397 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { configuredEndpoint, TRUSTED_ISSUER_KEY_SHA256 } = require("../runtime-config.js");
|
|
3
|
+
const endpoint = configuredEndpoint();
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const { buildInstallPlan, resumeInstall, uninstallInstall, enterpriseInstallStatus, prepareEnterpriseSecretDirectory, writeEnterpriseBootstrapCredential, readEnterpriseBootstrapCredential, replaceEnterpriseBootstrapCredential, removeEnterpriseBootstrapCredential, writeEnterpriseEnrollmentState } = require("../installer.js");
|
|
7
|
+
const { buildRepositoryPatch, applyRepositoryPatch, rollbackRepositoryPatch } = require("../repository-connector.js");
|
|
8
|
+
const { generateSiteAgentIdentity, createEnterpriseSession } = require("../enterprise-identity.js");
|
|
9
|
+
const { buildWellKnownProofDocument, resolveProofTarget, writeWellKnownProofDocument } = require("../domain-proof.js");
|
|
10
|
+
const { initializeLocalPolicy, loadLocalPolicy, approvePolicyRule } = require("../local-policy.js");
|
|
11
|
+
const { verifyPortableBundle } = require("../trust-verifier.js");
|
|
12
|
+
const { verifyReleaseManifest } = require("../release-verifier.js");
|
|
13
|
+
const { runProductionPreflight } = require("../production-preflight.js");
|
|
14
|
+
const packageMetadata = require("../package.json");
|
|
15
|
+
|
|
16
|
+
async function post(path, body, headers = {}) {
|
|
17
|
+
const res = await fetch(endpoint + path, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
headers: { "content-type": "application/json", ...headers },
|
|
20
|
+
body: JSON.stringify(body || {})
|
|
21
|
+
});
|
|
22
|
+
const text = await res.text();
|
|
23
|
+
try { return JSON.parse(text); } catch { return { ok: res.ok, text }; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function get(path) {
|
|
27
|
+
const res = await fetch(endpoint + path);
|
|
28
|
+
const text = await res.text();
|
|
29
|
+
try { return JSON.parse(text); } catch { return text; }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function getText(path) {
|
|
33
|
+
const res = await fetch(endpoint + path);
|
|
34
|
+
return await res.text();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function print(value) {
|
|
38
|
+
if (typeof value === "string") console.log(value);
|
|
39
|
+
else console.log(JSON.stringify(value, null, 2));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function readJsonFlag(argv, flag) {
|
|
43
|
+
const idx = argv.indexOf(flag);
|
|
44
|
+
return idx >= 0 ? JSON.parse(fs.readFileSync(argv[idx + 1], "utf8")) : undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function readFlagValue(argv, flag) {
|
|
48
|
+
const idx = argv.indexOf(flag);
|
|
49
|
+
return idx >= 0 ? argv[idx + 1] : undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function enterpriseSessionForProject(projectRoot) {
|
|
53
|
+
const root = path.resolve(projectRoot || process.cwd());
|
|
54
|
+
const state = JSON.parse(fs.readFileSync(path.join(root, ".agent-id", "enterprise-state.json"), "utf8"));
|
|
55
|
+
const existing = await readEnterpriseBootstrapCredential(root);
|
|
56
|
+
if (!existing) throw new Error("enterprise credential is not installed");
|
|
57
|
+
const identity = generateSiteAgentIdentity({ keyPath: existing.key_path });
|
|
58
|
+
const session = createEnterpriseSession({
|
|
59
|
+
serviceOrigin: endpoint,
|
|
60
|
+
siteUrl: state.site_url,
|
|
61
|
+
environment: state.environment,
|
|
62
|
+
credential: existing.credential,
|
|
63
|
+
identity
|
|
64
|
+
});
|
|
65
|
+
return { root, state, session };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function printManagedResult(value) {
|
|
69
|
+
if (process.argv.includes("--json")) return print(value);
|
|
70
|
+
const subscription = value.subscription || {};
|
|
71
|
+
const runs = Array.isArray(value.runs) ? value.runs : [];
|
|
72
|
+
const lines = subscription.record_id ? [
|
|
73
|
+
`Managed inspection: ${subscription.status || "unknown"}`,
|
|
74
|
+
`Site: ${subscription.site_url || "unknown"}`,
|
|
75
|
+
`Cadence: ${subscription.cadence || "monthly"}`,
|
|
76
|
+
`Access: ${subscription.access || "public_read_only"}`,
|
|
77
|
+
`Next run: ${subscription.next_run_at || "pending"}`,
|
|
78
|
+
] : [
|
|
79
|
+
`Managed inspection runs: ${runs.length}`,
|
|
80
|
+
runs[0] ? `Latest: ${runs[0].record_id} (${runs[0].status})` : "Latest: none",
|
|
81
|
+
];
|
|
82
|
+
lines.push("Use --json for the complete machine-readable result.");
|
|
83
|
+
console.log(lines.join("\n"));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function printReleaseResult(value) {
|
|
87
|
+
if (process.argv.includes("--json")) return print(value);
|
|
88
|
+
const manifest = value.manifest || {};
|
|
89
|
+
const packageInfo = manifest.package || {};
|
|
90
|
+
const lines = [
|
|
91
|
+
`Agent ID release: ${value.ok ? "READY" : "BLOCKED"}`,
|
|
92
|
+
`API: ${manifest.api_origin || endpoint}`,
|
|
93
|
+
`Package: ${packageInfo.name || "@twin3-ai/agent-id"}@${packageInfo.version || "unknown"}`,
|
|
94
|
+
`Signature: ${value.signature_verified ? "verified" : "not verified"}`,
|
|
95
|
+
value.ok ? "Install gate: passed" : `Blockers: ${(value.blockers || []).join(", ") || "unknown"}`,
|
|
96
|
+
"Use --json for the complete machine-readable result.",
|
|
97
|
+
];
|
|
98
|
+
console.log(lines.join("\n"));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function printProductionPreflight(value) {
|
|
102
|
+
if (process.argv.includes("--json")) return print(value);
|
|
103
|
+
const checks = value.checks || {};
|
|
104
|
+
const lines = [
|
|
105
|
+
`Production release: ${value.ok ? "READY" : "BLOCKED"}`,
|
|
106
|
+
`API domain: ${checks.stable_api_origin ? "verified" : "not ready"}`,
|
|
107
|
+
`Release signature: ${checks.release_signature ? "verified" : "not verified"}`,
|
|
108
|
+
`npm package: ${checks.registry_integrity ? "verified" : "not ready"}`,
|
|
109
|
+
`Agent surfaces: ${checks.health_endpoint && checks.agent_card ? "verified" : "not ready"}`,
|
|
110
|
+
value.ok ? `Install: ${value.install_template}` : `Blockers: ${(value.blockers || []).join(", ") || "unknown"}`,
|
|
111
|
+
"Use --json for the complete machine-readable result.",
|
|
112
|
+
];
|
|
113
|
+
console.log(lines.join("\n"));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function productionPreflight() {
|
|
117
|
+
const result = await runProductionPreflight({
|
|
118
|
+
endpoint,
|
|
119
|
+
packageVersion: packageMetadata.version,
|
|
120
|
+
expectedIssuerKeySha256: process.env.NODE_ENV === "test" && process.env.AGENT_ID_TEST_ISSUER_KEY_SHA256
|
|
121
|
+
? process.env.AGENT_ID_TEST_ISSUER_KEY_SHA256
|
|
122
|
+
: TRUSTED_ISSUER_KEY_SHA256,
|
|
123
|
+
});
|
|
124
|
+
if (!result.ok) process.exitCode = 1;
|
|
125
|
+
printProductionPreflight(result);
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async function releaseCheck({ printResult = true, setExitCode = true } = {}) {
|
|
130
|
+
const manifest = await get("/.well-known/agent-id-release.json");
|
|
131
|
+
let issuerDescriptor = {};
|
|
132
|
+
if (manifest && manifest.ready === true) {
|
|
133
|
+
const response = await fetch(endpoint + "/.well-known/agentx-issuer-key.json");
|
|
134
|
+
const text = await response.text();
|
|
135
|
+
try { issuerDescriptor = JSON.parse(text); } catch (_error) { issuerDescriptor = {}; }
|
|
136
|
+
}
|
|
137
|
+
const verification = verifyReleaseManifest({
|
|
138
|
+
manifest,
|
|
139
|
+
issuerDescriptor,
|
|
140
|
+
expectedOrigin: endpoint,
|
|
141
|
+
packageVersion: packageMetadata.version,
|
|
142
|
+
expectedIssuerKeySha256: process.env.NODE_ENV === "test" && process.env.AGENT_ID_TEST_ISSUER_KEY_SHA256
|
|
143
|
+
? process.env.AGENT_ID_TEST_ISSUER_KEY_SHA256
|
|
144
|
+
: TRUSTED_ISSUER_KEY_SHA256,
|
|
145
|
+
});
|
|
146
|
+
const result = { ...verification, manifest };
|
|
147
|
+
if (!result.ok && setExitCode) process.exitCode = 1;
|
|
148
|
+
if (printResult) printReleaseResult(result);
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function createEnterpriseEnrollment({ siteUrl, projectRoot, publicRoot, environment = "production", method = "well_known", applyProof = false }) {
|
|
153
|
+
const secretPaths = await prepareEnterpriseSecretDirectory(projectRoot);
|
|
154
|
+
const identity = generateSiteAgentIdentity({ keyPath: secretPaths.key_path });
|
|
155
|
+
const response = await post("/api/site_agents/v1/challenges", {
|
|
156
|
+
url: siteUrl,
|
|
157
|
+
public_key: identity.public_key_pem,
|
|
158
|
+
environment,
|
|
159
|
+
method,
|
|
160
|
+
});
|
|
161
|
+
const challenge = response && response.challenge;
|
|
162
|
+
if (!challenge || !challenge.challenge_id) {
|
|
163
|
+
return { ok: false, error: response && response.error || "enterprise_enrollment_failed" };
|
|
164
|
+
}
|
|
165
|
+
const domainProof = method === "well_known" ? buildWellKnownProofDocument(challenge) : null;
|
|
166
|
+
await writeEnterpriseEnrollmentState(projectRoot, {
|
|
167
|
+
status: "challenge_pending",
|
|
168
|
+
site_url: siteUrl,
|
|
169
|
+
environment,
|
|
170
|
+
agent_id: challenge.agent_id,
|
|
171
|
+
challenge_id: challenge.challenge_id,
|
|
172
|
+
public_key_thumbprint: identity.public_key_thumbprint,
|
|
173
|
+
domain_proof: domainProof,
|
|
174
|
+
});
|
|
175
|
+
let proofReceipt = null;
|
|
176
|
+
if (applyProof) {
|
|
177
|
+
if (method !== "well_known") throw new Error("one-line apply currently requires --method well_known");
|
|
178
|
+
proofReceipt = await writeWellKnownProofDocument({
|
|
179
|
+
challenge: domainProof,
|
|
180
|
+
projectRoot,
|
|
181
|
+
publicRoot,
|
|
182
|
+
approved: true,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
ok: true,
|
|
187
|
+
schema: "agentx-enterprise-enrollment-v1",
|
|
188
|
+
status: "challenge_pending",
|
|
189
|
+
challenge,
|
|
190
|
+
domain_proof: domainProof,
|
|
191
|
+
proof_receipt: proofReceipt,
|
|
192
|
+
identity: {
|
|
193
|
+
algorithm: identity.algorithm,
|
|
194
|
+
public_key_pem: identity.public_key_pem,
|
|
195
|
+
public_key_thumbprint: identity.public_key_thumbprint,
|
|
196
|
+
private_key_persisted_locally: true,
|
|
197
|
+
},
|
|
198
|
+
next_commands: method === "well_known" ? (applyProof ? [
|
|
199
|
+
`deploy ${proofReceipt.relative_path}, then run: agent-id enterprise-domain-verify --project-root ${projectRoot}`,
|
|
200
|
+
] : [
|
|
201
|
+
`agent-id enterprise-domain-proof --project-root ${projectRoot} --public-root <public-root>`,
|
|
202
|
+
`agent-id enterprise-domain-proof --project-root ${projectRoot} --public-root <public-root> --apply`,
|
|
203
|
+
`agent-id enterprise-domain-verify --project-root ${projectRoot}`,
|
|
204
|
+
]) : ["publish_domain_proof_then_verify_with_agent_id"],
|
|
205
|
+
non_claims: [
|
|
206
|
+
"does_not_issue_shared_site_agent_key",
|
|
207
|
+
"does_not_persist_access_token",
|
|
208
|
+
"does_not_grant_mutation_authority",
|
|
209
|
+
"domain_verification_still_required",
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function printSignedInstallResult(value) {
|
|
215
|
+
if (process.argv.includes("--json")) return print(value);
|
|
216
|
+
const plan = value.plan || {};
|
|
217
|
+
const enrollment = value.enrollment || {};
|
|
218
|
+
const lines = value.dry_run ? [
|
|
219
|
+
"Agent ID signed installation plan",
|
|
220
|
+
`Site: ${plan.site_url || "unknown"}`,
|
|
221
|
+
`Framework: ${plan.framework || "unknown"}`,
|
|
222
|
+
"Identity: Ed25519, domain-bound",
|
|
223
|
+
"No files changed",
|
|
224
|
+
`Next: ${value.next_command}`,
|
|
225
|
+
] : [
|
|
226
|
+
"Agent ID signed installation started",
|
|
227
|
+
`Site: ${plan.site_url || "unknown"}`,
|
|
228
|
+
"Signed identity: created",
|
|
229
|
+
`Domain proof: ${enrollment.proof_receipt?.relative_path || "pending"}`,
|
|
230
|
+
`Next: ${(enrollment.next_commands || ["deploy the domain proof"])[0]}`,
|
|
231
|
+
];
|
|
232
|
+
lines.push("Use --json for the complete machine-readable result.");
|
|
233
|
+
console.log(lines.join("\n"));
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function safePackageFilePath(outDir, relPath) {
|
|
237
|
+
if (!relPath || path.isAbsolute(relPath)) throw new Error(`Unsafe package path: ${relPath}`);
|
|
238
|
+
const parts = relPath.split(/[\\/]+/);
|
|
239
|
+
if (parts.includes("..")) throw new Error(`Unsafe package path: ${relPath}`);
|
|
240
|
+
const root = path.resolve(outDir);
|
|
241
|
+
const dest = path.resolve(root, relPath);
|
|
242
|
+
if (dest !== root && !dest.startsWith(root + path.sep)) throw new Error(`Unsafe package path: ${relPath}`);
|
|
243
|
+
return dest;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function siteAgentFixedActionForTool(name) {
|
|
247
|
+
if (typeof name !== "string" || !name.startsWith("site_agent_")) return "";
|
|
248
|
+
if (["site_agent_actions", "site_agent_call", "site_agent_install_guide"].includes(name)) return "";
|
|
249
|
+
const shortName = name.slice("site_agent_".length);
|
|
250
|
+
if (shortName === "prompt_test_results_import") return "prompt_test_results";
|
|
251
|
+
return shortName;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const SITE_AGENT_FIELD_TYPES = {
|
|
255
|
+
url: { type: "string" },
|
|
256
|
+
agent_key: { type: "string" },
|
|
257
|
+
action: { type: "string" },
|
|
258
|
+
audit: { type: "object" },
|
|
259
|
+
audit_url: { type: "boolean" },
|
|
260
|
+
mode: { type: "string" },
|
|
261
|
+
page: { type: "object" },
|
|
262
|
+
content: { type: "string" },
|
|
263
|
+
text: { type: "string" },
|
|
264
|
+
questions: { type: "array" },
|
|
265
|
+
prompts: { type: "array" },
|
|
266
|
+
competitors: { type: "array" },
|
|
267
|
+
topics: { type: ["array", "string"] },
|
|
268
|
+
engines: { type: ["array", "string"] },
|
|
269
|
+
market: { type: "string" },
|
|
270
|
+
cadence: { type: "string" },
|
|
271
|
+
review_gate: { type: "object" },
|
|
272
|
+
c5_repair_history: { type: "object" },
|
|
273
|
+
history: { type: "object" },
|
|
274
|
+
content_pack: { type: "object" },
|
|
275
|
+
pack: { type: "object" },
|
|
276
|
+
content_workflow_package: { type: "object" },
|
|
277
|
+
package: { type: "object" },
|
|
278
|
+
content_plan: { type: "object" },
|
|
279
|
+
plan: { type: "object" },
|
|
280
|
+
published_items: { type: "array" },
|
|
281
|
+
items: { type: "array" },
|
|
282
|
+
evidence: { type: "object" },
|
|
283
|
+
verify_publication: { type: "boolean" },
|
|
284
|
+
sheet: { type: "object" },
|
|
285
|
+
run_sheet: { type: "object" },
|
|
286
|
+
rows: { type: "array" },
|
|
287
|
+
results: { type: "array" },
|
|
288
|
+
completed_rows: { type: "array" },
|
|
289
|
+
events: { type: "array" },
|
|
290
|
+
logs: { type: "array" },
|
|
291
|
+
source: { type: "string" },
|
|
292
|
+
period: { type: "object" },
|
|
293
|
+
sdk_events: { type: "array" },
|
|
294
|
+
probes: { type: "array" },
|
|
295
|
+
probe_set: { type: "object" },
|
|
296
|
+
verify_artifacts: { type: "boolean" },
|
|
297
|
+
conversions: { type: "array" },
|
|
298
|
+
a2_citation_package: { type: "object" },
|
|
299
|
+
feed: { type: "object" },
|
|
300
|
+
delivery_targets: { type: "array" },
|
|
301
|
+
apply_item_id: { type: "string" },
|
|
302
|
+
apply_item: { type: "object" },
|
|
303
|
+
apply_plan: { type: "object" },
|
|
304
|
+
job_id: { type: "string" },
|
|
305
|
+
evidence_uri: { type: "string" },
|
|
306
|
+
proof_url: { type: "string" },
|
|
307
|
+
receipt: { type: "object" },
|
|
308
|
+
receipts: { type: "array" },
|
|
309
|
+
pull_request_url: { type: "string" },
|
|
310
|
+
deployment_reference: { type: "string" },
|
|
311
|
+
source_feed_hash: { type: "string" },
|
|
312
|
+
verify_proof: { type: "boolean" },
|
|
313
|
+
verify: { type: "boolean" },
|
|
314
|
+
insights: { type: "object" },
|
|
315
|
+
provider: { type: "string" },
|
|
316
|
+
evaluator: { type: "string" },
|
|
317
|
+
currency: { type: "string" },
|
|
318
|
+
budget: { type: "number" },
|
|
319
|
+
draft: { type: "object" },
|
|
320
|
+
decision: { type: "string" },
|
|
321
|
+
draft_id: { type: "string" },
|
|
322
|
+
create_payload: { type: "object" },
|
|
323
|
+
reason: { type: "string" },
|
|
324
|
+
item_id: { type: "string" }
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
const SITE_AGENT_TOOL_FIELDS = {
|
|
328
|
+
site_agent_install_descriptor: ["url", "agent_key", "action"],
|
|
329
|
+
site_agent_implementation_bundle: ["url", "agent_key", "action", "audit", "audit_url"],
|
|
330
|
+
site_agent_audit_file_package: ["url", "agent_key", "action", "audit", "audit_url", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence"],
|
|
331
|
+
site_agent_skill_package: ["url", "agent_key", "action", "mode"],
|
|
332
|
+
site_agent_installation_verification: ["url", "agent_key", "action", "audit", "audit_url"],
|
|
333
|
+
site_agent_content_optimization_plan: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "audit", "audit_url"],
|
|
334
|
+
site_agent_content_workflow_package: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence", "audit", "audit_url"],
|
|
335
|
+
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"],
|
|
336
|
+
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"],
|
|
337
|
+
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"],
|
|
338
|
+
site_agent_citation_gap_matrix: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "audit", "audit_url"],
|
|
339
|
+
site_agent_community_citation_plan: ["url", "agent_key", "action", "page", "content", "text", "questions", "prompts", "competitors", "audit", "audit_url"],
|
|
340
|
+
site_agent_prompt_test_run_sheet: ["url", "agent_key", "action", "content_plan", "plan", "questions", "prompts", "topics", "engines", "competitors", "market", "cadence"],
|
|
341
|
+
site_agent_prompt_test_results_import: ["url", "agent_key", "action", "sheet", "run_sheet", "rows", "results", "completed_rows"],
|
|
342
|
+
site_agent_a1_read_evidence_package: ["url", "agent_key", "action", "events", "logs", "source", "period"],
|
|
343
|
+
site_agent_a1_dashboard: ["url", "agent_key", "action", "events", "logs", "source", "period"],
|
|
344
|
+
site_agent_site_signal_package: ["url", "agent_key", "action", "events", "sdk_events", "period", "source"],
|
|
345
|
+
site_agent_a2_citation_evidence_package: ["url", "agent_key", "action", "probes", "events", "probe_set", "period", "source", "verify_artifacts"],
|
|
346
|
+
site_agent_b1_conversion_evidence_package: ["url", "agent_key", "action", "events", "conversions", "period", "source"],
|
|
347
|
+
site_agent_outcome_report: ["url", "agent_key", "action"],
|
|
348
|
+
site_agent_m1_outcome_evidence_package: ["url", "agent_key", "action", "period"],
|
|
349
|
+
site_agent_m2_monthly_optimization_package: ["url", "agent_key", "action", "audit", "audit_url", "period"],
|
|
350
|
+
site_agent_m3_monthly_execution_tracker: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence"],
|
|
351
|
+
site_agent_m4_monthly_outcome_scorecard: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence"],
|
|
352
|
+
site_agent_m5_monthly_dashboard: ["url", "agent_key", "action", "audit", "audit_url", "period", "page", "content", "text", "questions", "prompts", "competitors", "topics", "engines", "market", "cadence"],
|
|
353
|
+
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"],
|
|
354
|
+
site_agent_insights: ["url", "agent_key", "action", "audit", "audit_url"],
|
|
355
|
+
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"],
|
|
356
|
+
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"],
|
|
357
|
+
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"],
|
|
358
|
+
site_agent_job_drafts: ["url", "agent_key", "action", "audit", "audit_url", "insights", "review_gate", "provider", "evaluator", "currency"],
|
|
359
|
+
site_agent_accept_job_draft: ["url", "agent_key", "action", "draft", "provider", "evaluator", "currency", "budget"],
|
|
360
|
+
site_agent_decide_job_draft: ["url", "agent_key", "action", "decision", "draft", "draft_id", "create_payload", "reason", "provider", "evaluator", "currency", "budget"],
|
|
361
|
+
site_agent_draft_decisions: ["url", "agent_key", "action", "decision", "draft_id"],
|
|
362
|
+
site_agent_decision_reviews: ["url", "agent_key", "action", "decision", "apply_item_id", "item_id"],
|
|
363
|
+
site_agent_report_job_evidence: ["url", "agent_key", "action", "job_id", "evidence_uri", "evidence"],
|
|
364
|
+
site_agent_jobs: ["url", "agent_key", "action"],
|
|
365
|
+
site_agent_c5_repair_history: ["url", "agent_key", "action"],
|
|
366
|
+
site_agent_optimization_cycle: ["url", "agent_key", "action", "audit", "audit_url"]
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
const SITE_AGENT_TOOL_REQUIRED = {
|
|
370
|
+
site_agent_apply_evidence: ["apply_item_id"],
|
|
371
|
+
site_agent_accept_job_draft: ["draft"],
|
|
372
|
+
site_agent_decide_job_draft: ["decision"],
|
|
373
|
+
site_agent_report_job_evidence: ["job_id"]
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
function withSiteAgentFixedActionSchemas(tools) {
|
|
377
|
+
return tools.map(tool => {
|
|
378
|
+
const action = siteAgentFixedActionForTool(tool?.name);
|
|
379
|
+
if (!action) return tool;
|
|
380
|
+
const schema = tool.inputSchema && typeof tool.inputSchema === "object" && !Array.isArray(tool.inputSchema) ? tool.inputSchema : {};
|
|
381
|
+
const properties = schema.properties && typeof schema.properties === "object" && !Array.isArray(schema.properties) ? schema.properties : {};
|
|
382
|
+
const required = Array.isArray(schema.required) ? schema.required.filter(value => typeof value === "string") : [];
|
|
383
|
+
const nextProperties = { ...properties };
|
|
384
|
+
for (const field of SITE_AGENT_TOOL_FIELDS[tool.name] || []) {
|
|
385
|
+
if (!nextProperties[field]) nextProperties[field] = SITE_AGENT_FIELD_TYPES[field] || { type: "object" };
|
|
386
|
+
}
|
|
387
|
+
if (action) nextProperties.action = { ...(nextProperties.action || { type: "string" }), const: action };
|
|
388
|
+
const requiredAdditions = ["action", ...(SITE_AGENT_TOOL_REQUIRED[tool.name] || [])];
|
|
389
|
+
const nextRequired = [...required];
|
|
390
|
+
for (const field of requiredAdditions) {
|
|
391
|
+
if (!nextRequired.includes(field)) nextRequired.push(field);
|
|
392
|
+
}
|
|
393
|
+
return {
|
|
394
|
+
...tool,
|
|
395
|
+
inputSchema: {
|
|
396
|
+
...schema,
|
|
397
|
+
type: "object",
|
|
398
|
+
properties: nextProperties,
|
|
399
|
+
required: nextRequired,
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function writeSkillPackageFiles(response, outDir) {
|
|
406
|
+
const pkg = response?.package || response?.bundle || response;
|
|
407
|
+
if (!pkg || !pkg.files || typeof pkg.files !== "object") throw new Error("Skill package response has no files");
|
|
408
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
409
|
+
const written = [];
|
|
410
|
+
for (const [relPath, fileObj] of Object.entries(pkg.files)) {
|
|
411
|
+
const dest = safePackageFilePath(outDir, relPath);
|
|
412
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
413
|
+
const content = typeof fileObj === "string" ? fileObj : (fileObj?.content || "");
|
|
414
|
+
fs.writeFileSync(dest, content);
|
|
415
|
+
written.push(relPath);
|
|
416
|
+
}
|
|
417
|
+
return {
|
|
418
|
+
ok: true,
|
|
419
|
+
schema: pkg.schema,
|
|
420
|
+
content_hash: pkg.content_hash,
|
|
421
|
+
out_dir: path.resolve(outDir),
|
|
422
|
+
files_written: written.length,
|
|
423
|
+
files: written,
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function readJsonFileIfExists(filePath) {
|
|
428
|
+
if (!fs.existsSync(filePath)) return null;
|
|
429
|
+
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
function readRequiredJsonFile(filePath, label = "JSON file") {
|
|
433
|
+
if (!fs.existsSync(filePath)) throw new Error(`${label} not found: ${filePath}`);
|
|
434
|
+
try {
|
|
435
|
+
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
436
|
+
} catch (err) {
|
|
437
|
+
throw new Error(`Invalid JSON in ${label}: ${filePath}`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function validateSkillPackageDir(dir) {
|
|
442
|
+
const root = path.resolve(dir);
|
|
443
|
+
const required = [
|
|
444
|
+
["skill_file_present", "SKILL.md"],
|
|
445
|
+
["package_review_present", "agent-id.package-review.json"],
|
|
446
|
+
["tool_examples_present", "agent-id.tool-examples.json"],
|
|
447
|
+
["source_map_present", "agent-id.source-map.json"],
|
|
448
|
+
];
|
|
449
|
+
const checkedFiles = [];
|
|
450
|
+
const checks = [];
|
|
451
|
+
const add = (id, ok, evidence) => checks.push({ id, status: ok ? "pass" : "fail", evidence });
|
|
452
|
+
for (const [id, rel] of required) {
|
|
453
|
+
const exists = fs.existsSync(path.join(root, rel));
|
|
454
|
+
if (exists) checkedFiles.push(rel);
|
|
455
|
+
add(id, exists, exists ? "file exists" : "missing file");
|
|
456
|
+
}
|
|
457
|
+
const skillPath = path.join(root, "SKILL.md");
|
|
458
|
+
const skill = fs.existsSync(skillPath) ? fs.readFileSync(skillPath, "utf8") : "";
|
|
459
|
+
add("skill_names_twin3_aeo_agent", skill.includes("twin3-aeo-agent"), skill.includes("twin3-aeo-agent") ? "skill name present" : "missing skill name");
|
|
460
|
+
add("skill_mentions_package_review", skill.includes("s2_package_review") || skill.includes("package_review"), skill.includes("s2_package_review") || skill.includes("package_review") ? "package review mentioned" : "package review not mentioned");
|
|
461
|
+
add("skill_mentions_package_validation", skill.includes("s1_skill_package_validation") || skill.includes("skill_package_validate"), skill.includes("s1_skill_package_validation") || skill.includes("skill_package_validate") ? "package validation mentioned" : "package validation not mentioned");
|
|
462
|
+
add("skill_mentions_install_descriptor", skill.includes("site_agent_install_descriptor") || skill.includes("install_descriptor"), skill.includes("site_agent_install_descriptor") || skill.includes("install_descriptor") ? "install descriptor mentioned" : "install descriptor not mentioned");
|
|
463
|
+
const readmePath = path.join(root, "README.agent.md");
|
|
464
|
+
const readme = fs.existsSync(readmePath) ? fs.readFileSync(readmePath, "utf8") : "";
|
|
465
|
+
if (readme && !checkedFiles.includes("README.agent.md")) checkedFiles.push("README.agent.md");
|
|
466
|
+
const readmeHasPackageReview = readme.includes("s2_package_review") || readme.includes("package_review") || readme.includes("agent-id.package-review.json");
|
|
467
|
+
add("readme_mentions_package_review", readmeHasPackageReview, readmeHasPackageReview ? "README package review mentioned" : "README package review not mentioned");
|
|
468
|
+
add("readme_mentions_package_validation", readme.includes("s1_skill_package_validation") || readme.includes("skill_package_validate"), readme.includes("s1_skill_package_validation") || readme.includes("skill_package_validate") ? "README package validation mentioned" : "README package validation not mentioned");
|
|
469
|
+
add("readme_mentions_source_map", readme.includes("agent-id.source-map.json") || readme.includes("source_map"), readme.includes("agent-id.source-map.json") || readme.includes("source_map") ? "README source map mentioned" : "README source map not mentioned");
|
|
470
|
+
add("readme_mentions_tool_examples", readme.includes("agent-id.tool-examples.json") || readme.includes("tool_examples"), readme.includes("agent-id.tool-examples.json") || readme.includes("tool_examples") ? "README tool examples mentioned" : "README tool examples not mentioned");
|
|
471
|
+
add("readme_mentions_billing_guide", readme.includes("agent-id.billing-guide.json") || readme.includes("billing_guide"), readme.includes("agent-id.billing-guide.json") || readme.includes("billing_guide") ? "README billing guide mentioned" : "README billing guide not mentioned");
|
|
472
|
+
add("readme_mentions_install_descriptor", readme.includes("site_agent_install_descriptor") || readme.includes("install_descriptor"), readme.includes("site_agent_install_descriptor") || readme.includes("install_descriptor") ? "README install descriptor mentioned" : "README install descriptor not mentioned");
|
|
473
|
+
const readmeDeclaresNoSiteMutation = readme.includes("does not mutate") || readme.includes("does_not_mutate_customer_site") || readme.includes("does_not_modify_customer_site") || readme.includes("does not modify");
|
|
474
|
+
add("readme_declares_no_site_mutation", readmeDeclaresNoSiteMutation, readmeDeclaresNoSiteMutation ? "README no site mutation declared" : "README no site mutation not declared");
|
|
475
|
+
|
|
476
|
+
let review = null;
|
|
477
|
+
try { review = readJsonFileIfExists(path.join(root, "agent-id.package-review.json")); } catch {}
|
|
478
|
+
add("package_review_schema", review?.schema === "agentx-s2-package-review-v0.1", review?.schema || "missing or invalid schema");
|
|
479
|
+
const reviewSections = Array.isArray(review?.sections) ? review.sections : [];
|
|
480
|
+
const credentials = reviewSections.find(item => item.id === "credentials") || {};
|
|
481
|
+
const persistence = reviewSections.find(item => item.id === "persistence_privilege") || {};
|
|
482
|
+
const sourceConsistency = reviewSections.find(item => item.id === "source_consistency") || {};
|
|
483
|
+
const nonClaims = Array.isArray(review?.non_claims) ? review.non_claims : [];
|
|
484
|
+
add("site_agent_key_server_side", credentials.site_agent_key_policy === "server_side_only_after_domain_ownership", credentials.site_agent_key_policy || "missing Site Agent Key policy");
|
|
485
|
+
add("does_not_mutate_customer_site", persistence.mutates_customer_site === false || nonClaims.includes("does_not_mutate_customer_site"), "must state no customer-site mutation");
|
|
486
|
+
add("does_not_guarantee_ai_recommendation", nonClaims.includes("does_not_guarantee_ai_recommendation"), "must state no AI recommendation guarantee");
|
|
487
|
+
add("package_review_metadata_status_declared", typeof sourceConsistency.metadata_title_status === "string" && sourceConsistency.metadata_title_status.length > 0, sourceConsistency.metadata_title_status || "missing metadata title status");
|
|
488
|
+
add("package_review_metadata_issues_declared", Array.isArray(sourceConsistency.known_metadata_issues), Array.isArray(sourceConsistency.known_metadata_issues) ? "metadata issues list declared" : "missing metadata issues list");
|
|
489
|
+
|
|
490
|
+
let examples = null;
|
|
491
|
+
try { examples = readJsonFileIfExists(path.join(root, "agent-id.tool-examples.json")); } catch {}
|
|
492
|
+
const examplesRawPath = path.join(root, "agent-id.tool-examples.json");
|
|
493
|
+
const examplesRaw = fs.existsSync(examplesRawPath) ? fs.readFileSync(examplesRawPath, "utf8") : "";
|
|
494
|
+
const exampleIds = new Set((examples?.examples || []).map(item => item.id));
|
|
495
|
+
add("tool_examples_schema", examples?.schema === "agentx-s1-tool-examples-v0.1", examples?.schema || "missing or invalid schema");
|
|
496
|
+
add("tool_examples_include_package_review", exampleIds.has("s2_package_review"), exampleIds.has("s2_package_review") ? "s2_package_review example present" : "missing s2_package_review example");
|
|
497
|
+
add("tool_examples_include_package_validation", exampleIds.has("s1_skill_package_validation"), exampleIds.has("s1_skill_package_validation") ? "s1_skill_package_validation example present" : "missing s1_skill_package_validation example");
|
|
498
|
+
add("tool_examples_include_private_install_descriptor", exampleIds.has("site_agent_install_descriptor"), exampleIds.has("site_agent_install_descriptor") ? "site_agent_install_descriptor example present" : "missing site_agent_install_descriptor example");
|
|
499
|
+
const secretHandling = examples?.secret_handling || {};
|
|
500
|
+
add("tool_examples_keep_site_agent_key_server_side", secretHandling.site_agent_key === "server_side_environment_only", secretHandling.site_agent_key || "missing secret handling policy");
|
|
501
|
+
add("tool_examples_do_not_embed_literal_site_agent_keys", !examplesRaw.includes("ak_aeo_"), examplesRaw.includes("ak_aeo_") ? "literal Site Agent Key found in tool examples" : "tool examples do not embed literal Site Agent Keys");
|
|
502
|
+
const invalidExampleIdTypes = [];
|
|
503
|
+
const missingExampleIds = [];
|
|
504
|
+
const seenExampleIds = new Set();
|
|
505
|
+
const duplicateExampleIds = new Set();
|
|
506
|
+
for (const item of examples?.examples || []) {
|
|
507
|
+
const rawId = item?.id;
|
|
508
|
+
if (rawId !== undefined && typeof rawId !== "string") invalidExampleIdTypes.push(String(rawId));
|
|
509
|
+
const exampleId = typeof rawId === "string" ? rawId : "";
|
|
510
|
+
if (!exampleId) {
|
|
511
|
+
missingExampleIds.push(String(item?.tool || "unknown"));
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
if (seenExampleIds.has(exampleId)) duplicateExampleIds.add(exampleId);
|
|
515
|
+
seenExampleIds.add(exampleId);
|
|
516
|
+
}
|
|
517
|
+
add("tool_examples_ids_are_strings", invalidExampleIdTypes.length === 0, invalidExampleIdTypes.length ? `id must be string: ${invalidExampleIdTypes.join(", ")}` : "tool example IDs are strings");
|
|
518
|
+
add("tool_examples_ids_declared", missingExampleIds.length === 0, missingExampleIds.length ? `missing id: ${missingExampleIds.join(", ")}` : "tool examples declare IDs");
|
|
519
|
+
add("tool_examples_ids_unique", duplicateExampleIds.size === 0, duplicateExampleIds.size ? `duplicate example ids: ${[...duplicateExampleIds].sort().join(", ")}` : "tool example IDs are unique");
|
|
520
|
+
const allowedExampleVisibilities = new Set(["public", "public_registration", "public_verification", "public_or_private", "private_verified_site_agent"]);
|
|
521
|
+
const invalidExampleVisibilityTypes = [];
|
|
522
|
+
const missingExampleVisibilities = [];
|
|
523
|
+
const invalidExampleVisibilities = [];
|
|
524
|
+
for (const item of examples?.examples || []) {
|
|
525
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
526
|
+
const rawVisibility = item?.visibility;
|
|
527
|
+
if (rawVisibility !== undefined && typeof rawVisibility !== "string") invalidExampleVisibilityTypes.push(exampleId);
|
|
528
|
+
const visibility = typeof rawVisibility === "string" ? rawVisibility : "";
|
|
529
|
+
if (!visibility) missingExampleVisibilities.push(exampleId);
|
|
530
|
+
if (!allowedExampleVisibilities.has(visibility)) invalidExampleVisibilities.push(exampleId);
|
|
531
|
+
}
|
|
532
|
+
add("tool_examples_visibility_is_string", invalidExampleVisibilityTypes.length === 0, invalidExampleVisibilityTypes.length ? `visibility must be string: ${invalidExampleVisibilityTypes.join(", ")}` : "tool example visibility values are strings");
|
|
533
|
+
add("tool_examples_visibility_declared", missingExampleVisibilities.length === 0, missingExampleVisibilities.length ? `missing visibility: ${missingExampleVisibilities.join(", ")}` : "tool examples declare visibility");
|
|
534
|
+
add("tool_examples_visibility_allowed", invalidExampleVisibilities.length === 0, invalidExampleVisibilities.length ? `invalid visibility: ${invalidExampleVisibilities.join(", ")}` : "tool example visibility values are allowed");
|
|
535
|
+
const examplesMissingRequires = [];
|
|
536
|
+
const examplesWithInvalidRequires = [];
|
|
537
|
+
for (const item of examples?.examples || []) {
|
|
538
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
539
|
+
if (!Array.isArray(item?.requires)) {
|
|
540
|
+
examplesMissingRequires.push(exampleId);
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
if (item.requires.some(value => typeof value !== "string")) examplesWithInvalidRequires.push(exampleId);
|
|
544
|
+
}
|
|
545
|
+
add("tool_examples_requires_declared", examplesMissingRequires.length === 0, examplesMissingRequires.length ? `missing requires array: ${examplesMissingRequires.join(", ")}` : "tool examples declare requires arrays");
|
|
546
|
+
add("tool_examples_requires_entries_are_strings", examplesWithInvalidRequires.length === 0, examplesWithInvalidRequires.length ? `requires entries must be strings: ${examplesWithInvalidRequires.join(", ")}` : "tool example requires entries are strings");
|
|
547
|
+
const allowedExampleMethods = new Set(["GET", "POST", "GET_OR_POST", "GET_OR_PRIVATE_POST"]);
|
|
548
|
+
const invalidExampleMethodTypes = [];
|
|
549
|
+
const missingExampleMethods = [];
|
|
550
|
+
const invalidExampleMethods = [];
|
|
551
|
+
for (const item of examples?.examples || []) {
|
|
552
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
553
|
+
const rawMethod = item?.method;
|
|
554
|
+
if (rawMethod !== undefined && typeof rawMethod !== "string") invalidExampleMethodTypes.push(exampleId);
|
|
555
|
+
const method = typeof rawMethod === "string" ? rawMethod : "";
|
|
556
|
+
if (!method) missingExampleMethods.push(exampleId);
|
|
557
|
+
if (!allowedExampleMethods.has(method)) invalidExampleMethods.push(exampleId);
|
|
558
|
+
}
|
|
559
|
+
add("tool_examples_methods_are_strings", invalidExampleMethodTypes.length === 0, invalidExampleMethodTypes.length ? `method must be string: ${invalidExampleMethodTypes.join(", ")}` : "tool example methods are strings");
|
|
560
|
+
add("tool_examples_methods_declared", missingExampleMethods.length === 0, missingExampleMethods.length ? `missing method: ${missingExampleMethods.join(", ")}` : "tool examples declare methods");
|
|
561
|
+
add("tool_examples_methods_allowed", invalidExampleMethods.length === 0, invalidExampleMethods.length ? `invalid method: ${invalidExampleMethods.join(", ")}` : "tool example methods are allowed");
|
|
562
|
+
const missingResponseFields = [];
|
|
563
|
+
const invalidResponseFieldArrays = [];
|
|
564
|
+
const invalidResponseFieldEntries = [];
|
|
565
|
+
for (const item of examples?.examples || []) {
|
|
566
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
567
|
+
const rawResponseFields = item?.response_fields;
|
|
568
|
+
if (!Array.isArray(rawResponseFields)) {
|
|
569
|
+
invalidResponseFieldArrays.push(exampleId);
|
|
570
|
+
missingResponseFields.push(exampleId);
|
|
571
|
+
continue;
|
|
572
|
+
}
|
|
573
|
+
if (!rawResponseFields.length) missingResponseFields.push(exampleId);
|
|
574
|
+
if (rawResponseFields.some(value => typeof value !== "string")) invalidResponseFieldEntries.push(exampleId);
|
|
575
|
+
}
|
|
576
|
+
add("tool_examples_response_fields_declared", missingResponseFields.length === 0, missingResponseFields.length ? `missing response_fields: ${missingResponseFields.join(", ")}` : "tool examples declare response fields");
|
|
577
|
+
add("tool_examples_response_fields_are_arrays", invalidResponseFieldArrays.length === 0, invalidResponseFieldArrays.length ? `response_fields must be arrays: ${invalidResponseFieldArrays.join(", ")}` : "tool example response fields are arrays");
|
|
578
|
+
add("tool_examples_response_field_entries_are_strings", invalidResponseFieldEntries.length === 0, invalidResponseFieldEntries.length ? `response field entries must be strings: ${invalidResponseFieldEntries.join(", ")}` : "tool example response field entries are strings");
|
|
579
|
+
const missingRequests = [];
|
|
580
|
+
const invalidRequestObjects = [];
|
|
581
|
+
for (const item of examples?.examples || []) {
|
|
582
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
583
|
+
if (!Object.prototype.hasOwnProperty.call(item || {}, "request")) {
|
|
584
|
+
missingRequests.push(exampleId);
|
|
585
|
+
invalidRequestObjects.push(exampleId);
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
const request = item?.request;
|
|
589
|
+
if (!request || typeof request !== "object" || Array.isArray(request)) invalidRequestObjects.push(exampleId);
|
|
590
|
+
}
|
|
591
|
+
add("tool_examples_requests_declared", missingRequests.length === 0, missingRequests.length ? `missing request: ${missingRequests.join(", ")}` : "tool examples declare request samples");
|
|
592
|
+
add("tool_examples_requests_are_objects", invalidRequestObjects.length === 0, invalidRequestObjects.length ? `request must be object: ${invalidRequestObjects.join(", ")}` : "tool example requests are objects");
|
|
593
|
+
const actionMismatches = [];
|
|
594
|
+
for (const item of examples?.examples || []) {
|
|
595
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
596
|
+
const siteAgentAction = typeof item?.site_agent_action === "string" ? item.site_agent_action : "";
|
|
597
|
+
if (!siteAgentAction) continue;
|
|
598
|
+
const request = item?.request && typeof item.request === "object" && !Array.isArray(item.request) ? item.request : {};
|
|
599
|
+
if (request.action !== siteAgentAction) actionMismatches.push(exampleId);
|
|
600
|
+
}
|
|
601
|
+
add("tool_examples_site_agent_actions_match_requests", actionMismatches.length === 0, actionMismatches.length ? `action mismatch: ${actionMismatches.join(", ")}` : "site agent actions match request actions");
|
|
602
|
+
const toolExampleEndpointPath = value => {
|
|
603
|
+
const raw = String(value || "");
|
|
604
|
+
if (!raw) return "";
|
|
605
|
+
try { return new URL(raw).pathname; } catch {}
|
|
606
|
+
return raw;
|
|
607
|
+
};
|
|
608
|
+
const privateRequestsMissingKeyPlaceholder = [];
|
|
609
|
+
const privateExamplesBadMethod = [];
|
|
610
|
+
const privateExamplesBadEndpoint = [];
|
|
611
|
+
for (const item of examples?.examples || []) {
|
|
612
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
613
|
+
const visibility = String(item?.visibility || "");
|
|
614
|
+
const requires = new Set((item?.requires || []).filter(value => typeof value === "string"));
|
|
615
|
+
if (!visibility.startsWith("private") && !requires.has("site_agent_key")) continue;
|
|
616
|
+
const request = item?.request && typeof item.request === "object" && !Array.isArray(item.request) ? item.request : {};
|
|
617
|
+
if (request.agent_key !== "${SITE_AGENT_KEY}") privateRequestsMissingKeyPlaceholder.push(exampleId);
|
|
618
|
+
if (item?.method !== "POST") privateExamplesBadMethod.push(exampleId);
|
|
619
|
+
if (toolExampleEndpointPath(item?.endpoint) !== "/api/site_agents/call") privateExamplesBadEndpoint.push(exampleId);
|
|
620
|
+
}
|
|
621
|
+
add("tool_examples_private_requests_use_site_agent_key_placeholder", privateRequestsMissingKeyPlaceholder.length === 0, privateRequestsMissingKeyPlaceholder.length ? `private request missing Site Agent Key placeholder: ${privateRequestsMissingKeyPlaceholder.join(", ")}` : "private request examples use Site Agent Key placeholder");
|
|
622
|
+
add("tool_examples_private_calls_use_post", privateExamplesBadMethod.length === 0, privateExamplesBadMethod.length ? `private examples must use POST: ${privateExamplesBadMethod.join(", ")}` : "private examples use POST");
|
|
623
|
+
add("tool_examples_private_calls_use_site_agents_call_endpoint", privateExamplesBadEndpoint.length === 0, privateExamplesBadEndpoint.length ? `private examples must use /api/site_agents/call: ${privateExamplesBadEndpoint.join(", ")}` : "private examples use /api/site_agents/call");
|
|
624
|
+
const privateExampleMissingRequirements = [];
|
|
625
|
+
const privateExampleMissingBoundaries = [];
|
|
626
|
+
const examplesMissingClaimBoundaries = [];
|
|
627
|
+
const examplesWithInvalidClaimBoundaries = [];
|
|
628
|
+
const publicExampleWithSiteKey = [];
|
|
629
|
+
for (const item of examples?.examples || []) {
|
|
630
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
631
|
+
const visibility = String(item?.visibility || "");
|
|
632
|
+
const requires = new Set((item?.requires || []).filter(value => typeof value === "string"));
|
|
633
|
+
const rawClaimBoundary = item?.claim_boundary;
|
|
634
|
+
if (rawClaimBoundary !== undefined && typeof rawClaimBoundary !== "string") examplesWithInvalidClaimBoundaries.push(exampleId);
|
|
635
|
+
const claimBoundary = typeof rawClaimBoundary === "string" ? rawClaimBoundary : "";
|
|
636
|
+
if (!claimBoundary) examplesMissingClaimBoundaries.push(exampleId);
|
|
637
|
+
if (visibility.startsWith("private") && (!requires.has("verified_domain") || !requires.has("site_agent_key"))) privateExampleMissingRequirements.push(exampleId);
|
|
638
|
+
if (visibility.startsWith("private") && !claimBoundary) privateExampleMissingBoundaries.push(exampleId);
|
|
639
|
+
if (!visibility.startsWith("private") && requires.has("site_agent_key")) publicExampleWithSiteKey.push(exampleId);
|
|
640
|
+
}
|
|
641
|
+
add("tool_examples_private_calls_require_site_agent_key", privateExampleMissingRequirements.length === 0, privateExampleMissingRequirements.length ? `private examples missing requirements: ${privateExampleMissingRequirements.join(", ")}` : "private examples require verified_domain and site_agent_key");
|
|
642
|
+
add("tool_examples_public_calls_do_not_require_site_agent_key", publicExampleWithSiteKey.length === 0, publicExampleWithSiteKey.length ? `public examples require Site Agent Key: ${publicExampleWithSiteKey.join(", ")}` : "public examples do not require Site Agent Key");
|
|
643
|
+
add("tool_examples_private_calls_declare_claim_boundary", privateExampleMissingBoundaries.length === 0, privateExampleMissingBoundaries.length ? `private examples missing claim boundary: ${privateExampleMissingBoundaries.join(", ")}` : "private examples declare claim boundaries");
|
|
644
|
+
add("tool_examples_claim_boundaries_declared", examplesMissingClaimBoundaries.length === 0, examplesMissingClaimBoundaries.length ? `missing claim_boundary: ${examplesMissingClaimBoundaries.join(", ")}` : "tool examples declare claim boundaries");
|
|
645
|
+
add("tool_examples_claim_boundaries_are_strings", examplesWithInvalidClaimBoundaries.length === 0, examplesWithInvalidClaimBoundaries.length ? `claim_boundary must be string: ${examplesWithInvalidClaimBoundaries.join(", ")}` : "tool example claim boundaries are strings");
|
|
646
|
+
|
|
647
|
+
let sourceMap = null;
|
|
648
|
+
try { sourceMap = readJsonFileIfExists(path.join(root, "agent-id.source-map.json")); } catch {}
|
|
649
|
+
const sourceCapabilities = new Set((sourceMap?.capability_map || []).map(item => item.capability));
|
|
650
|
+
const invalidSourceCapabilityTypes = [];
|
|
651
|
+
const missingSourceCapabilities = [];
|
|
652
|
+
const seenSourceCapabilities = new Set();
|
|
653
|
+
const duplicateSourceCapabilities = new Set();
|
|
654
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
655
|
+
const rawCapability = item?.capability;
|
|
656
|
+
if (rawCapability !== undefined && typeof rawCapability !== "string") invalidSourceCapabilityTypes.push(String(rawCapability));
|
|
657
|
+
const capability = typeof rawCapability === "string" ? rawCapability : "";
|
|
658
|
+
if (!capability) {
|
|
659
|
+
missingSourceCapabilities.push(String(item?.mcp_tool || item?.endpoint || "unknown"));
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
if (seenSourceCapabilities.has(capability)) duplicateSourceCapabilities.add(capability);
|
|
663
|
+
seenSourceCapabilities.add(capability);
|
|
664
|
+
}
|
|
665
|
+
add("source_map_schema", sourceMap?.schema === "agentx-s1-source-consistency-map-v0.1", sourceMap?.schema || "missing or invalid schema");
|
|
666
|
+
add("source_map_capabilities_are_strings", invalidSourceCapabilityTypes.length === 0, invalidSourceCapabilityTypes.length ? `capability must be string: ${invalidSourceCapabilityTypes.join(", ")}` : "source map capabilities are strings");
|
|
667
|
+
add("source_map_capabilities_declared", missingSourceCapabilities.length === 0, missingSourceCapabilities.length ? `missing capability: ${missingSourceCapabilities.join(", ")}` : "source map capabilities are declared");
|
|
668
|
+
add("source_map_capabilities_unique", duplicateSourceCapabilities.size === 0, duplicateSourceCapabilities.size ? `duplicate capabilities: ${[...duplicateSourceCapabilities].sort().join(", ")}` : "source map capabilities are unique");
|
|
669
|
+
const allowedSourceVisibilities = new Set(["public", "public_registration", "public_verification", "public_or_private", "private_verified_site_agent"]);
|
|
670
|
+
const invalidSourceVisibilityTypes = [];
|
|
671
|
+
const missingSourceVisibilities = [];
|
|
672
|
+
const invalidSourceVisibilities = [];
|
|
673
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
674
|
+
const capability = String(item?.capability || "unknown");
|
|
675
|
+
const rawVisibility = item?.visibility;
|
|
676
|
+
if (rawVisibility !== undefined && typeof rawVisibility !== "string") invalidSourceVisibilityTypes.push(capability);
|
|
677
|
+
const visibility = typeof rawVisibility === "string" ? rawVisibility : "";
|
|
678
|
+
if (!visibility) missingSourceVisibilities.push(capability);
|
|
679
|
+
if (!allowedSourceVisibilities.has(visibility)) invalidSourceVisibilities.push(capability);
|
|
680
|
+
}
|
|
681
|
+
add("source_map_visibility_is_string", invalidSourceVisibilityTypes.length === 0, invalidSourceVisibilityTypes.length ? `visibility must be string: ${invalidSourceVisibilityTypes.join(", ")}` : "source map visibility values are strings");
|
|
682
|
+
add("source_map_visibility_declared", missingSourceVisibilities.length === 0, missingSourceVisibilities.length ? `missing visibility: ${missingSourceVisibilities.join(", ")}` : "source map capabilities declare visibility");
|
|
683
|
+
add("source_map_visibility_allowed", invalidSourceVisibilities.length === 0, invalidSourceVisibilities.length ? `invalid visibility: ${invalidSourceVisibilities.join(", ")}` : "source map visibility values are allowed");
|
|
684
|
+
add("source_map_includes_package_review", sourceCapabilities.has("s2_package_review"), sourceCapabilities.has("s2_package_review") ? "s2_package_review mapped" : "missing s2_package_review mapping");
|
|
685
|
+
add("source_map_includes_package_validation", sourceCapabilities.has("s1_skill_package_validation"), sourceCapabilities.has("s1_skill_package_validation") ? "s1_skill_package_validation mapped" : "missing s1_skill_package_validation mapping");
|
|
686
|
+
add("source_map_includes_private_monthly_loop", sourceCapabilities.has("site_agent_monthly_evidence_loop"), sourceCapabilities.has("site_agent_monthly_evidence_loop") ? "monthly loop mapped" : "missing monthly evidence loop mapping");
|
|
687
|
+
add("source_map_includes_private_install_descriptor", sourceCapabilities.has("site_agent_install_descriptor"), sourceCapabilities.has("site_agent_install_descriptor") ? "install descriptor mapped" : "missing install descriptor mapping");
|
|
688
|
+
const unmappedExampleIds = [...exampleIds].filter(id => typeof id === "string" && !sourceCapabilities.has(id)).sort();
|
|
689
|
+
add("tool_examples_have_source_map_capabilities", unmappedExampleIds.length === 0, unmappedExampleIds.length ? `unmapped examples: ${unmappedExampleIds.join(", ")}` : "tool examples are mapped in source map");
|
|
690
|
+
const sourceChecks = sourceMap?.checks || {};
|
|
691
|
+
add("source_map_public_private_split", sourceChecks.public_private_split_declared === true, sourceChecks.public_private_split_declared === true ? "public/private split declared" : "missing public/private split");
|
|
692
|
+
add("source_map_file_references", sourceChecks.all_core_capabilities_have_file_references === true, sourceChecks.all_core_capabilities_have_file_references === true ? "core capability file references declared" : "missing capability file references");
|
|
693
|
+
add("source_map_no_secret_in_public_examples", sourceChecks.no_private_secret_in_public_examples === true, sourceChecks.no_private_secret_in_public_examples === true ? "no private secret in public examples declared" : "missing public example secret check");
|
|
694
|
+
const mappedFiles = [];
|
|
695
|
+
const invalidFileArrays = [];
|
|
696
|
+
const invalidFileEntries = [];
|
|
697
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
698
|
+
const capability = String(item?.capability || "unknown");
|
|
699
|
+
if (!Array.isArray(item?.files)) {
|
|
700
|
+
invalidFileArrays.push(capability);
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
703
|
+
for (const rel of item.files) {
|
|
704
|
+
if (typeof rel !== "string") {
|
|
705
|
+
invalidFileEntries.push(capability);
|
|
706
|
+
continue;
|
|
707
|
+
}
|
|
708
|
+
mappedFiles.push(rel);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
add("source_map_files_are_arrays", invalidFileArrays.length === 0, invalidFileArrays.length ? `files must be arrays: ${invalidFileArrays.join(", ")}` : "source map files are arrays");
|
|
712
|
+
add("source_map_file_entries_are_strings", invalidFileEntries.length === 0, invalidFileEntries.length ? `file entries must be strings: ${[...new Set(invalidFileEntries)].sort().join(", ")}` : "source map file entries are strings");
|
|
713
|
+
const missingMappedFiles = [];
|
|
714
|
+
for (const rel of mappedFiles) {
|
|
715
|
+
try {
|
|
716
|
+
const dest = safePackageFilePath(root, rel);
|
|
717
|
+
if (!fs.existsSync(dest)) missingMappedFiles.push(rel);
|
|
718
|
+
} catch {
|
|
719
|
+
missingMappedFiles.push(rel);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
add("source_map_referenced_files_exist", mappedFiles.length > 0 && missingMappedFiles.length === 0, missingMappedFiles.length ? `missing or unsafe: ${missingMappedFiles.join(", ")}` : `${mappedFiles.length} mapped file references exist`);
|
|
723
|
+
|
|
724
|
+
let openapi = null;
|
|
725
|
+
try { openapi = readJsonFileIfExists(path.join(root, "agent-id.openapi.json")); } catch {}
|
|
726
|
+
const openapiPaths = new Set(Object.keys(openapi?.paths || {}));
|
|
727
|
+
const invalidSourceEndpointTypes = [];
|
|
728
|
+
const missingDeclaredEndpoints = [];
|
|
729
|
+
const mappedEndpoints = [];
|
|
730
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
731
|
+
const capability = String(item?.capability || "unknown");
|
|
732
|
+
const rawEndpoint = item?.endpoint;
|
|
733
|
+
if (rawEndpoint !== undefined && typeof rawEndpoint !== "string") invalidSourceEndpointTypes.push(capability);
|
|
734
|
+
const endpointValue = typeof rawEndpoint === "string" ? rawEndpoint : "";
|
|
735
|
+
if (!endpointValue) {
|
|
736
|
+
missingDeclaredEndpoints.push(capability);
|
|
737
|
+
} else {
|
|
738
|
+
mappedEndpoints.push(endpointValue);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
add("source_map_endpoints_declared", missingDeclaredEndpoints.length === 0, missingDeclaredEndpoints.length ? `missing endpoint: ${missingDeclaredEndpoints.join(", ")}` : "source map capabilities declare endpoints");
|
|
742
|
+
add("source_map_endpoints_are_strings", invalidSourceEndpointTypes.length === 0, invalidSourceEndpointTypes.length ? `endpoint must be string: ${invalidSourceEndpointTypes.join(", ")}` : "source map endpoints are strings");
|
|
743
|
+
const invalidExampleEndpointTypes = [];
|
|
744
|
+
const missingDeclaredExampleEndpoints = [];
|
|
745
|
+
const missingExampleEndpoints = [];
|
|
746
|
+
for (const item of examples?.examples || []) {
|
|
747
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
748
|
+
const rawEndpoint = item?.endpoint;
|
|
749
|
+
if (rawEndpoint !== undefined && typeof rawEndpoint !== "string") invalidExampleEndpointTypes.push(exampleId);
|
|
750
|
+
const endpointPath = typeof rawEndpoint === "string" ? toolExampleEndpointPath(rawEndpoint) : "";
|
|
751
|
+
if (!endpointPath) missingDeclaredExampleEndpoints.push(exampleId);
|
|
752
|
+
if (!endpointPath || !openapiPaths.has(endpointPath)) missingExampleEndpoints.push(exampleId);
|
|
753
|
+
}
|
|
754
|
+
add("tool_examples_endpoints_are_strings", invalidExampleEndpointTypes.length === 0, invalidExampleEndpointTypes.length ? `endpoint must be string: ${invalidExampleEndpointTypes.join(", ")}` : "tool example endpoints are strings");
|
|
755
|
+
add("tool_examples_endpoints_declared", missingDeclaredExampleEndpoints.length === 0, missingDeclaredExampleEndpoints.length ? `missing endpoint: ${missingDeclaredExampleEndpoints.join(", ")}` : "tool examples declare endpoints");
|
|
756
|
+
add("tool_examples_endpoints_exist", missingExampleEndpoints.length === 0, missingExampleEndpoints.length ? `missing from OpenAPI: ${missingExampleEndpoints.join(", ")}` : "tool example endpoints exist in OpenAPI");
|
|
757
|
+
const requiredOpenapiMethods = new Map([
|
|
758
|
+
["GET", new Set(["get"])],
|
|
759
|
+
["POST", new Set(["post"])],
|
|
760
|
+
["GET_OR_POST", new Set(["get", "post"])],
|
|
761
|
+
["GET_OR_PRIVATE_POST", new Set(["get", "post"])],
|
|
762
|
+
]);
|
|
763
|
+
const methodMismatches = [];
|
|
764
|
+
const openapiPathMap = openapi?.paths || {};
|
|
765
|
+
for (const item of examples?.examples || []) {
|
|
766
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
767
|
+
const method = typeof item?.method === "string" ? item.method : "";
|
|
768
|
+
const requiredMethods = requiredOpenapiMethods.get(method);
|
|
769
|
+
const endpointPath = toolExampleEndpointPath(item?.endpoint);
|
|
770
|
+
if (!requiredMethods || !endpointPath || !openapiPathMap[endpointPath]) continue;
|
|
771
|
+
const availableMethods = new Set(Object.keys(openapiPathMap[endpointPath] || {}).map(key => key.toLowerCase()));
|
|
772
|
+
const missing = [...requiredMethods].filter(methodName => !availableMethods.has(methodName));
|
|
773
|
+
if (missing.length) methodMismatches.push(exampleId);
|
|
774
|
+
}
|
|
775
|
+
add("tool_examples_methods_match_openapi", methodMismatches.length === 0, methodMismatches.length ? `method missing from OpenAPI path: ${methodMismatches.join(", ")}` : "tool example methods match OpenAPI paths");
|
|
776
|
+
const missingEndpoints = [];
|
|
777
|
+
for (const endpointValue of mappedEndpoints) {
|
|
778
|
+
let endpointPath = endpointValue;
|
|
779
|
+
try { endpointPath = new URL(endpointValue).pathname; } catch {}
|
|
780
|
+
if (!openapiPaths.has(endpointPath)) missingEndpoints.push(endpointValue);
|
|
781
|
+
}
|
|
782
|
+
add("source_map_endpoints_exist", mappedEndpoints.length > 0 && missingEndpoints.length === 0, missingEndpoints.length ? `missing from OpenAPI: ${missingEndpoints.join(", ")}` : `${mappedEndpoints.length} mapped endpoints exist in OpenAPI`);
|
|
783
|
+
|
|
784
|
+
let mcp = null;
|
|
785
|
+
try { mcp = readJsonFileIfExists(path.join(root, "agent-id.mcp.json")); } catch {}
|
|
786
|
+
const mcpToolRows = Array.isArray(mcp?.tools) ? mcp.tools.filter(item => item && typeof item === "object") : [];
|
|
787
|
+
const mcpTools = new Set(mcpToolRows.map(item => item?.name).filter(name => typeof name === "string"));
|
|
788
|
+
const mcpToolsByName = new Map(mcpToolRows.filter(item => typeof item?.name === "string").map(item => [item.name, item]));
|
|
789
|
+
add("mcp_manifest_schema", mcp?.schema === "agentx-s1-mcp-manifest-v0.1", mcp?.schema || "missing or invalid schema");
|
|
790
|
+
const missingMcpInputSchemas = [];
|
|
791
|
+
const invalidMcpInputSchemas = [];
|
|
792
|
+
for (const item of mcpToolRows) {
|
|
793
|
+
const name = String(item?.name || "unknown");
|
|
794
|
+
const schema = item?.inputSchema;
|
|
795
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
|
|
796
|
+
missingMcpInputSchemas.push(name);
|
|
797
|
+
invalidMcpInputSchemas.push(name);
|
|
798
|
+
continue;
|
|
799
|
+
}
|
|
800
|
+
const properties = schema.properties;
|
|
801
|
+
const required = schema.required;
|
|
802
|
+
const requiredIsValid = required === undefined || (Array.isArray(required) && required.every(value => typeof value === "string"));
|
|
803
|
+
if (schema.type !== "object" || !properties || typeof properties !== "object" || Array.isArray(properties) || !requiredIsValid) invalidMcpInputSchemas.push(name);
|
|
804
|
+
}
|
|
805
|
+
add("mcp_tools_declare_input_schema", missingMcpInputSchemas.length === 0, missingMcpInputSchemas.length ? `missing inputSchema: ${missingMcpInputSchemas.join(", ")}` : "MCP tools declare inputSchema");
|
|
806
|
+
add("mcp_input_schemas_are_objects", invalidMcpInputSchemas.length === 0, invalidMcpInputSchemas.length ? `invalid inputSchema: ${invalidMcpInputSchemas.join(", ")}` : "MCP inputSchemas are object schemas");
|
|
807
|
+
const scopedPublicProperties = {
|
|
808
|
+
audit_url: ["url"],
|
|
809
|
+
w1_workflow_router: ["url", "intent", "evidence"],
|
|
810
|
+
s2_package_review: ["url", "public_metadata", "setup_metadata"],
|
|
811
|
+
s1_skill_package_validation: ["url", "package"],
|
|
812
|
+
marketplace_submission_pack: ["url", "public_metadata", "setup_metadata"],
|
|
813
|
+
marketplace_readiness_score: ["url", "submission", "public_metadata", "setup_metadata"],
|
|
814
|
+
marketplace_approval_receipts: ["url", "platform_id", "status", "listing_url", "platform_receipt_id", "proof_url"],
|
|
815
|
+
google_marketplace_agent_card: ["url", "product_metadata"],
|
|
816
|
+
google_marketplace_submission_pack: ["url", "product_metadata", "setup_metadata"],
|
|
817
|
+
google_marketplace_readiness_score: ["url", "submission", "product_metadata", "setup_metadata"],
|
|
818
|
+
google_marketplace_develop_flow_gate: ["url", "setup_metadata", "product_metadata", "pricing_metadata"],
|
|
819
|
+
google_marketplace_listing_requirements_gate: ["url", "product_metadata", "setup_metadata"],
|
|
820
|
+
google_marketplace_listing_pack: ["url", "product_metadata"],
|
|
821
|
+
google_marketplace_discovery_metadata_gate: ["url", "product_metadata"],
|
|
822
|
+
google_marketplace_product_details_review_gate: ["url", "product_metadata", "setup_metadata"],
|
|
823
|
+
google_marketplace_technical_integration_pack: ["url", "setup_metadata", "pricing_metadata"],
|
|
824
|
+
google_marketplace_backend_gate: ["url", "setup_metadata", "pricing_metadata"],
|
|
825
|
+
google_marketplace_lifecycle_smoke: ["url", "provider_id", "account_id", "entitlement_id"],
|
|
826
|
+
google_marketplace_runtime_smoke: ["url", "provider_id", "account_id", "entitlement_id", "pricing_model"],
|
|
827
|
+
google_marketplace_runtime_receipt: ["url", "evidence_type", "evidence", "jwt", "token_context", "expected_audience", "expected_email", "certs", "payload", "execution", "store", "pricing_metadata"],
|
|
828
|
+
google_marketplace_runtime_evidence_ledger: ["url", "receipt", "receipts", "pricing_metadata"],
|
|
829
|
+
google_marketplace_runtime_evidence_gate: ["url", "setup_metadata", "pricing_metadata"],
|
|
830
|
+
google_marketplace_test_billing_gate: ["url", "setup_metadata", "pricing_metadata"],
|
|
831
|
+
google_marketplace_agent_card_validation_gate: ["url", "product_metadata", "setup_metadata"],
|
|
832
|
+
google_marketplace_agent_card_gcs_upload_pack: ["url", "product_metadata", "setup_metadata"],
|
|
833
|
+
google_marketplace_review_bundle: ["url", "product_metadata", "setup_metadata", "pricing_metadata"],
|
|
834
|
+
google_marketplace_review_index: ["url", "product_metadata", "setup_metadata", "pricing_metadata"],
|
|
835
|
+
google_marketplace_core_technology_source_map: ["url"],
|
|
836
|
+
google_marketplace_application_status: ["url", "setup_metadata", "product_metadata", "pricing_metadata"],
|
|
837
|
+
google_marketplace_application_evidence: ["url", "setup_metadata", "product_metadata", "pricing_metadata"],
|
|
838
|
+
google_marketplace_partner_application_gate: ["url", "setup_metadata"],
|
|
839
|
+
google_marketplace_operations_gate: ["url", "setup_metadata"],
|
|
840
|
+
google_marketplace_ops_identity_gate: ["url", "setup_metadata", "pricing_metadata"],
|
|
841
|
+
google_marketplace_cloud_run_deployment_gate: ["url", "setup_metadata", "pricing_metadata"],
|
|
842
|
+
google_marketplace_live_surface_gate: ["url"],
|
|
843
|
+
google_marketplace_preflight_check: ["url", "setup_metadata", "product_metadata", "pricing_metadata"],
|
|
844
|
+
google_marketplace_publish_gate: ["url", "setup_metadata"],
|
|
845
|
+
google_marketplace_review_receipt_gate: ["url", "setup_metadata"],
|
|
846
|
+
google_marketplace_evidence_template: ["url"],
|
|
847
|
+
google_marketplace_evidence_example: ["url"],
|
|
848
|
+
google_marketplace_procurement_event: ["procurement_event"],
|
|
849
|
+
google_marketplace_procurement_execute: ["action", "execute"],
|
|
850
|
+
google_marketplace_usage_report_payload: ["service_name", "usage_reporting_id", "metric_name", "metric_value", "start_time", "end_time", "operation_id", "user_labels"],
|
|
851
|
+
google_marketplace_usage_report_execute: ["payload", "execute"],
|
|
852
|
+
google_marketplace_account_link: ["jwt", "claims", "signature_verified", "expected_audience"],
|
|
853
|
+
google_marketplace_jwt_verifier_gate: ["url", "setup_metadata", "jwt", "token_context"],
|
|
854
|
+
agent_checkout: ["plan"],
|
|
855
|
+
aeo_job_create: ["url", "job_type", "provider", "evaluator", "budget", "currency"],
|
|
856
|
+
aeo_job_fund: ["job_id", "payment_reference"],
|
|
857
|
+
aeo_job_payment_quote: ["job_id"],
|
|
858
|
+
aeo_job_payment_proof: ["job_id", "payment_proof", "payment_signature"],
|
|
859
|
+
aeo_job_submit: ["job_id", "provider", "deliverable_uri", "deliverable"],
|
|
860
|
+
aeo_job_evaluate: ["job_id", "evaluator", "decision", "reason"],
|
|
861
|
+
register_site_agent: ["url", "email"],
|
|
862
|
+
verify_domain_ownership: ["url", "method"],
|
|
863
|
+
};
|
|
864
|
+
const measurementProperties = {
|
|
865
|
+
a1_ai_reads: ["url", "events", "logs", "user_agent", "status"],
|
|
866
|
+
a1_ai_read_dashboard: ["url", "events", "logs", "period"],
|
|
867
|
+
a1_ai_read_evidence_package: ["url", "events", "logs", "period"],
|
|
868
|
+
a2_ai_citations: ["url", "target_url", "probes", "prompt", "answer", "citations", "engine", "competitors"],
|
|
869
|
+
a2_ai_citation_evidence_package: ["url", "probes", "events", "probe_set", "period", "verify_artifacts"],
|
|
870
|
+
a2_probe_sets: ["url", "topics", "engines", "market", "cadence"],
|
|
871
|
+
b1_conversions: ["url", "events", "conversions", "event", "referrer", "survey_source", "value", "currency"],
|
|
872
|
+
b1_conversion_evidence_package: ["url", "events", "conversions", "period"],
|
|
873
|
+
g1_google_official: ["url", "fetch", "report", "reports", "result", "results"],
|
|
874
|
+
g2_google_delta: ["url", "before", "after", "report", "reports", "result", "results"],
|
|
875
|
+
g3_google_verification_plan: ["url", "audit"],
|
|
876
|
+
};
|
|
877
|
+
const overbroadKeyPublicSchemas = [];
|
|
878
|
+
for (const [name, expected] of Object.entries(scopedPublicProperties)) {
|
|
879
|
+
if (!mcpToolsByName.has(name)) continue;
|
|
880
|
+
const row = mcpToolsByName.get(name) || {};
|
|
881
|
+
const schema = row.inputSchema && typeof row.inputSchema === "object" && !Array.isArray(row.inputSchema) ? row.inputSchema : {};
|
|
882
|
+
const properties = schema.properties && typeof schema.properties === "object" && !Array.isArray(schema.properties) ? Object.keys(schema.properties).sort() : [];
|
|
883
|
+
const expectedSorted = [...expected].sort();
|
|
884
|
+
if (properties.join("\u0000") !== expectedSorted.join("\u0000")) overbroadKeyPublicSchemas.push(name);
|
|
885
|
+
}
|
|
886
|
+
add("mcp_key_public_tool_schemas_are_scoped", overbroadKeyPublicSchemas.length === 0, overbroadKeyPublicSchemas.length ? `unscoped public MCP schemas: ${overbroadKeyPublicSchemas.join(", ")}` : "key public MCP tool schemas are scoped");
|
|
887
|
+
const overbroadMeasurementSchemas = [];
|
|
888
|
+
for (const [name, expected] of Object.entries(measurementProperties)) {
|
|
889
|
+
if (!mcpToolsByName.has(name)) continue;
|
|
890
|
+
const row = mcpToolsByName.get(name) || {};
|
|
891
|
+
const schema = row.inputSchema && typeof row.inputSchema === "object" && !Array.isArray(row.inputSchema) ? row.inputSchema : {};
|
|
892
|
+
const properties = schema.properties && typeof schema.properties === "object" && !Array.isArray(schema.properties) ? Object.keys(schema.properties).sort() : [];
|
|
893
|
+
const expectedSorted = [...expected].sort();
|
|
894
|
+
if (properties.join("\u0000") !== expectedSorted.join("\u0000")) overbroadMeasurementSchemas.push(name);
|
|
895
|
+
}
|
|
896
|
+
add("mcp_measurement_tool_schemas_are_scoped", overbroadMeasurementSchemas.length === 0, overbroadMeasurementSchemas.length ? `unscoped measurement MCP schemas: ${overbroadMeasurementSchemas.join(", ")}` : "measurement MCP tool schemas are scoped");
|
|
897
|
+
const invalidExampleToolTypes = [];
|
|
898
|
+
const missingDeclaredExampleTools = [];
|
|
899
|
+
const missingExampleTools = [];
|
|
900
|
+
for (const item of examples?.examples || []) {
|
|
901
|
+
const exampleId = String(item?.id || item?.tool || "unknown");
|
|
902
|
+
const rawTool = item?.tool;
|
|
903
|
+
if (rawTool !== undefined && typeof rawTool !== "string") invalidExampleToolTypes.push(exampleId);
|
|
904
|
+
const toolName = typeof rawTool === "string" ? rawTool : "";
|
|
905
|
+
if (!toolName) missingDeclaredExampleTools.push(exampleId);
|
|
906
|
+
if (!toolName || !mcpTools.has(toolName)) missingExampleTools.push(exampleId);
|
|
907
|
+
}
|
|
908
|
+
add("tool_examples_tools_are_strings", invalidExampleToolTypes.length === 0, invalidExampleToolTypes.length ? `tool must be string: ${invalidExampleToolTypes.join(", ")}` : "tool example tools are strings");
|
|
909
|
+
add("tool_examples_tools_declared", missingDeclaredExampleTools.length === 0, missingDeclaredExampleTools.length ? `missing tool: ${missingDeclaredExampleTools.join(", ")}` : "tool examples declare tools");
|
|
910
|
+
add("tool_examples_mcp_tools_exist", missingExampleTools.length === 0, missingExampleTools.length ? `missing from MCP manifest: ${missingExampleTools.join(", ")}` : "tool example MCP tools exist");
|
|
911
|
+
const invalidSourceMcpToolTypes = [];
|
|
912
|
+
const mappedTools = [];
|
|
913
|
+
const missingDeclaredMcpTools = [];
|
|
914
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
915
|
+
const capability = String(item?.capability || "unknown");
|
|
916
|
+
const rawMcpTool = item?.mcp_tool;
|
|
917
|
+
if (rawMcpTool !== undefined && typeof rawMcpTool !== "string") invalidSourceMcpToolTypes.push(capability);
|
|
918
|
+
const mcpTool = typeof rawMcpTool === "string" ? rawMcpTool : "";
|
|
919
|
+
if (!mcpTool) missingDeclaredMcpTools.push(capability);
|
|
920
|
+
else mappedTools.push(mcpTool);
|
|
921
|
+
}
|
|
922
|
+
const missingTools = mappedTools.filter(name => !mcpTools.has(name));
|
|
923
|
+
add("source_map_mcp_tools_exist", mappedTools.length > 0 && missingTools.length === 0, missingTools.length ? `missing from MCP manifest: ${missingTools.join(", ")}` : `${mappedTools.length} mapped MCP tools exist`);
|
|
924
|
+
add("source_map_mcp_tools_declared", missingDeclaredMcpTools.length === 0, missingDeclaredMcpTools.length ? `missing mcp_tool: ${missingDeclaredMcpTools.join(", ")}` : "source map capabilities declare MCP tools");
|
|
925
|
+
add("source_map_mcp_tools_are_strings", invalidSourceMcpToolTypes.length === 0, invalidSourceMcpToolTypes.length ? `mcp_tool must be string: ${invalidSourceMcpToolTypes.join(", ")}` : "source map MCP tools are strings");
|
|
926
|
+
const privateMcpTools = new Set();
|
|
927
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
928
|
+
if (typeof item?.mcp_tool === "string" && String(item?.visibility || "").startsWith("private")) privateMcpTools.add(item.mcp_tool);
|
|
929
|
+
}
|
|
930
|
+
for (const item of mcpToolRows) {
|
|
931
|
+
const requires = Array.isArray(item?.requires) ? item.requires.filter(value => typeof value === "string") : [];
|
|
932
|
+
if (typeof item?.name === "string" && requires.includes("site_agent_key")) privateMcpTools.add(item.name);
|
|
933
|
+
}
|
|
934
|
+
const privateWithoutSchema = [];
|
|
935
|
+
const privateMissingRequired = [];
|
|
936
|
+
const privateMissingProperties = [];
|
|
937
|
+
for (const name of [...privateMcpTools].sort()) {
|
|
938
|
+
const row = mcpToolsByName.get(name);
|
|
939
|
+
if (!row) continue;
|
|
940
|
+
const schema = row.inputSchema;
|
|
941
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
|
|
942
|
+
privateWithoutSchema.push(name);
|
|
943
|
+
privateMissingRequired.push(name);
|
|
944
|
+
privateMissingProperties.push(name);
|
|
945
|
+
continue;
|
|
946
|
+
}
|
|
947
|
+
const required = Array.isArray(schema.required) ? schema.required.filter(value => typeof value === "string") : [];
|
|
948
|
+
const properties = schema.properties && typeof schema.properties === "object" && !Array.isArray(schema.properties) ? schema.properties : {};
|
|
949
|
+
if (!required.includes("url") || !required.includes("agent_key")) privateMissingRequired.push(name);
|
|
950
|
+
const urlType = properties.url && typeof properties.url === "object" ? properties.url.type : undefined;
|
|
951
|
+
const keyType = properties.agent_key && typeof properties.agent_key === "object" ? properties.agent_key.type : undefined;
|
|
952
|
+
if (urlType !== "string" || keyType !== "string") privateMissingProperties.push(name);
|
|
953
|
+
}
|
|
954
|
+
add("mcp_private_tools_declare_input_schema", privateWithoutSchema.length === 0, privateWithoutSchema.length ? `missing inputSchema: ${privateWithoutSchema.join(", ")}` : "private MCP tools declare inputSchema");
|
|
955
|
+
add("mcp_private_tools_require_url_and_agent_key", privateMissingRequired.length === 0, privateMissingRequired.length ? `missing required url/agent_key: ${privateMissingRequired.join(", ")}` : "private MCP tools require url and agent_key");
|
|
956
|
+
add("mcp_private_tools_declare_url_and_agent_key_properties", privateMissingProperties.length === 0, privateMissingProperties.length ? `missing string url/agent_key properties: ${privateMissingProperties.join(", ")}` : "private MCP tools declare url and agent_key properties");
|
|
957
|
+
const privateMissingFixedActions = [];
|
|
958
|
+
for (const name of [...privateMcpTools].sort()) {
|
|
959
|
+
const action = siteAgentFixedActionForTool(name);
|
|
960
|
+
if (!action) continue;
|
|
961
|
+
const row = mcpToolsByName.get(name);
|
|
962
|
+
if (!row) continue;
|
|
963
|
+
const schema = row.inputSchema && typeof row.inputSchema === "object" && !Array.isArray(row.inputSchema) ? row.inputSchema : {};
|
|
964
|
+
const properties = schema.properties && typeof schema.properties === "object" && !Array.isArray(schema.properties) ? schema.properties : {};
|
|
965
|
+
const actionSchema = properties.action && typeof properties.action === "object" && !Array.isArray(properties.action) ? properties.action : {};
|
|
966
|
+
const required = Array.isArray(schema.required) ? schema.required.filter(value => typeof value === "string") : [];
|
|
967
|
+
if (actionSchema.const !== action || !required.includes("action")) privateMissingFixedActions.push(name);
|
|
968
|
+
}
|
|
969
|
+
add("mcp_private_named_tools_declare_fixed_action", privateMissingFixedActions.length === 0, privateMissingFixedActions.length ? `missing fixed action schema: ${privateMissingFixedActions.join(", ")}` : "private named MCP tools declare fixed action");
|
|
970
|
+
|
|
971
|
+
const examplesById = new Map((examples?.examples || []).map(item => [item?.id, item]));
|
|
972
|
+
const normalizeEndpointPath = value => {
|
|
973
|
+
const raw = String(value || "");
|
|
974
|
+
if (!raw) return "";
|
|
975
|
+
try { return new URL(raw).pathname; } catch {}
|
|
976
|
+
return raw;
|
|
977
|
+
};
|
|
978
|
+
const missingMappedExamples = [];
|
|
979
|
+
const endpointMismatches = [];
|
|
980
|
+
const toolMismatches = [];
|
|
981
|
+
const visibilityMismatches = [];
|
|
982
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
983
|
+
const capability = String(item?.capability || "");
|
|
984
|
+
if (!capability) continue;
|
|
985
|
+
const example = examplesById.get(capability);
|
|
986
|
+
if (!example) {
|
|
987
|
+
missingMappedExamples.push(capability);
|
|
988
|
+
continue;
|
|
989
|
+
}
|
|
990
|
+
const expectedEndpoint = normalizeEndpointPath(item?.endpoint);
|
|
991
|
+
const actualEndpoint = normalizeEndpointPath(example?.endpoint);
|
|
992
|
+
if (expectedEndpoint && expectedEndpoint !== actualEndpoint) endpointMismatches.push(capability);
|
|
993
|
+
const expectedTool = String(item?.mcp_tool || "");
|
|
994
|
+
const actualTool = String(example?.tool || "");
|
|
995
|
+
if (expectedTool && expectedTool !== actualTool) toolMismatches.push(capability);
|
|
996
|
+
const expectedVisibility = String(item?.visibility || "");
|
|
997
|
+
const actualVisibility = String(example?.visibility || "");
|
|
998
|
+
if (expectedVisibility && expectedVisibility !== actualVisibility) visibilityMismatches.push(capability);
|
|
999
|
+
}
|
|
1000
|
+
add("source_map_examples_exist", missingMappedExamples.length === 0, missingMappedExamples.length ? `missing examples: ${missingMappedExamples.join(", ")}` : "all mapped capabilities have tool examples");
|
|
1001
|
+
add("source_map_examples_match_endpoints", endpointMismatches.length === 0, endpointMismatches.length ? `endpoint mismatch: ${endpointMismatches.join(", ")}` : "source map endpoints match tool examples");
|
|
1002
|
+
add("source_map_examples_match_tools", toolMismatches.length === 0, toolMismatches.length ? `tool mismatch: ${toolMismatches.join(", ")}` : "source map MCP tools match tool examples");
|
|
1003
|
+
add("source_map_examples_match_visibility", visibilityMismatches.length === 0, visibilityMismatches.length ? `visibility mismatch: ${visibilityMismatches.join(", ")}` : "source map visibility matches tool examples");
|
|
1004
|
+
|
|
1005
|
+
const missingPrivateRequirements = [];
|
|
1006
|
+
const publicWithPrivateKey = [];
|
|
1007
|
+
const privateSourceBadEndpoint = [];
|
|
1008
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
1009
|
+
const capability = String(item?.capability || "");
|
|
1010
|
+
const visibility = String(item?.visibility || "");
|
|
1011
|
+
const example = examplesById.get(capability) || {};
|
|
1012
|
+
const requires = new Set((example?.requires || []).map(value => String(value || "")));
|
|
1013
|
+
if (visibility.startsWith("private")) {
|
|
1014
|
+
if (!requires.has("verified_domain") || !requires.has("site_agent_key")) missingPrivateRequirements.push(capability);
|
|
1015
|
+
if (normalizeEndpointPath(item?.endpoint) !== "/api/site_agents/call") privateSourceBadEndpoint.push(capability);
|
|
1016
|
+
} else if (!visibility.startsWith("private") && requires.has("site_agent_key")) {
|
|
1017
|
+
publicWithPrivateKey.push(capability);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
add("source_map_private_capabilities_require_site_agent_key", missingPrivateRequirements.length === 0, missingPrivateRequirements.length ? `missing private requirements: ${missingPrivateRequirements.join(", ")}` : "private capabilities require verified_domain and site_agent_key");
|
|
1021
|
+
add("source_map_private_capabilities_use_site_agents_call_endpoint", privateSourceBadEndpoint.length === 0, privateSourceBadEndpoint.length ? `private capabilities must use /api/site_agents/call: ${privateSourceBadEndpoint.join(", ")}` : "private capabilities use /api/site_agents/call");
|
|
1022
|
+
add("source_map_public_capabilities_do_not_require_site_agent_key", publicWithPrivateKey.length === 0, publicWithPrivateKey.length ? `public capabilities require Site Agent Key: ${publicWithPrivateKey.join(", ")}` : "public capabilities do not require Site Agent Key");
|
|
1023
|
+
|
|
1024
|
+
const missingClaimBoundaries = [];
|
|
1025
|
+
const boundaryMismatches = [];
|
|
1026
|
+
const invalidClaimBoundaryArrays = [];
|
|
1027
|
+
const invalidClaimBoundaryEntries = [];
|
|
1028
|
+
for (const item of sourceMap?.capability_map || []) {
|
|
1029
|
+
const capability = String(item?.capability || "");
|
|
1030
|
+
const visibility = String(item?.visibility || "");
|
|
1031
|
+
const rawBoundaries = item?.claim_boundaries;
|
|
1032
|
+
if (!Array.isArray(rawBoundaries)) invalidClaimBoundaryArrays.push(capability);
|
|
1033
|
+
const boundaries = [];
|
|
1034
|
+
if (Array.isArray(rawBoundaries)) {
|
|
1035
|
+
for (const value of rawBoundaries) {
|
|
1036
|
+
if (typeof value !== "string") {
|
|
1037
|
+
invalidClaimBoundaryEntries.push(capability);
|
|
1038
|
+
continue;
|
|
1039
|
+
}
|
|
1040
|
+
if (value) boundaries.push(value);
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
if (boundaries.length === 0) missingClaimBoundaries.push(capability);
|
|
1044
|
+
if (boundaries.length) {
|
|
1045
|
+
const example = examplesById.get(capability) || {};
|
|
1046
|
+
const exampleBoundary = String(example?.claim_boundary || "");
|
|
1047
|
+
if (!boundaries.some(boundary => exampleBoundary.includes(boundary))) boundaryMismatches.push(capability);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
add("source_map_claim_boundaries_are_arrays", invalidClaimBoundaryArrays.length === 0, invalidClaimBoundaryArrays.length ? `claim_boundaries must be arrays: ${invalidClaimBoundaryArrays.join(", ")}` : "source map claim boundaries are arrays");
|
|
1051
|
+
add("source_map_claim_boundary_entries_are_strings", invalidClaimBoundaryEntries.length === 0, invalidClaimBoundaryEntries.length ? `claim boundary entries must be strings: ${[...new Set(invalidClaimBoundaryEntries)].sort().join(", ")}` : "source map claim boundary entries are strings");
|
|
1052
|
+
add("source_map_claim_boundaries_declared", missingClaimBoundaries.length === 0, missingClaimBoundaries.length ? `missing claim boundaries: ${missingClaimBoundaries.join(", ")}` : "all mapped capabilities declare claim boundaries");
|
|
1053
|
+
add("source_map_claim_boundaries_match_examples", boundaryMismatches.length === 0, boundaryMismatches.length ? `examples missing matching claim boundary: ${boundaryMismatches.join(", ")}` : "tool examples reflect source map claim boundaries");
|
|
1054
|
+
|
|
1055
|
+
const passed = checks.filter(item => item.status === "pass").length;
|
|
1056
|
+
return {
|
|
1057
|
+
schema: "agentx-s1-package-validation-v0.1",
|
|
1058
|
+
ok: passed === checks.length,
|
|
1059
|
+
package_dir: root,
|
|
1060
|
+
checked_files: checkedFiles,
|
|
1061
|
+
summary: { pass: passed, fail: checks.length - passed, total: checks.length },
|
|
1062
|
+
passed_checks: checks.filter(item => item.status === "pass").map(item => item.id),
|
|
1063
|
+
checks,
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
function contentWorkflowReviewInputs(pkg) {
|
|
1068
|
+
const schema = pkg?.schema || "";
|
|
1069
|
+
if (schema === "agentx-content-optimization-pack-v0.1") {
|
|
1070
|
+
const modules = pkg.modules || {};
|
|
1071
|
+
const nonClaims = [
|
|
1072
|
+
...(Array.isArray(pkg.non_claims) ? pkg.non_claims : []),
|
|
1073
|
+
...(Array.isArray(modules.c4_content_workflow_package?.non_claims) ? modules.c4_content_workflow_package.non_claims : []),
|
|
1074
|
+
...(Array.isArray(modules.c1_content_optimization_plan?.non_claims) ? modules.c1_content_optimization_plan.non_claims : []),
|
|
1075
|
+
...(Array.isArray(modules.c2_prompt_test_run_sheet?.non_claims) ? modules.c2_prompt_test_run_sheet.non_claims : [])
|
|
1076
|
+
];
|
|
1077
|
+
return {
|
|
1078
|
+
schema,
|
|
1079
|
+
plan: modules.c1_content_optimization_plan || {},
|
|
1080
|
+
workflow: modules.c4_content_workflow_package || {},
|
|
1081
|
+
promptSheet: modules.c2_prompt_test_run_sheet || {},
|
|
1082
|
+
nonClaims: [...new Set(nonClaims)].sort()
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
const artifacts = pkg?.artifacts || {};
|
|
1086
|
+
const nonClaims = [
|
|
1087
|
+
...(Array.isArray(pkg?.non_claims) ? pkg.non_claims : []),
|
|
1088
|
+
...(Array.isArray(artifacts.c1_content_optimization_plan?.non_claims) ? artifacts.c1_content_optimization_plan.non_claims : []),
|
|
1089
|
+
...(Array.isArray(artifacts.c2_prompt_test_run_sheet?.non_claims) ? artifacts.c2_prompt_test_run_sheet.non_claims : [])
|
|
1090
|
+
];
|
|
1091
|
+
return {
|
|
1092
|
+
schema,
|
|
1093
|
+
plan: artifacts.c1_content_optimization_plan || {},
|
|
1094
|
+
workflow: pkg || {},
|
|
1095
|
+
promptSheet: artifacts.c2_prompt_test_run_sheet || {},
|
|
1096
|
+
nonClaims: [...new Set(nonClaims)].sort()
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
function competitorScoresAreEvidenceSafe(plan) {
|
|
1101
|
+
for (const row of (plan?.citation_gap_matrix || [])) {
|
|
1102
|
+
if (!row || row.role !== "competitor") continue;
|
|
1103
|
+
for (const value of Object.values(row.scores || {})) {
|
|
1104
|
+
if (typeof value === "number") return false;
|
|
1105
|
+
if (typeof value === "string" && /^\d+(\.\d+)?$/.test(value.trim())) return false;
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
return true;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
function reviewContentWorkflowPackage(pkg) {
|
|
1112
|
+
const input = contentWorkflowReviewInputs(pkg || {});
|
|
1113
|
+
const requiredSteps = [
|
|
1114
|
+
"parse_profile",
|
|
1115
|
+
"map_questions_to_answers",
|
|
1116
|
+
"rewrite_for_aeo",
|
|
1117
|
+
"schema_and_entity_guidance",
|
|
1118
|
+
"citation_gap_and_community_plan",
|
|
1119
|
+
"thirty_day_visibility_plan"
|
|
1120
|
+
];
|
|
1121
|
+
const requiredProducts = new Set([
|
|
1122
|
+
"content_diagnosis",
|
|
1123
|
+
"question_answer_coverage",
|
|
1124
|
+
"answer_first_rewrite",
|
|
1125
|
+
"schema_guidance",
|
|
1126
|
+
"community_citation_plan",
|
|
1127
|
+
"citation_gap_matrix"
|
|
1128
|
+
]);
|
|
1129
|
+
const requiredFiles = new Set([
|
|
1130
|
+
"content-diagnosis.md",
|
|
1131
|
+
"answer-first-rewrite.md",
|
|
1132
|
+
"schema-guidance.json",
|
|
1133
|
+
"community-citation-plan.md",
|
|
1134
|
+
"citation-gap-matrix.json",
|
|
1135
|
+
"30-day-visibility-plan.md",
|
|
1136
|
+
"prompt-test-run-sheet.json"
|
|
1137
|
+
]);
|
|
1138
|
+
const plan = input.plan || {};
|
|
1139
|
+
const workflow = input.workflow || {};
|
|
1140
|
+
const promptSheet = input.promptSheet || {};
|
|
1141
|
+
const nonClaims = input.nonClaims || [];
|
|
1142
|
+
const measurementReqs = new Set(plan.measurement_protocol?.requirements || []);
|
|
1143
|
+
const stepIds = (plan.six_step_workflow || workflow.workflow_steps || []).map(item => item && item.id).filter(Boolean);
|
|
1144
|
+
const workProducts = new Set(plan.work_products || []);
|
|
1145
|
+
const filePaths = new Set((workflow.package_manifest || []).map(item => item && item.path).filter(Boolean));
|
|
1146
|
+
const checks = [];
|
|
1147
|
+
const add = (section, id, ok, evidence) => checks.push({ section, id, status: ok ? "pass" : "fail", evidence });
|
|
1148
|
+
add("purpose_capability", "content_schema_supported", ["agentx-content-optimization-pack-v0.1", "agentx-c4-content-workflow-package-v0.1"].includes(input.schema), input.schema || "missing schema");
|
|
1149
|
+
add("purpose_capability", "c1_plan_present", plan.schema === "agentx-c1-content-optimization-plan-v0.1", plan.schema || "missing C1 plan");
|
|
1150
|
+
add("purpose_capability", "c4_package_present", workflow.schema === "agentx-c4-content-workflow-package-v0.1", workflow.schema || "missing C4 package");
|
|
1151
|
+
add("purpose_capability", "c2_prompt_sheet_present", promptSheet.schema === "agentx-c2-prompt-test-run-sheet-v0.1", promptSheet.schema || "missing C2 prompt sheet");
|
|
1152
|
+
add("purpose_capability", "six_step_workflow_complete", JSON.stringify(stepIds) === JSON.stringify(requiredSteps), stepIds);
|
|
1153
|
+
add("purpose_capability", "work_products_complete", [...requiredProducts].every(item => workProducts.has(item)), [...workProducts].sort());
|
|
1154
|
+
add("purpose_capability", "deliverable_files_complete", [...requiredFiles].every(item => filePaths.has(item)), [...filePaths].sort());
|
|
1155
|
+
add("instruction_scope", "manual_measurement_required", measurementReqs.has("manual_prompt_test_required") || nonClaims.includes("does_not_run_ai_engines") || nonClaims.includes("does_not_run_real_ai_engines"), [...measurementReqs].sort());
|
|
1156
|
+
add("instruction_scope", "no_external_service_claim", nonClaims.includes("does_not_run_real_ai_engines") || nonClaims.includes("does_not_run_ai_engines"), nonClaims);
|
|
1157
|
+
add("credentials", "no_credentials_required_for_review", !(pkg || {}).credentials_required, "review is local and does not require credentials");
|
|
1158
|
+
add("persistence_privilege", "no_background_mutation_claim", nonClaims.includes("requires_owner_review_before_publication") || nonClaims.includes("does_not_modify_customer_site") || nonClaims.includes("does_not_mutate_customer_site"), nonClaims);
|
|
1159
|
+
add("evidence_claims", "no_fabricated_statistics", nonClaims.includes("does_not_fabricate_statistics"), nonClaims);
|
|
1160
|
+
add("evidence_claims", "no_fabricated_competitor_scores", competitorScoresAreEvidenceSafe(plan), "competitor rows must stay manual_check_required unless evidence is supplied");
|
|
1161
|
+
add("evidence_claims", "no_ai_citation_guarantee", nonClaims.includes("does_not_guarantee_ai_citation_or_ranking"), nonClaims);
|
|
1162
|
+
const pass = checks.filter(item => item.status === "pass").length;
|
|
1163
|
+
const sections = ["purpose_capability", "instruction_scope", "credentials", "persistence_privilege", "evidence_claims"].map(id => {
|
|
1164
|
+
const own = checks.filter(item => item.section === id);
|
|
1165
|
+
return { id, status: own.length && own.every(item => item.status === "pass") ? "pass" : "fail", checks: own.map(item => item.id) };
|
|
1166
|
+
});
|
|
1167
|
+
return {
|
|
1168
|
+
schema: "agentx-c5-content-workflow-review-v0.1",
|
|
1169
|
+
ok: pass === checks.length,
|
|
1170
|
+
review_status: pass === checks.length ? "reviewed" : "needs_revision",
|
|
1171
|
+
summary: { pass, fail: checks.length - pass, total: checks.length },
|
|
1172
|
+
sections,
|
|
1173
|
+
passed_checks: checks.filter(item => item.status === "pass").map(item => item.id),
|
|
1174
|
+
failed_checks: checks.filter(item => item.status === "fail").map(item => item.id),
|
|
1175
|
+
checks,
|
|
1176
|
+
claim_boundaries: nonClaims,
|
|
1177
|
+
recommended_next_step: pass === checks.length ? "publish_owner_reviewed_outputs_then_run_c2_c3_a2_measurement" : "fix_failed_checks_before_publication_or_claims",
|
|
1178
|
+
non_claims: [
|
|
1179
|
+
"review_does_not_run_ai_engines",
|
|
1180
|
+
"review_does_not_verify_publication_or_citations",
|
|
1181
|
+
"review_does_not_prove_ranking_or_conversion_lift"
|
|
1182
|
+
]
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
async function runCli(argv) {
|
|
1187
|
+
const [cmd, url] = argv;
|
|
1188
|
+
if (!cmd || cmd === "help" || cmd === "--help") {
|
|
1189
|
+
print([
|
|
1190
|
+
"Agent ID",
|
|
1191
|
+
"",
|
|
1192
|
+
"Commands:",
|
|
1193
|
+
"",
|
|
1194
|
+
"Recommended Google Marketplace review loop:",
|
|
1195
|
+
" agent-id google-marketplace-evidence-example > google-marketplace-evidence.json",
|
|
1196
|
+
" # edit google-marketplace-evidence.json with real Google / Producer Portal / Cloud Run receipts",
|
|
1197
|
+
" agent-id google-marketplace-preflight google-marketplace-evidence.json",
|
|
1198
|
+
" agent-id google-marketplace-export google-marketplace-evidence.json --out-dir ./google-review",
|
|
1199
|
+
" agent-id google-marketplace-review-receipts google-marketplace-evidence.json",
|
|
1200
|
+
"",
|
|
1201
|
+
"Reference commands:",
|
|
1202
|
+
" agent-id capabilities",
|
|
1203
|
+
" agent-id workflow-router [url] [--intent <intent>]",
|
|
1204
|
+
" agent-id package-review [url]",
|
|
1205
|
+
" agent-id google-alignment",
|
|
1206
|
+
" agent-id trust-stack",
|
|
1207
|
+
" agent-id pricing",
|
|
1208
|
+
" agent-id billing-guide",
|
|
1209
|
+
" agent-id health",
|
|
1210
|
+
" agent-id self-audit",
|
|
1211
|
+
" agent-id self-backlog",
|
|
1212
|
+
" agent-id passport",
|
|
1213
|
+
" agent-id proof-graph",
|
|
1214
|
+
" agent-id trust-verify <bundle-json-file> [--now <unix-seconds>] [--require controller_binding,capability]",
|
|
1215
|
+
" agent-id outcome-report [url]",
|
|
1216
|
+
" agent-id outcome-package [url]",
|
|
1217
|
+
" agent-id monthly-package [url] [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1218
|
+
" agent-id monthly-tracker [url] [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1219
|
+
" agent-id monthly-scorecard [url] [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1220
|
+
" agent-id monthly-dashboard [url] [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1221
|
+
" agent-id monthly-dashboard-page [url]",
|
|
1222
|
+
" agent-id audit-report <url>",
|
|
1223
|
+
" agent-id evidence-pack <url>",
|
|
1224
|
+
" agent-id readiness-snapshot <url>",
|
|
1225
|
+
" agent-id readiness-compare <baseline-json> <recheck-json>",
|
|
1226
|
+
" agent-id pilot-report <baseline-json> <recheck-json> [--work <json-file>] [--evidence <json-file>]",
|
|
1227
|
+
" agent-id audit-package <url> [--audit]",
|
|
1228
|
+
" agent-id skill-package [url] [--out-dir <dir>]",
|
|
1229
|
+
" agent-id skill-package-validate [url]",
|
|
1230
|
+
" agent-id marketplace-submission [url]",
|
|
1231
|
+
" agent-id marketplace-readiness [url]",
|
|
1232
|
+
" agent-id marketplace-approval-receipts [url]",
|
|
1233
|
+
" agent-id google-marketplace-agent-card [url]",
|
|
1234
|
+
" agent-id google-marketplace-submission [url]",
|
|
1235
|
+
" agent-id google-marketplace-readiness [url]",
|
|
1236
|
+
" agent-id google-marketplace-pricing",
|
|
1237
|
+
" agent-id google-marketplace-listing",
|
|
1238
|
+
" agent-id google-marketplace-discovery-metadata",
|
|
1239
|
+
" agent-id google-marketplace-technical",
|
|
1240
|
+
" agent-id google-marketplace-backend",
|
|
1241
|
+
" agent-id google-marketplace-lifecycle-smoke",
|
|
1242
|
+
" agent-id google-marketplace-runtime-smoke [payload-json-file]",
|
|
1243
|
+
" agent-id google-marketplace-runtime-ledger [receipt-json-file]",
|
|
1244
|
+
" agent-id google-marketplace-runtime-evidence [url|evidence-json-file]",
|
|
1245
|
+
" agent-id google-marketplace-test-billing",
|
|
1246
|
+
" agent-id google-marketplace-agent-card-validate [evidence-json-file]",
|
|
1247
|
+
" agent-id google-marketplace-agent-card-gcs-pack [evidence-json-file]",
|
|
1248
|
+
" agent-id google-marketplace-product-details-review [evidence-json-file]",
|
|
1249
|
+
" agent-id google-marketplace-export [url|evidence-json-file] [--out-dir <dir>]",
|
|
1250
|
+
" agent-id google-marketplace-review-index [evidence-json-file]",
|
|
1251
|
+
" agent-id google-marketplace-core-source-map",
|
|
1252
|
+
" agent-id google-marketplace-status [evidence-json-file]",
|
|
1253
|
+
" agent-id google-marketplace-evidence [evidence-json-file]",
|
|
1254
|
+
" agent-id google-marketplace-partner-application [evidence-json-file]",
|
|
1255
|
+
" agent-id google-marketplace-operations",
|
|
1256
|
+
" agent-id google-marketplace-ops-identity [evidence-json-file]",
|
|
1257
|
+
" agent-id google-marketplace-cloud-run-deployment [evidence-json-file]",
|
|
1258
|
+
" agent-id google-marketplace-live-surfaces [url]",
|
|
1259
|
+
" agent-id google-marketplace-preflight [url|evidence-json-file]",
|
|
1260
|
+
" agent-id google-marketplace-publish",
|
|
1261
|
+
" agent-id google-marketplace-review-receipts [evidence-json-file]",
|
|
1262
|
+
" agent-id google-marketplace-evidence-template",
|
|
1263
|
+
" agent-id google-marketplace-evidence-example",
|
|
1264
|
+
" agent-id google-marketplace-procurement-event <event-json-file>",
|
|
1265
|
+
" agent-id google-marketplace-procurement-state",
|
|
1266
|
+
" agent-id google-marketplace-procurement-execute <action-json-file>",
|
|
1267
|
+
" agent-id google-marketplace-usage-report-payload [payload-json-file]",
|
|
1268
|
+
" agent-id google-marketplace-usage-report-execute <payload-json-file>",
|
|
1269
|
+
" agent-id google-marketplace-frontend",
|
|
1270
|
+
" agent-id google-marketplace-account-link <json-file>",
|
|
1271
|
+
" agent-id google-marketplace-jwt-verifier [evidence-json-file]",
|
|
1272
|
+
" agent-id validate-skill-package <dir>",
|
|
1273
|
+
" agent-id installation-verification <url>",
|
|
1274
|
+
" agent-id release-check [--json]",
|
|
1275
|
+
" agent-id production-preflight [--json]",
|
|
1276
|
+
" agent-id content-plan <url> [--content <text>] [--question <buyer question>] [--competitor <name>]",
|
|
1277
|
+
" agent-id content-workflow <url> [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude]",
|
|
1278
|
+
" agent-id content-pack <url> [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--evidence <json-file>] [--verify]",
|
|
1279
|
+
" agent-id content-workflow-review <content-pack-json-file>",
|
|
1280
|
+
" agent-id content-publication-package <url> [--evidence <json-file>] [--verify]",
|
|
1281
|
+
" agent-id citation-gap <url> [--content <text>] [--question <buyer question>] [--competitor <name>]",
|
|
1282
|
+
" agent-id community-plan <url> [--content <text>] [--question <buyer question>] [--competitor <name>]",
|
|
1283
|
+
" agent-id prompt-sheet <url> [--question <buyer question>] [--topic <topic>] [--engine ChatGPT,Gemini,Claude] [--competitor <name>]",
|
|
1284
|
+
" agent-id prompt-results <json-file>",
|
|
1285
|
+
" agent-id audit <url>",
|
|
1286
|
+
" agent-id a1-reads [url]",
|
|
1287
|
+
" agent-id a1-ingest <url> --ua <user-agent> [--status 200]",
|
|
1288
|
+
" agent-id a1-package [url] [--events <json-file>]",
|
|
1289
|
+
" agent-id a2-citations [url]",
|
|
1290
|
+
" agent-id a2-ingest <url> --engine <engine> --prompt <prompt> --answer <answer> [--citation <url>]",
|
|
1291
|
+
" agent-id a2-package [url] [--probes <json-file>] [--verify]",
|
|
1292
|
+
" agent-id a2-probe-set <url> --topic <topic> [--engine ChatGPT,Gemini,Claude] [--market <market>]",
|
|
1293
|
+
" agent-id b1-conversions [url]",
|
|
1294
|
+
" agent-id b1-ingest <url> --event <lead|rfq|order> [--referrer <url>] [--survey-source <source>] [--value <amount>]",
|
|
1295
|
+
" agent-id b1-package [url] [--events <json-file>]",
|
|
1296
|
+
" agent-id g1-google [url] [--fetch]",
|
|
1297
|
+
" agent-id g1-ingest <pagespeed-json-file>",
|
|
1298
|
+
" agent-id g2-delta [url]",
|
|
1299
|
+
" agent-id g2-ingest <before-json-file> <after-json-file>",
|
|
1300
|
+
" agent-id g3-plan [url] [--audit]",
|
|
1301
|
+
" agent-id implementation-bundle [url] [--audit]",
|
|
1302
|
+
" agent-id optimization-cycle [url] [--audit]",
|
|
1303
|
+
" agent-id insights [url]",
|
|
1304
|
+
" agent-id insight-drafts <url>",
|
|
1305
|
+
" agent-id insight-accept-draft <url>",
|
|
1306
|
+
" agent-id site-insights <url> --key <agent-key> [--audit]",
|
|
1307
|
+
" agent-id site-feed <url> --key <agent-key> [--audit] [--content <text>] [--question <buyer question>] [--a2-package <json-file>]",
|
|
1308
|
+
" agent-id site-refresh-inbox <url> --key <agent-key> [--audit] [--content <text>] [--question <buyer question>] [--a2-package <json-file>]",
|
|
1309
|
+
" agent-id site-inbox <url> --key <agent-key> [--all]",
|
|
1310
|
+
" agent-id site-ack-insight <url> <item-id> --key <agent-key>",
|
|
1311
|
+
" agent-id site-apply-plan <url> --key <agent-key> [--audit] [--content <text>] [--question <buyer question>] [--a2-package <json-file>]",
|
|
1312
|
+
" agent-id site-actions",
|
|
1313
|
+
" agent-id site-outcome-report <url> --key <agent-key>",
|
|
1314
|
+
" agent-id site-outcome-package <url> --key <agent-key>",
|
|
1315
|
+
" agent-id site-monthly-package <url> --key <agent-key> [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1316
|
+
" agent-id site-monthly-tracker <url> --key <agent-key> [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1317
|
+
" agent-id site-monthly-scorecard <url> --key <agent-key> [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1318
|
+
" agent-id site-monthly-dashboard <url> --key <agent-key> [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1319
|
+
" agent-id site-monthly-loop <url> --key <agent-key> [--audit] [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--publication <json-file>] [--a2-package <json-file>]",
|
|
1320
|
+
" agent-id site-optimization-cycle <url> --key <agent-key> [--audit]",
|
|
1321
|
+
" agent-id site-audit-package <url> --key <agent-key> [--audit]",
|
|
1322
|
+
" agent-id site-skill-package <url> --key <agent-key>",
|
|
1323
|
+
" agent-id site-implementation-bundle <url> --key <agent-key> [--audit]",
|
|
1324
|
+
" agent-id site-install-descriptor <url> --key <agent-key>",
|
|
1325
|
+
" agent-id site-installation-verification <url> --key <agent-key> [--audit]",
|
|
1326
|
+
" agent-id site-content-plan <url> --key <agent-key> [--content <text>] [--question <buyer question>] [--competitor <name>] [--audit]",
|
|
1327
|
+
" agent-id site-content-workflow <url> --key <agent-key> [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--audit]",
|
|
1328
|
+
" agent-id site-content-pack <url> --key <agent-key> [--content <text>] [--question <buyer question>] [--competitor <name>] [--engine ChatGPT,Gemini,Claude] [--evidence <json-file>] [--audit] [--verify]",
|
|
1329
|
+
" agent-id site-content-repair <url> --key <agent-key> [--review-gate <json-file>] [--content <text>] [--question <buyer question>]",
|
|
1330
|
+
" agent-id site-content-publication <url> --key <agent-key> [--evidence <json-file>] [--audit] [--verify]",
|
|
1331
|
+
" agent-id site-citation-gap <url> --key <agent-key> [--content <text>] [--question <buyer question>] [--competitor <name>] [--audit]",
|
|
1332
|
+
" agent-id site-community-plan <url> --key <agent-key> [--content <text>] [--question <buyer question>] [--competitor <name>] [--audit]",
|
|
1333
|
+
" agent-id site-prompt-sheet <url> --key <agent-key> [--question <buyer question>] [--topic <topic>] [--engine ChatGPT,Gemini,Claude] [--competitor <name>]",
|
|
1334
|
+
" agent-id site-prompt-results <url> <json-file> --key <agent-key>",
|
|
1335
|
+
" agent-id site-b1-package <url> --key <agent-key> [--events <json-file>]",
|
|
1336
|
+
" agent-id site-job-drafts <url> --key <agent-key> [--audit] [--currency USD|TWD]",
|
|
1337
|
+
" agent-id site-accept-draft <url> <draft-json-file> --key <agent-key>",
|
|
1338
|
+
" agent-id site-jobs <url> --key <agent-key>",
|
|
1339
|
+
" agent-id site-c5-repairs <url> --key <agent-key>",
|
|
1340
|
+
" agent-id site-job-evidence <url> <job-id> --key <agent-key> [--uri <proof-url>] [--evidence <json-file>]",
|
|
1341
|
+
" agent-id job-drafts <url>",
|
|
1342
|
+
" agent-id job-accept-draft <url>",
|
|
1343
|
+
" agent-id job-create <url>",
|
|
1344
|
+
" agent-id job-fund <job-id>",
|
|
1345
|
+
" agent-id job-payment-quote <job-id>",
|
|
1346
|
+
" agent-id job-fund-proof <job-id> <proof>",
|
|
1347
|
+
" agent-id job-submit <job-id>",
|
|
1348
|
+
" agent-id job-evaluate <job-id>",
|
|
1349
|
+
" agent-id register <url>",
|
|
1350
|
+
" agent-id install-guide <url>",
|
|
1351
|
+
" agent-id install <url> [--project-root <dir>] [--public-root <dir>] [--apply]",
|
|
1352
|
+
" agent-id install-resume [--project-root <dir>]",
|
|
1353
|
+
" agent-id install-uninstall [--project-root <dir>] --approve",
|
|
1354
|
+
" agent-id enterprise-enroll <url> [--environment production|staging] [--method well_known|dns_txt|html_meta] [--project-root <dir>]",
|
|
1355
|
+
" agent-id enterprise-domain-proof [--project-root <dir>] [--public-root <dir>] [--apply]",
|
|
1356
|
+
" agent-id enterprise-domain-verify [--project-root <dir>]",
|
|
1357
|
+
" agent-id enterprise-credential-rotate [--project-root <dir>] --approve",
|
|
1358
|
+
" agent-id enterprise-credential-revoke [--project-root <dir>] --reason <reason> --approve",
|
|
1359
|
+
" agent-id enterprise-policy-init [--project-root <dir>]",
|
|
1360
|
+
" agent-id enterprise-policy-approve <rule-json-file> [--project-root <dir>] --approve --approved-by <identity>",
|
|
1361
|
+
" agent-id enterprise-status [--project-root <dir>]",
|
|
1362
|
+
" agent-id enterprise-managed-enable [--project-root <dir>] [--json]",
|
|
1363
|
+
" agent-id enterprise-managed-status [--project-root <dir>] [--json]",
|
|
1364
|
+
" agent-id enterprise-managed-pause [--project-root <dir>] [--json]",
|
|
1365
|
+
" agent-id enterprise-managed-resume [--project-root <dir>] [--json]",
|
|
1366
|
+
" agent-id enterprise-managed-runs [--project-root <dir>] [--limit <1-100>] [--json]",
|
|
1367
|
+
" agent-id enterprise-contract",
|
|
1368
|
+
" agent-id repository-patch-plan <root> <changes-json-file>",
|
|
1369
|
+
" agent-id repository-patch-apply <plan-json-file> --approve",
|
|
1370
|
+
" agent-id repository-patch-rollback <receipt-json-file> --approve",
|
|
1371
|
+
" agent-id verify-domain <url> [--method well_known|dns_txt|html_meta]",
|
|
1372
|
+
" agent-id verify <url> --key <agent-key>",
|
|
1373
|
+
" agent-id checkout <plan>",
|
|
1374
|
+
" agent-id mcp"
|
|
1375
|
+
].join("\n"));
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1378
|
+
if (cmd === "capabilities") return print(await get("/api/agent/capabilities"));
|
|
1379
|
+
if (cmd === "release-check") return releaseCheck();
|
|
1380
|
+
if (cmd === "production-preflight") return productionPreflight();
|
|
1381
|
+
if (cmd === "enterprise-contract") {
|
|
1382
|
+
const capabilities = await get("/api/agent/capabilities");
|
|
1383
|
+
return print({ ok: true, enterprise_site_agent: capabilities.enterprise_site_agent });
|
|
1384
|
+
}
|
|
1385
|
+
if (cmd === "workflow-router") {
|
|
1386
|
+
const intentIdx = argv.indexOf("--intent");
|
|
1387
|
+
const qs = [];
|
|
1388
|
+
if (url) qs.push(`url=${encodeURIComponent(url)}`);
|
|
1389
|
+
if (intentIdx >= 0) qs.push(`intent=${encodeURIComponent(argv[intentIdx + 1] || "")}`);
|
|
1390
|
+
return print(await get(`/api/agent/workflow_router${qs.length ? "?" + qs.join("&") : ""}`));
|
|
1391
|
+
}
|
|
1392
|
+
if (cmd === "package-review") return print(await get(url ? `/api/agent/package_review?url=${encodeURIComponent(url)}` : "/api/agent/package_review"));
|
|
1393
|
+
if (cmd === "google-alignment") return print(await get("/api/agent/google_alignment"));
|
|
1394
|
+
if (cmd === "trust-stack") return print(await get("/api/agent/trust_stack"));
|
|
1395
|
+
if (cmd === "pricing") return print(await get("/api/agent/pricing"));
|
|
1396
|
+
if (cmd === "billing-guide") return print(await get("/api/agent/billing_guide"));
|
|
1397
|
+
if (cmd === "health") return print(await get("/agent/health.json"));
|
|
1398
|
+
if (cmd === "self-audit") return print(await get("/api/agent/self_audit"));
|
|
1399
|
+
if (cmd === "self-backlog") return print(await get("/api/agent/self_backlog"));
|
|
1400
|
+
if (cmd === "passport") return print(await get("/api/agent/passport"));
|
|
1401
|
+
if (cmd === "proof-graph") return print(await get("/api/agent/proof_graph"));
|
|
1402
|
+
if (cmd === "trust-verify") {
|
|
1403
|
+
if (!url) throw new Error("trust-verify requires a bundle JSON file");
|
|
1404
|
+
const bundle = JSON.parse(fs.readFileSync(url, "utf8"));
|
|
1405
|
+
const nowValue = readFlagValue(argv, "--now");
|
|
1406
|
+
const required = String(readFlagValue(argv, "--require") || "")
|
|
1407
|
+
.split(",")
|
|
1408
|
+
.map(value => value.trim())
|
|
1409
|
+
.filter(Boolean);
|
|
1410
|
+
const result = verifyPortableBundle(bundle, {
|
|
1411
|
+
now: nowValue ? Number(nowValue) : Math.floor(Date.now() / 1000),
|
|
1412
|
+
requiredClaimTypes: required
|
|
1413
|
+
});
|
|
1414
|
+
print(result);
|
|
1415
|
+
if (result.verdict === "block") process.exitCode = 2;
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
if (cmd === "outcome-report") return print(await get(url ? `/api/agent/outcome_report?url=${encodeURIComponent(url)}` : "/api/agent/outcome_report"));
|
|
1419
|
+
if (cmd === "outcome-package") return print(await get(url ? `/api/agent/outcome_package?url=${encodeURIComponent(url)}` : "/api/agent/outcome_package"));
|
|
1420
|
+
if (cmd === "readiness-snapshot") {
|
|
1421
|
+
const result = await get(url ? `/api/agent/readiness_snapshot?url=${encodeURIComponent(url)}` : "/api/agent/readiness_snapshot");
|
|
1422
|
+
return print(result?.snapshot || result);
|
|
1423
|
+
}
|
|
1424
|
+
if (cmd === "readiness-compare") {
|
|
1425
|
+
const baseline = JSON.parse(fs.readFileSync(url, "utf8"));
|
|
1426
|
+
const recheckPath = argv[2];
|
|
1427
|
+
if (!recheckPath) throw new Error("readiness-compare requires a recheck JSON file");
|
|
1428
|
+
const recheck = JSON.parse(fs.readFileSync(recheckPath, "utf8"));
|
|
1429
|
+
return print(await post("/api/agent/readiness_compare", { baseline, recheck }));
|
|
1430
|
+
}
|
|
1431
|
+
if (cmd === "pilot-report") {
|
|
1432
|
+
const baseline = JSON.parse(fs.readFileSync(url, "utf8"));
|
|
1433
|
+
const recheckPath = argv[2];
|
|
1434
|
+
if (!recheckPath) throw new Error("pilot-report requires a recheck JSON file");
|
|
1435
|
+
const recheck = JSON.parse(fs.readFileSync(recheckPath, "utf8"));
|
|
1436
|
+
return print(await post("/api/agent/pilot_report", {
|
|
1437
|
+
baseline,
|
|
1438
|
+
recheck,
|
|
1439
|
+
work_item: readJsonFlag(argv, "--work") || {},
|
|
1440
|
+
evidence: readJsonFlag(argv, "--evidence") || {}
|
|
1441
|
+
}));
|
|
1442
|
+
}
|
|
1443
|
+
if (cmd === "monthly-package") {
|
|
1444
|
+
const auditFlag = argv.includes("--audit") ? "&audit=1" : "";
|
|
1445
|
+
const contentIdx = argv.indexOf("--content");
|
|
1446
|
+
const questionIdx = argv.indexOf("--question");
|
|
1447
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1448
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1449
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
1450
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
1451
|
+
if (contentIdx >= 0 || questionIdx >= 0 || competitorIdx >= 0 || engineIdx >= 0 || publicationPackage || a2CitationPackage) {
|
|
1452
|
+
return print(await post("/api/agent/monthly_package", {
|
|
1453
|
+
url,
|
|
1454
|
+
audit_url: argv.includes("--audit"),
|
|
1455
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1456
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1457
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
1458
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
1459
|
+
content_publication_package: publicationPackage,
|
|
1460
|
+
a2_citation_package: a2CitationPackage
|
|
1461
|
+
}));
|
|
1462
|
+
}
|
|
1463
|
+
return print(await get(url ? `/api/agent/monthly_package?url=${encodeURIComponent(url)}${auditFlag}` : "/api/agent/monthly_package"));
|
|
1464
|
+
}
|
|
1465
|
+
if (cmd === "monthly-tracker") {
|
|
1466
|
+
const auditFlag = argv.includes("--audit") ? "&audit=1" : "";
|
|
1467
|
+
const contentIdx = argv.indexOf("--content");
|
|
1468
|
+
const questionIdx = argv.indexOf("--question");
|
|
1469
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1470
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1471
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
1472
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
1473
|
+
if (contentIdx >= 0 || questionIdx >= 0 || competitorIdx >= 0 || engineIdx >= 0 || publicationPackage || a2CitationPackage) {
|
|
1474
|
+
return print(await post("/api/agent/monthly_tracker", {
|
|
1475
|
+
url,
|
|
1476
|
+
audit_url: argv.includes("--audit"),
|
|
1477
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1478
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1479
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
1480
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
1481
|
+
content_publication_package: publicationPackage,
|
|
1482
|
+
a2_citation_package: a2CitationPackage
|
|
1483
|
+
}));
|
|
1484
|
+
}
|
|
1485
|
+
return print(await get(url ? `/api/agent/monthly_tracker?url=${encodeURIComponent(url)}${auditFlag}` : "/api/agent/monthly_tracker"));
|
|
1486
|
+
}
|
|
1487
|
+
if (cmd === "monthly-scorecard") {
|
|
1488
|
+
const auditFlag = argv.includes("--audit") ? "&audit=1" : "";
|
|
1489
|
+
const contentIdx = argv.indexOf("--content");
|
|
1490
|
+
const questionIdx = argv.indexOf("--question");
|
|
1491
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1492
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1493
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
1494
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
1495
|
+
if (contentIdx >= 0 || questionIdx >= 0 || competitorIdx >= 0 || engineIdx >= 0 || publicationPackage || a2CitationPackage) {
|
|
1496
|
+
return print(await post("/api/agent/monthly_scorecard", {
|
|
1497
|
+
url,
|
|
1498
|
+
audit_url: argv.includes("--audit"),
|
|
1499
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1500
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1501
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
1502
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
1503
|
+
content_publication_package: publicationPackage,
|
|
1504
|
+
a2_citation_package: a2CitationPackage
|
|
1505
|
+
}));
|
|
1506
|
+
}
|
|
1507
|
+
return print(await get(url ? `/api/agent/monthly_scorecard?url=${encodeURIComponent(url)}${auditFlag}` : "/api/agent/monthly_scorecard"));
|
|
1508
|
+
}
|
|
1509
|
+
if (cmd === "monthly-dashboard") {
|
|
1510
|
+
const auditFlag = argv.includes("--audit") ? "&audit=1" : "";
|
|
1511
|
+
const contentIdx = argv.indexOf("--content");
|
|
1512
|
+
const questionIdx = argv.indexOf("--question");
|
|
1513
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1514
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1515
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
1516
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
1517
|
+
if (contentIdx >= 0 || questionIdx >= 0 || competitorIdx >= 0 || engineIdx >= 0 || publicationPackage || a2CitationPackage) {
|
|
1518
|
+
return print(await post("/api/agent/monthly_dashboard", {
|
|
1519
|
+
url,
|
|
1520
|
+
audit_url: argv.includes("--audit"),
|
|
1521
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1522
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1523
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
1524
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
1525
|
+
content_publication_package: publicationPackage,
|
|
1526
|
+
a2_citation_package: a2CitationPackage
|
|
1527
|
+
}));
|
|
1528
|
+
}
|
|
1529
|
+
return print(await get(url ? `/api/agent/monthly_dashboard?url=${encodeURIComponent(url)}${auditFlag}` : "/api/agent/monthly_dashboard"));
|
|
1530
|
+
}
|
|
1531
|
+
if (cmd === "monthly-dashboard-page") {
|
|
1532
|
+
const path = url ? `/agent/dashboard?url=${encodeURIComponent(url)}` : "/agent/dashboard";
|
|
1533
|
+
return process.stdout.write(await getText(path));
|
|
1534
|
+
}
|
|
1535
|
+
if (cmd === "audit-report") return print(await get(url ? `/api/agent/audit_report?url=${encodeURIComponent(url)}` : "/api/agent/audit_report"));
|
|
1536
|
+
if (cmd === "evidence-pack") return print(await get(url ? `/api/agent/evidence_pack?url=${encodeURIComponent(url)}` : "/api/agent/evidence_pack"));
|
|
1537
|
+
if (cmd === "installation-verification") return print(await get(url ? `/api/agent/installation_verification?url=${encodeURIComponent(url)}` : "/api/agent/installation_verification"));
|
|
1538
|
+
if (cmd === "content-plan") {
|
|
1539
|
+
const contentIdx = argv.indexOf("--content");
|
|
1540
|
+
const questionIdx = argv.indexOf("--question");
|
|
1541
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1542
|
+
return print(await post("/api/agent/content_optimization_plan", {
|
|
1543
|
+
url,
|
|
1544
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1545
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1546
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : []
|
|
1547
|
+
}));
|
|
1548
|
+
}
|
|
1549
|
+
if (cmd === "content-workflow") {
|
|
1550
|
+
const contentIdx = argv.indexOf("--content");
|
|
1551
|
+
const questionIdx = argv.indexOf("--question");
|
|
1552
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1553
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1554
|
+
return print(await post("/api/agent/content_workflow_package", {
|
|
1555
|
+
url,
|
|
1556
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1557
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1558
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
1559
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : ""
|
|
1560
|
+
}));
|
|
1561
|
+
}
|
|
1562
|
+
if (cmd === "content-pack") {
|
|
1563
|
+
const contentIdx = argv.indexOf("--content");
|
|
1564
|
+
const questionIdx = argv.indexOf("--question");
|
|
1565
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1566
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1567
|
+
const evidenceIdx = argv.indexOf("--evidence");
|
|
1568
|
+
const publishedItems = evidenceIdx >= 0 ? JSON.parse(fs.readFileSync(argv[evidenceIdx + 1], "utf8")) : [];
|
|
1569
|
+
return print(await post("/api/agent/content_pack", {
|
|
1570
|
+
url,
|
|
1571
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1572
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1573
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
1574
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
1575
|
+
published_items: publishedItems,
|
|
1576
|
+
verify_publication: argv.includes("--verify")
|
|
1577
|
+
}));
|
|
1578
|
+
}
|
|
1579
|
+
if (cmd === "content-workflow-review") {
|
|
1580
|
+
const payload = JSON.parse(fs.readFileSync(url, "utf8"));
|
|
1581
|
+
return print(reviewContentWorkflowPackage(payload));
|
|
1582
|
+
}
|
|
1583
|
+
if (cmd === "content-publication-package") {
|
|
1584
|
+
const evidenceIdx = argv.indexOf("--evidence");
|
|
1585
|
+
const publishedItems = evidenceIdx >= 0 ? JSON.parse(fs.readFileSync(argv[evidenceIdx + 1], "utf8")) : [];
|
|
1586
|
+
return print(await post("/api/agent/content_publication_package", {
|
|
1587
|
+
url,
|
|
1588
|
+
published_items: publishedItems,
|
|
1589
|
+
verify_publication: argv.includes("--verify")
|
|
1590
|
+
}));
|
|
1591
|
+
}
|
|
1592
|
+
if (cmd === "citation-gap") {
|
|
1593
|
+
const contentIdx = argv.indexOf("--content");
|
|
1594
|
+
const questionIdx = argv.indexOf("--question");
|
|
1595
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1596
|
+
return print(await post("/api/agent/citation_gap_matrix", {
|
|
1597
|
+
url,
|
|
1598
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1599
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1600
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : []
|
|
1601
|
+
}));
|
|
1602
|
+
}
|
|
1603
|
+
if (cmd === "community-plan") {
|
|
1604
|
+
const contentIdx = argv.indexOf("--content");
|
|
1605
|
+
const questionIdx = argv.indexOf("--question");
|
|
1606
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1607
|
+
return print(await post("/api/agent/community_citation_plan", {
|
|
1608
|
+
url,
|
|
1609
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1610
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1611
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : []
|
|
1612
|
+
}));
|
|
1613
|
+
}
|
|
1614
|
+
if (cmd === "prompt-sheet") {
|
|
1615
|
+
const questionIdx = argv.indexOf("--question");
|
|
1616
|
+
const topicIdx = argv.indexOf("--topic");
|
|
1617
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1618
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
1619
|
+
const marketIdx = argv.indexOf("--market");
|
|
1620
|
+
return print(await post("/api/agent/prompt_test_run_sheet", {
|
|
1621
|
+
url,
|
|
1622
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1623
|
+
topics: topicIdx >= 0 ? [argv[topicIdx + 1]] : [],
|
|
1624
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
1625
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
1626
|
+
market: marketIdx >= 0 ? argv[marketIdx + 1] : "",
|
|
1627
|
+
source: "agent-id-cli"
|
|
1628
|
+
}));
|
|
1629
|
+
}
|
|
1630
|
+
if (cmd === "prompt-results") {
|
|
1631
|
+
const payload = JSON.parse(fs.readFileSync(url, "utf8"));
|
|
1632
|
+
return print(await post("/api/agent/prompt_test_results", payload));
|
|
1633
|
+
}
|
|
1634
|
+
if (cmd === "audit") return print(await post("/api/agent/audit", { url }));
|
|
1635
|
+
if (cmd === "a1-reads") return print(await get(url ? `/api/agent/a1_reads?url=${encodeURIComponent(url)}` : "/api/agent/a1_reads"));
|
|
1636
|
+
if (cmd === "a1-ingest") {
|
|
1637
|
+
const uaIdx = argv.indexOf("--ua");
|
|
1638
|
+
const stIdx = argv.indexOf("--status");
|
|
1639
|
+
return print(await post("/api/agent/a1_reads", { url, user_agent: uaIdx >= 0 ? argv[uaIdx + 1] : "", status: stIdx >= 0 ? argv[stIdx + 1] : 200, source: "agent-id-cli" }));
|
|
1640
|
+
}
|
|
1641
|
+
if (cmd === "a1-package") {
|
|
1642
|
+
const eventsIdx = argv.indexOf("--events");
|
|
1643
|
+
if (eventsIdx >= 0) {
|
|
1644
|
+
const events = JSON.parse(fs.readFileSync(argv[eventsIdx + 1], "utf8"));
|
|
1645
|
+
return print(await post("/api/agent/a1_read_package", { url, events, source: "agent-id-cli" }));
|
|
1646
|
+
}
|
|
1647
|
+
return print(await get(url ? `/api/agent/a1_read_package?url=${encodeURIComponent(url)}` : "/api/agent/a1_read_package"));
|
|
1648
|
+
}
|
|
1649
|
+
if (cmd === "a2-citations") return print(await get(url ? `/api/agent/a2_citations?url=${encodeURIComponent(url)}` : "/api/agent/a2_citations"));
|
|
1650
|
+
if (cmd === "a2-ingest") {
|
|
1651
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1652
|
+
const promptIdx = argv.indexOf("--prompt");
|
|
1653
|
+
const answerIdx = argv.indexOf("--answer");
|
|
1654
|
+
const citationIdx = argv.indexOf("--citation");
|
|
1655
|
+
return print(await post("/api/agent/a2_citations", { target_url: url, engine: engineIdx >= 0 ? argv[engineIdx + 1] : "unknown", prompt: promptIdx >= 0 ? argv[promptIdx + 1] : "", answer: answerIdx >= 0 ? argv[answerIdx + 1] : "", citations: citationIdx >= 0 ? [argv[citationIdx + 1]] : [], source: "agent-id-cli" }));
|
|
1656
|
+
}
|
|
1657
|
+
if (cmd === "a2-package") {
|
|
1658
|
+
const probesIdx = argv.indexOf("--probes");
|
|
1659
|
+
if (probesIdx >= 0) {
|
|
1660
|
+
const probes = JSON.parse(fs.readFileSync(argv[probesIdx + 1], "utf8"));
|
|
1661
|
+
return print(await post("/api/agent/a2_citation_package", { url, probes, source: "agent-id-cli", verify_artifacts: argv.includes("--verify") }));
|
|
1662
|
+
}
|
|
1663
|
+
const verifyFlag = argv.includes("--verify") ? "&verify_artifacts=1" : "";
|
|
1664
|
+
return print(await get(url ? `/api/agent/a2_citation_package?url=${encodeURIComponent(url)}${verifyFlag}` : `/api/agent/a2_citation_package?verify_artifacts=${argv.includes("--verify") ? "1" : "0"}`));
|
|
1665
|
+
}
|
|
1666
|
+
if (cmd === "a2-probe-set") {
|
|
1667
|
+
const topicIdx = argv.indexOf("--topic");
|
|
1668
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1669
|
+
const marketIdx = argv.indexOf("--market");
|
|
1670
|
+
return print(await post("/api/agent/a2_probe_sets", {
|
|
1671
|
+
url,
|
|
1672
|
+
topics: topicIdx >= 0 ? argv[topicIdx + 1] : "",
|
|
1673
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
1674
|
+
market: marketIdx >= 0 ? argv[marketIdx + 1] : "",
|
|
1675
|
+
source: "agent-id-cli"
|
|
1676
|
+
}));
|
|
1677
|
+
}
|
|
1678
|
+
if (cmd === "b1-conversions") return print(await get(url ? `/api/agent/b1_conversions?url=${encodeURIComponent(url)}` : "/api/agent/b1_conversions"));
|
|
1679
|
+
if (cmd === "b1-ingest") {
|
|
1680
|
+
const eventIdx = argv.indexOf("--event");
|
|
1681
|
+
const refIdx = argv.indexOf("--referrer");
|
|
1682
|
+
const surveyIdx = argv.indexOf("--survey-source");
|
|
1683
|
+
const valueIdx = argv.indexOf("--value");
|
|
1684
|
+
const currencyIdx = argv.indexOf("--currency");
|
|
1685
|
+
return print(await post("/api/agent/b1_conversions", {
|
|
1686
|
+
url,
|
|
1687
|
+
event: eventIdx >= 0 ? argv[eventIdx + 1] : "conversion",
|
|
1688
|
+
referrer: refIdx >= 0 ? argv[refIdx + 1] : "",
|
|
1689
|
+
survey_source: surveyIdx >= 0 ? argv[surveyIdx + 1] : "",
|
|
1690
|
+
value: valueIdx >= 0 ? Number(argv[valueIdx + 1]) : 0,
|
|
1691
|
+
currency: currencyIdx >= 0 ? argv[currencyIdx + 1] : "USD",
|
|
1692
|
+
source: "agent-id-cli"
|
|
1693
|
+
}));
|
|
1694
|
+
}
|
|
1695
|
+
if (cmd === "b1-package") {
|
|
1696
|
+
const eventsIdx = argv.indexOf("--events");
|
|
1697
|
+
if (eventsIdx >= 0) {
|
|
1698
|
+
const events = JSON.parse(fs.readFileSync(argv[eventsIdx + 1], "utf8"));
|
|
1699
|
+
return print(await post("/api/agent/b1_conversion_package", { url, events, source: "agent-id-cli" }));
|
|
1700
|
+
}
|
|
1701
|
+
return print(await get(url ? `/api/agent/b1_conversion_package?url=${encodeURIComponent(url)}` : "/api/agent/b1_conversion_package"));
|
|
1702
|
+
}
|
|
1703
|
+
if (cmd === "g1-google") {
|
|
1704
|
+
const fetchFlag = argv.includes("--fetch") ? "&fetch=1" : "";
|
|
1705
|
+
return print(await get(url ? `/api/agent/g1_google_official?url=${encodeURIComponent(url)}${fetchFlag}` : "/api/agent/g1_google_official"));
|
|
1706
|
+
}
|
|
1707
|
+
if (cmd === "g1-ingest") {
|
|
1708
|
+
const raw = fs.readFileSync(url, "utf8");
|
|
1709
|
+
return print(await post("/api/agent/g1_google_official", JSON.parse(raw)));
|
|
1710
|
+
}
|
|
1711
|
+
if (cmd === "g2-delta") return print(await get(url ? `/api/agent/g2_google_delta?url=${encodeURIComponent(url)}` : "/api/agent/g2_google_delta"));
|
|
1712
|
+
if (cmd === "g2-ingest") {
|
|
1713
|
+
const before = JSON.parse(fs.readFileSync(url, "utf8"));
|
|
1714
|
+
const after = JSON.parse(fs.readFileSync(argv[2], "utf8"));
|
|
1715
|
+
return print(await post("/api/agent/g2_google_delta", { before, after }));
|
|
1716
|
+
}
|
|
1717
|
+
if (cmd === "g3-plan") {
|
|
1718
|
+
const auditFlag = argv.includes("--audit") ? "&audit=1" : "";
|
|
1719
|
+
return print(await get(url ? `/api/agent/g3_google_verification_plan?url=${encodeURIComponent(url)}${auditFlag}` : "/api/agent/g3_google_verification_plan"));
|
|
1720
|
+
}
|
|
1721
|
+
if (cmd === "audit-package") {
|
|
1722
|
+
const auditFlag = argv.includes("--audit") ? "&audit=1" : "";
|
|
1723
|
+
return print(await get(url ? `/api/agent/audit_file_package?url=${encodeURIComponent(url)}${auditFlag}` : "/api/agent/audit_file_package"));
|
|
1724
|
+
}
|
|
1725
|
+
if (cmd === "skill-package") {
|
|
1726
|
+
const outDir = readFlagValue(argv, "--out-dir");
|
|
1727
|
+
const res = await get(url ? `/api/agent/skill_package?url=${encodeURIComponent(url)}` : "/api/agent/skill_package");
|
|
1728
|
+
return print(outDir ? writeSkillPackageFiles(res, outDir) : res);
|
|
1729
|
+
}
|
|
1730
|
+
if (cmd === "skill-package-validate") return print(await get(url ? `/api/agent/skill_package_validate?url=${encodeURIComponent(url)}` : "/api/agent/skill_package_validate"));
|
|
1731
|
+
if (cmd === "marketplace-submission") return print(await get(url ? `/api/agent/marketplace_submission?url=${encodeURIComponent(url)}` : "/api/agent/marketplace_submission"));
|
|
1732
|
+
if (cmd === "marketplace-readiness") return print(await get(url ? `/api/agent/marketplace_readiness?url=${encodeURIComponent(url)}` : "/api/agent/marketplace_readiness"));
|
|
1733
|
+
if (cmd === "marketplace-approval-receipts") return print(await get(url ? `/api/agent/marketplace_approval_receipts?url=${encodeURIComponent(url)}` : "/api/agent/marketplace_approval_receipts"));
|
|
1734
|
+
if (cmd === "google-marketplace-agent-card") return print(await get(url ? `/api/agent/google_marketplace_agent_card?url=${encodeURIComponent(url)}` : "/api/agent/google_marketplace_agent_card"));
|
|
1735
|
+
if (cmd === "google-marketplace-submission") return print(await get(url ? `/api/agent/google_marketplace_submission?url=${encodeURIComponent(url)}` : "/api/agent/google_marketplace_submission"));
|
|
1736
|
+
if (cmd === "google-marketplace-readiness") return print(await get(url ? `/api/agent/google_marketplace_readiness?url=${encodeURIComponent(url)}` : "/api/agent/google_marketplace_readiness"));
|
|
1737
|
+
if (cmd === "google-marketplace-pricing") return print(await get("/api/agent/google_marketplace_pricing"));
|
|
1738
|
+
if (cmd === "google-marketplace-develop-flow") {
|
|
1739
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1740
|
+
if (evidenceFile) {
|
|
1741
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1742
|
+
return print(await post("/api/agent/google_marketplace_develop_flow_gate", payload));
|
|
1743
|
+
}
|
|
1744
|
+
return print(await get("/api/agent/google_marketplace_develop_flow_gate"));
|
|
1745
|
+
}
|
|
1746
|
+
if (cmd === "google-marketplace-listing-requirements") {
|
|
1747
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1748
|
+
if (evidenceFile) {
|
|
1749
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1750
|
+
return print(await post("/api/agent/google_marketplace_listing_requirements_gate", payload));
|
|
1751
|
+
}
|
|
1752
|
+
return print(await get("/api/agent/google_marketplace_listing_requirements_gate"));
|
|
1753
|
+
}
|
|
1754
|
+
if (cmd === "google-marketplace-listing") return print(await get("/api/agent/google_marketplace_listing"));
|
|
1755
|
+
if (cmd === "google-marketplace-discovery-metadata") return print(await get("/api/agent/google_marketplace_discovery_metadata"));
|
|
1756
|
+
if (cmd === "google-marketplace-technical") return print(await get("/api/agent/google_marketplace_technical"));
|
|
1757
|
+
if (cmd === "google-marketplace-backend") return print(await get("/api/agent/google_marketplace_backend_gate"));
|
|
1758
|
+
if (cmd === "google-marketplace-lifecycle-smoke") return print(await get("/api/agent/google_marketplace_lifecycle_smoke"));
|
|
1759
|
+
if (cmd === "google-marketplace-runtime-smoke") {
|
|
1760
|
+
const payloadFile = url && !String(url).startsWith("--") ? url : "";
|
|
1761
|
+
if (payloadFile) {
|
|
1762
|
+
const payload = JSON.parse(fs.readFileSync(payloadFile, "utf8"));
|
|
1763
|
+
return print(await post("/api/agent/google_marketplace_runtime_smoke", payload));
|
|
1764
|
+
}
|
|
1765
|
+
return print(await get("/api/agent/google_marketplace_runtime_smoke"));
|
|
1766
|
+
}
|
|
1767
|
+
if (cmd === "google-marketplace-runtime-receipt") {
|
|
1768
|
+
const payloadFile = url && !String(url).startsWith("--") ? url : "";
|
|
1769
|
+
if (payloadFile) {
|
|
1770
|
+
const payload = JSON.parse(fs.readFileSync(payloadFile, "utf8"));
|
|
1771
|
+
return print(await post("/api/agent/google_marketplace_runtime_receipt", payload));
|
|
1772
|
+
}
|
|
1773
|
+
return print(await post("/api/agent/google_marketplace_runtime_receipt", {}));
|
|
1774
|
+
}
|
|
1775
|
+
if (cmd === "google-marketplace-runtime-ledger") {
|
|
1776
|
+
const payloadFile = url && !String(url).startsWith("--") ? url : "";
|
|
1777
|
+
if (payloadFile) {
|
|
1778
|
+
const payload = JSON.parse(fs.readFileSync(payloadFile, "utf8"));
|
|
1779
|
+
return print(await post("/api/agent/google_marketplace_runtime_evidence_ledger", payload));
|
|
1780
|
+
}
|
|
1781
|
+
return print(await get("/api/agent/google_marketplace_runtime_evidence_ledger"));
|
|
1782
|
+
}
|
|
1783
|
+
if (cmd === "google-marketplace-runtime-evidence") {
|
|
1784
|
+
const arg = url && !String(url).startsWith("--") ? url : "";
|
|
1785
|
+
if (arg && /^https?:\/\//i.test(arg)) {
|
|
1786
|
+
return print(await get(`/api/agent/google_marketplace_runtime_evidence_gate?url=${encodeURIComponent(arg)}`));
|
|
1787
|
+
}
|
|
1788
|
+
if (arg) {
|
|
1789
|
+
const payload = JSON.parse(fs.readFileSync(arg, "utf8"));
|
|
1790
|
+
return print(await post("/api/agent/google_marketplace_runtime_evidence_gate", payload));
|
|
1791
|
+
}
|
|
1792
|
+
return print(await get("/api/agent/google_marketplace_runtime_evidence_gate"));
|
|
1793
|
+
}
|
|
1794
|
+
if (cmd === "google-marketplace-test-billing") {
|
|
1795
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1796
|
+
if (evidenceFile) {
|
|
1797
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1798
|
+
return print(await post("/api/agent/google_marketplace_test_billing_gate", payload));
|
|
1799
|
+
}
|
|
1800
|
+
return print(await get("/api/agent/google_marketplace_test_billing_gate"));
|
|
1801
|
+
}
|
|
1802
|
+
if (cmd === "google-marketplace-agent-card-validate") {
|
|
1803
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1804
|
+
if (evidenceFile) {
|
|
1805
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1806
|
+
return print(await post("/api/agent/google_marketplace_agent_card_validation_gate", payload));
|
|
1807
|
+
}
|
|
1808
|
+
return print(await get("/api/agent/google_marketplace_agent_card_validation_gate"));
|
|
1809
|
+
}
|
|
1810
|
+
if (cmd === "google-marketplace-agent-card-gcs-pack") {
|
|
1811
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1812
|
+
if (evidenceFile) {
|
|
1813
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1814
|
+
return print(await post("/api/agent/google_marketplace_agent_card_gcs_pack", payload));
|
|
1815
|
+
}
|
|
1816
|
+
return print(await get("/api/agent/google_marketplace_agent_card_gcs_pack"));
|
|
1817
|
+
}
|
|
1818
|
+
if (cmd === "google-marketplace-product-details-review") {
|
|
1819
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1820
|
+
if (evidenceFile) {
|
|
1821
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1822
|
+
return print(await post("/api/agent/google_marketplace_product_details_review_gate", payload));
|
|
1823
|
+
}
|
|
1824
|
+
return print(await get("/api/agent/google_marketplace_product_details_review_gate"));
|
|
1825
|
+
}
|
|
1826
|
+
if (cmd === "google-marketplace-export") {
|
|
1827
|
+
const outDir = readFlagValue(argv, "--out-dir");
|
|
1828
|
+
const arg = url && !String(url).startsWith("--") ? String(url) : "";
|
|
1829
|
+
let res;
|
|
1830
|
+
if (arg && /^https?:\/\//i.test(arg)) {
|
|
1831
|
+
res = await get(`/api/agent/google_marketplace_review_bundle?url=${encodeURIComponent(arg)}`);
|
|
1832
|
+
} else if (arg) {
|
|
1833
|
+
const payload = readRequiredJsonFile(arg, "evidence file");
|
|
1834
|
+
res = await post("/api/agent/google_marketplace_review_bundle", payload);
|
|
1835
|
+
} else {
|
|
1836
|
+
res = await get("/api/agent/google_marketplace_review_bundle");
|
|
1837
|
+
}
|
|
1838
|
+
return print(outDir ? writeSkillPackageFiles(res, outDir) : res);
|
|
1839
|
+
}
|
|
1840
|
+
if (cmd === "google-marketplace-review-index") {
|
|
1841
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1842
|
+
if (evidenceFile) {
|
|
1843
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1844
|
+
return print(await post("/api/agent/google_marketplace_review_index", payload));
|
|
1845
|
+
}
|
|
1846
|
+
return print(await get("/api/agent/google_marketplace_review_index"));
|
|
1847
|
+
}
|
|
1848
|
+
if (cmd === "google-marketplace-core-source-map") return print(await get("/api/agent/google_marketplace_core_source_map"));
|
|
1849
|
+
if (cmd === "google-marketplace-status") {
|
|
1850
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1851
|
+
if (evidenceFile) {
|
|
1852
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1853
|
+
return print(await post("/api/agent/google_marketplace_application_status", payload));
|
|
1854
|
+
}
|
|
1855
|
+
return print(await get("/api/agent/google_marketplace_application_status"));
|
|
1856
|
+
}
|
|
1857
|
+
if (cmd === "google-marketplace-evidence") {
|
|
1858
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1859
|
+
if (evidenceFile) {
|
|
1860
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1861
|
+
return print(await post("/api/agent/google_marketplace_application_evidence", payload));
|
|
1862
|
+
}
|
|
1863
|
+
return print(await get("/api/agent/google_marketplace_application_evidence"));
|
|
1864
|
+
}
|
|
1865
|
+
if (cmd === "google-marketplace-partner-application") {
|
|
1866
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1867
|
+
if (evidenceFile) {
|
|
1868
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1869
|
+
return print(await post("/api/agent/google_marketplace_partner_application_gate", payload));
|
|
1870
|
+
}
|
|
1871
|
+
return print(await get("/api/agent/google_marketplace_partner_application_gate"));
|
|
1872
|
+
}
|
|
1873
|
+
if (cmd === "google-marketplace-operations") return print(await get("/api/agent/google_marketplace_operations_gate"));
|
|
1874
|
+
if (cmd === "google-marketplace-ops-identity") {
|
|
1875
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1876
|
+
if (evidenceFile) {
|
|
1877
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1878
|
+
return print(await post("/api/agent/google_marketplace_ops_identity_gate", payload));
|
|
1879
|
+
}
|
|
1880
|
+
return print(await get("/api/agent/google_marketplace_ops_identity_gate"));
|
|
1881
|
+
}
|
|
1882
|
+
if (cmd === "google-marketplace-cloud-run-deployment") {
|
|
1883
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1884
|
+
if (evidenceFile) {
|
|
1885
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1886
|
+
return print(await post("/api/agent/google_marketplace_cloud_run_deployment_gate", payload));
|
|
1887
|
+
}
|
|
1888
|
+
return print(await get("/api/agent/google_marketplace_cloud_run_deployment_gate"));
|
|
1889
|
+
}
|
|
1890
|
+
if (cmd === "google-marketplace-live-surfaces") return print(await get(url ? `/api/agent/google_marketplace_live_surface_gate?url=${encodeURIComponent(url)}` : "/api/agent/google_marketplace_live_surface_gate"));
|
|
1891
|
+
if (cmd === "google-marketplace-preflight") {
|
|
1892
|
+
const arg = url && !String(url).startsWith("--") ? String(url) : "";
|
|
1893
|
+
if (arg && /^https?:\/\//i.test(arg)) {
|
|
1894
|
+
return print(await get(`/api/agent/google_marketplace_preflight?url=${encodeURIComponent(arg)}`));
|
|
1895
|
+
}
|
|
1896
|
+
if (arg) {
|
|
1897
|
+
const payload = readRequiredJsonFile(arg, "evidence file");
|
|
1898
|
+
return print(await post("/api/agent/google_marketplace_preflight", payload));
|
|
1899
|
+
}
|
|
1900
|
+
return print(await get("/api/agent/google_marketplace_preflight"));
|
|
1901
|
+
}
|
|
1902
|
+
if (cmd === "google-marketplace-publish") return print(await get("/api/agent/google_marketplace_publish_gate"));
|
|
1903
|
+
if (cmd === "google-marketplace-review-receipts") {
|
|
1904
|
+
const evidenceFile = url && !String(url).startsWith("--") ? url : "";
|
|
1905
|
+
if (evidenceFile) {
|
|
1906
|
+
const payload = JSON.parse(fs.readFileSync(evidenceFile, "utf8"));
|
|
1907
|
+
return print(await post("/api/agent/google_marketplace_review_receipt_gate", payload));
|
|
1908
|
+
}
|
|
1909
|
+
return print(await get("/api/agent/google_marketplace_review_receipt_gate"));
|
|
1910
|
+
}
|
|
1911
|
+
if (cmd === "google-marketplace-evidence-template") return print(await get("/api/agent/google_marketplace_evidence_template"));
|
|
1912
|
+
if (cmd === "google-marketplace-evidence-example") {
|
|
1913
|
+
const out = await get("/api/agent/google_marketplace_evidence_example");
|
|
1914
|
+
return print(out.example || out);
|
|
1915
|
+
}
|
|
1916
|
+
if (cmd === "google-marketplace-procurement-event") {
|
|
1917
|
+
const eventFile = url || readFlagValue(argv, "--event");
|
|
1918
|
+
const payload = eventFile ? JSON.parse(fs.readFileSync(eventFile, "utf8")) : {};
|
|
1919
|
+
return print(await post("/api/agent/google_marketplace_procurement_event", payload));
|
|
1920
|
+
}
|
|
1921
|
+
if (cmd === "google-marketplace-procurement-state") return print(await get("/api/agent/google_marketplace_procurement_state"));
|
|
1922
|
+
if (cmd === "google-marketplace-procurement-execute") {
|
|
1923
|
+
const actionFile = url || readFlagValue(argv, "--action");
|
|
1924
|
+
const payload = actionFile ? JSON.parse(fs.readFileSync(actionFile, "utf8")) : {};
|
|
1925
|
+
return print(await post("/api/agent/google_marketplace_procurement_execute", payload));
|
|
1926
|
+
}
|
|
1927
|
+
if (cmd === "google-marketplace-usage-report-payload") {
|
|
1928
|
+
const payloadFile = url && !String(url).startsWith("--") ? url : "";
|
|
1929
|
+
if (payloadFile) {
|
|
1930
|
+
const payload = JSON.parse(fs.readFileSync(payloadFile, "utf8"));
|
|
1931
|
+
return print(await post("/api/agent/google_marketplace_usage_report_payload", payload));
|
|
1932
|
+
}
|
|
1933
|
+
return print(await get("/api/agent/google_marketplace_usage_report_payload"));
|
|
1934
|
+
}
|
|
1935
|
+
if (cmd === "google-marketplace-usage-report-execute") {
|
|
1936
|
+
const payloadFile = url || readFlagValue(argv, "--payload");
|
|
1937
|
+
const payload = payloadFile ? JSON.parse(fs.readFileSync(payloadFile, "utf8")) : {};
|
|
1938
|
+
return print(await post("/api/agent/google_marketplace_usage_report_execute", payload));
|
|
1939
|
+
}
|
|
1940
|
+
if (cmd === "google-marketplace-frontend") return print(await get("/api/agent/google_marketplace_frontend_integration"));
|
|
1941
|
+
if (cmd === "google-marketplace-account-link") {
|
|
1942
|
+
const payload = url ? JSON.parse(fs.readFileSync(url, "utf8")) : {};
|
|
1943
|
+
return print(await post("/api/agent/google_marketplace_account_link", payload));
|
|
1944
|
+
}
|
|
1945
|
+
if (cmd === "google-marketplace-jwt-verifier") {
|
|
1946
|
+
const payload = url ? JSON.parse(fs.readFileSync(url, "utf8")) : null;
|
|
1947
|
+
return print(payload ? await post("/api/agent/google_marketplace_jwt_verifier_gate", payload) : await get("/api/agent/google_marketplace_jwt_verifier_gate"));
|
|
1948
|
+
}
|
|
1949
|
+
if (cmd === "validate-skill-package") return print(validateSkillPackageDir(url || "."));
|
|
1950
|
+
if (cmd === "implementation-bundle") {
|
|
1951
|
+
const auditFlag = argv.includes("--audit") ? "&audit=1" : "";
|
|
1952
|
+
return print(await get(url ? `/api/agent/implementation_bundle?url=${encodeURIComponent(url)}${auditFlag}` : "/api/agent/implementation_bundle"));
|
|
1953
|
+
}
|
|
1954
|
+
if (cmd === "optimization-cycle") {
|
|
1955
|
+
const auditFlag = argv.includes("--audit") ? "&audit=1" : "";
|
|
1956
|
+
return print(await get(url ? `/api/agent/optimization_cycle?url=${encodeURIComponent(url)}${auditFlag}` : "/api/agent/optimization_cycle"));
|
|
1957
|
+
}
|
|
1958
|
+
if (cmd === "insights") return print(await get(url ? `/api/agent/insights?url=${encodeURIComponent(url)}` : "/api/agent/insights"));
|
|
1959
|
+
if (cmd === "insight-drafts") return print(await post("/api/agent/insights/job_drafts", { url }));
|
|
1960
|
+
if (cmd === "insight-accept-draft") {
|
|
1961
|
+
const drafts = await post("/api/agent/insights/job_drafts", { url });
|
|
1962
|
+
const draft = drafts.drafts && drafts.drafts[0];
|
|
1963
|
+
return print(draft ? await post("/api/agent/job_drafts/accept", { draft }) : drafts);
|
|
1964
|
+
}
|
|
1965
|
+
if (cmd === "site-actions") return print(await get("/api/site_agents/actions"));
|
|
1966
|
+
if (cmd === "site-insights") {
|
|
1967
|
+
const keyIdx = argv.indexOf("--key");
|
|
1968
|
+
return print(await post("/api/site_agents/call", {
|
|
1969
|
+
url,
|
|
1970
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
1971
|
+
action: "insights",
|
|
1972
|
+
audit_url: argv.includes("--audit")
|
|
1973
|
+
}));
|
|
1974
|
+
}
|
|
1975
|
+
if (cmd === "site-feed" || cmd === "site-insights-feed") {
|
|
1976
|
+
const keyIdx = argv.indexOf("--key");
|
|
1977
|
+
const contentIdx = argv.indexOf("--content");
|
|
1978
|
+
const questionIdx = argv.indexOf("--question");
|
|
1979
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1980
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
1981
|
+
return print(await post("/api/site_agents/call", {
|
|
1982
|
+
url,
|
|
1983
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
1984
|
+
action: "insights_feed",
|
|
1985
|
+
audit_url: argv.includes("--audit"),
|
|
1986
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
1987
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
1988
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
1989
|
+
a2_citation_package: a2CitationPackage
|
|
1990
|
+
}));
|
|
1991
|
+
}
|
|
1992
|
+
if (cmd === "site-refresh-inbox" || cmd === "site-inbox-refresh") {
|
|
1993
|
+
const keyIdx = argv.indexOf("--key");
|
|
1994
|
+
const contentIdx = argv.indexOf("--content");
|
|
1995
|
+
const questionIdx = argv.indexOf("--question");
|
|
1996
|
+
const engineIdx = argv.indexOf("--engine");
|
|
1997
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
1998
|
+
return print(await post("/api/site_agents/call", {
|
|
1999
|
+
url,
|
|
2000
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2001
|
+
action: "refresh_insight_inbox",
|
|
2002
|
+
audit_url: argv.includes("--audit"),
|
|
2003
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2004
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2005
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2006
|
+
a2_citation_package: a2CitationPackage
|
|
2007
|
+
}));
|
|
2008
|
+
}
|
|
2009
|
+
if (cmd === "site-inbox" || cmd === "site-insight-inbox") {
|
|
2010
|
+
const keyIdx = argv.indexOf("--key");
|
|
2011
|
+
return print(await post("/api/site_agents/call", {
|
|
2012
|
+
url,
|
|
2013
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2014
|
+
action: "insight_inbox",
|
|
2015
|
+
include_acknowledged: argv.includes("--all") || argv.includes("--include-acknowledged")
|
|
2016
|
+
}));
|
|
2017
|
+
}
|
|
2018
|
+
if (cmd === "site-ack-insight" || cmd === "site-acknowledge-insight") {
|
|
2019
|
+
const keyIdx = argv.indexOf("--key");
|
|
2020
|
+
return print(await post("/api/site_agents/call", {
|
|
2021
|
+
url,
|
|
2022
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2023
|
+
action: "acknowledge_insight",
|
|
2024
|
+
item_id: argv[2] || ""
|
|
2025
|
+
}));
|
|
2026
|
+
}
|
|
2027
|
+
if (cmd === "site-apply-plan" || cmd === "site-apply") {
|
|
2028
|
+
const keyIdx = argv.indexOf("--key");
|
|
2029
|
+
const contentIdx = argv.indexOf("--content");
|
|
2030
|
+
const questionIdx = argv.indexOf("--question");
|
|
2031
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2032
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
2033
|
+
return print(await post("/api/site_agents/call", {
|
|
2034
|
+
url,
|
|
2035
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2036
|
+
action: "apply_plan",
|
|
2037
|
+
audit_url: argv.includes("--audit"),
|
|
2038
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2039
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2040
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2041
|
+
a2_citation_package: a2CitationPackage
|
|
2042
|
+
}));
|
|
2043
|
+
}
|
|
2044
|
+
if (cmd === "site-apply-evidence" || cmd === "site-report-apply-evidence") {
|
|
2045
|
+
const keyIdx = argv.indexOf("--key");
|
|
2046
|
+
const uriIdx = argv.indexOf("--uri");
|
|
2047
|
+
const evidenceIdx = argv.indexOf("--evidence");
|
|
2048
|
+
const routeIdx = argv.indexOf("--route");
|
|
2049
|
+
const evidence = evidenceIdx >= 0 ? JSON.parse(fs.readFileSync(argv[evidenceIdx + 1], "utf8")) : undefined;
|
|
2050
|
+
return print(await post("/api/site_agents/call", {
|
|
2051
|
+
url,
|
|
2052
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2053
|
+
action: "apply_evidence",
|
|
2054
|
+
apply_item_id: argv[2],
|
|
2055
|
+
evidence_uri: uriIdx >= 0 ? argv[uriIdx + 1] : "",
|
|
2056
|
+
route: routeIdx >= 0 ? argv[routeIdx + 1] : undefined,
|
|
2057
|
+
verify_proof: argv.includes("--verify"),
|
|
2058
|
+
evidence
|
|
2059
|
+
}));
|
|
2060
|
+
}
|
|
2061
|
+
if (cmd === "site-outcome-report") {
|
|
2062
|
+
const keyIdx = argv.indexOf("--key");
|
|
2063
|
+
return print(await post("/api/site_agents/call", {
|
|
2064
|
+
url,
|
|
2065
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2066
|
+
action: "outcome_report"
|
|
2067
|
+
}));
|
|
2068
|
+
}
|
|
2069
|
+
if (cmd === "site-outcome-package") {
|
|
2070
|
+
const keyIdx = argv.indexOf("--key");
|
|
2071
|
+
return print(await post("/api/site_agents/call", {
|
|
2072
|
+
url,
|
|
2073
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2074
|
+
action: "m1_outcome_evidence_package"
|
|
2075
|
+
}));
|
|
2076
|
+
}
|
|
2077
|
+
if (cmd === "site-monthly-package") {
|
|
2078
|
+
const keyIdx = argv.indexOf("--key");
|
|
2079
|
+
const contentIdx = argv.indexOf("--content");
|
|
2080
|
+
const questionIdx = argv.indexOf("--question");
|
|
2081
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2082
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2083
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
2084
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
2085
|
+
return print(await post("/api/site_agents/call", {
|
|
2086
|
+
url,
|
|
2087
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2088
|
+
action: "m2_monthly_optimization_package",
|
|
2089
|
+
audit_url: argv.includes("--audit"),
|
|
2090
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2091
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2092
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2093
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2094
|
+
content_publication_package: publicationPackage,
|
|
2095
|
+
a2_citation_package: a2CitationPackage
|
|
2096
|
+
}));
|
|
2097
|
+
}
|
|
2098
|
+
if (cmd === "site-monthly-tracker") {
|
|
2099
|
+
const keyIdx = argv.indexOf("--key");
|
|
2100
|
+
const contentIdx = argv.indexOf("--content");
|
|
2101
|
+
const questionIdx = argv.indexOf("--question");
|
|
2102
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2103
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2104
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
2105
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
2106
|
+
return print(await post("/api/site_agents/call", {
|
|
2107
|
+
url,
|
|
2108
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2109
|
+
action: "m3_monthly_execution_tracker",
|
|
2110
|
+
audit_url: argv.includes("--audit"),
|
|
2111
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2112
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2113
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2114
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2115
|
+
content_publication_package: publicationPackage,
|
|
2116
|
+
a2_citation_package: a2CitationPackage
|
|
2117
|
+
}));
|
|
2118
|
+
}
|
|
2119
|
+
if (cmd === "site-monthly-scorecard") {
|
|
2120
|
+
const keyIdx = argv.indexOf("--key");
|
|
2121
|
+
const contentIdx = argv.indexOf("--content");
|
|
2122
|
+
const questionIdx = argv.indexOf("--question");
|
|
2123
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2124
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2125
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
2126
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
2127
|
+
return print(await post("/api/site_agents/call", {
|
|
2128
|
+
url,
|
|
2129
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2130
|
+
action: "m4_monthly_outcome_scorecard",
|
|
2131
|
+
audit_url: argv.includes("--audit"),
|
|
2132
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2133
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2134
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2135
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2136
|
+
content_publication_package: publicationPackage,
|
|
2137
|
+
a2_citation_package: a2CitationPackage
|
|
2138
|
+
}));
|
|
2139
|
+
}
|
|
2140
|
+
if (cmd === "site-monthly-dashboard") {
|
|
2141
|
+
const keyIdx = argv.indexOf("--key");
|
|
2142
|
+
const contentIdx = argv.indexOf("--content");
|
|
2143
|
+
const questionIdx = argv.indexOf("--question");
|
|
2144
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2145
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2146
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
2147
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
2148
|
+
return print(await post("/api/site_agents/call", {
|
|
2149
|
+
url,
|
|
2150
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2151
|
+
action: "m5_monthly_dashboard",
|
|
2152
|
+
audit_url: argv.includes("--audit"),
|
|
2153
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2154
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2155
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2156
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2157
|
+
content_publication_package: publicationPackage,
|
|
2158
|
+
a2_citation_package: a2CitationPackage
|
|
2159
|
+
}));
|
|
2160
|
+
}
|
|
2161
|
+
if (cmd === "site-monthly-loop") {
|
|
2162
|
+
const keyIdx = argv.indexOf("--key");
|
|
2163
|
+
const contentIdx = argv.indexOf("--content");
|
|
2164
|
+
const questionIdx = argv.indexOf("--question");
|
|
2165
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2166
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2167
|
+
const publicationPackage = readJsonFlag(argv, "--publication");
|
|
2168
|
+
const a2CitationPackage = readJsonFlag(argv, "--a2-package") || readJsonFlag(argv, "--citation-package");
|
|
2169
|
+
return print(await post("/api/site_agents/call", {
|
|
2170
|
+
url,
|
|
2171
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2172
|
+
action: "monthly_evidence_loop",
|
|
2173
|
+
audit_url: argv.includes("--audit"),
|
|
2174
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2175
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2176
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2177
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2178
|
+
content_publication_package: publicationPackage,
|
|
2179
|
+
a2_citation_package: a2CitationPackage
|
|
2180
|
+
}));
|
|
2181
|
+
}
|
|
2182
|
+
if (cmd === "site-optimization-cycle") {
|
|
2183
|
+
const keyIdx = argv.indexOf("--key");
|
|
2184
|
+
return print(await post("/api/site_agents/call", {
|
|
2185
|
+
url,
|
|
2186
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2187
|
+
action: "optimization_cycle",
|
|
2188
|
+
audit_url: argv.includes("--audit")
|
|
2189
|
+
}));
|
|
2190
|
+
}
|
|
2191
|
+
if (cmd === "site-audit-package") {
|
|
2192
|
+
const keyIdx = argv.indexOf("--key");
|
|
2193
|
+
return print(await post("/api/site_agents/call", {
|
|
2194
|
+
url,
|
|
2195
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2196
|
+
action: "audit_file_package",
|
|
2197
|
+
audit_url: argv.includes("--audit")
|
|
2198
|
+
}));
|
|
2199
|
+
}
|
|
2200
|
+
if (cmd === "site-skill-package") {
|
|
2201
|
+
const keyIdx = argv.indexOf("--key");
|
|
2202
|
+
return print(await post("/api/site_agents/call", {
|
|
2203
|
+
url,
|
|
2204
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2205
|
+
action: "skill_package"
|
|
2206
|
+
}));
|
|
2207
|
+
}
|
|
2208
|
+
if (cmd === "site-implementation-bundle") {
|
|
2209
|
+
const keyIdx = argv.indexOf("--key");
|
|
2210
|
+
return print(await post("/api/site_agents/call", {
|
|
2211
|
+
url,
|
|
2212
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2213
|
+
action: "implementation_bundle",
|
|
2214
|
+
audit_url: argv.includes("--audit")
|
|
2215
|
+
}));
|
|
2216
|
+
}
|
|
2217
|
+
if (cmd === "site-install-descriptor") {
|
|
2218
|
+
const keyIdx = argv.indexOf("--key");
|
|
2219
|
+
return print(await post("/api/site_agents/call", {
|
|
2220
|
+
url,
|
|
2221
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2222
|
+
action: "install_descriptor"
|
|
2223
|
+
}));
|
|
2224
|
+
}
|
|
2225
|
+
if (cmd === "site-installation-verification") {
|
|
2226
|
+
const keyIdx = argv.indexOf("--key");
|
|
2227
|
+
return print(await post("/api/site_agents/call", {
|
|
2228
|
+
url,
|
|
2229
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2230
|
+
action: "installation_verification",
|
|
2231
|
+
audit_url: argv.includes("--audit")
|
|
2232
|
+
}));
|
|
2233
|
+
}
|
|
2234
|
+
if (cmd === "site-content-plan") {
|
|
2235
|
+
const keyIdx = argv.indexOf("--key");
|
|
2236
|
+
const contentIdx = argv.indexOf("--content");
|
|
2237
|
+
const questionIdx = argv.indexOf("--question");
|
|
2238
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2239
|
+
return print(await post("/api/site_agents/call", {
|
|
2240
|
+
url,
|
|
2241
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2242
|
+
action: "content_optimization_plan",
|
|
2243
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2244
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2245
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2246
|
+
audit_url: argv.includes("--audit")
|
|
2247
|
+
}));
|
|
2248
|
+
}
|
|
2249
|
+
if (cmd === "site-content-workflow") {
|
|
2250
|
+
const keyIdx = argv.indexOf("--key");
|
|
2251
|
+
const contentIdx = argv.indexOf("--content");
|
|
2252
|
+
const questionIdx = argv.indexOf("--question");
|
|
2253
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2254
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2255
|
+
return print(await post("/api/site_agents/call", {
|
|
2256
|
+
url,
|
|
2257
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2258
|
+
action: "content_workflow_package",
|
|
2259
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2260
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2261
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2262
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2263
|
+
audit_url: argv.includes("--audit")
|
|
2264
|
+
}));
|
|
2265
|
+
}
|
|
2266
|
+
if (cmd === "site-content-pack") {
|
|
2267
|
+
const keyIdx = argv.indexOf("--key");
|
|
2268
|
+
const contentIdx = argv.indexOf("--content");
|
|
2269
|
+
const questionIdx = argv.indexOf("--question");
|
|
2270
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2271
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2272
|
+
const evidenceIdx = argv.indexOf("--evidence");
|
|
2273
|
+
const publishedItems = evidenceIdx >= 0 ? JSON.parse(fs.readFileSync(argv[evidenceIdx + 1], "utf8")) : [];
|
|
2274
|
+
return print(await post("/api/site_agents/call", {
|
|
2275
|
+
url,
|
|
2276
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2277
|
+
action: "content_pack",
|
|
2278
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2279
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2280
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2281
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2282
|
+
published_items: publishedItems,
|
|
2283
|
+
audit_url: argv.includes("--audit"),
|
|
2284
|
+
verify_publication: argv.includes("--verify")
|
|
2285
|
+
}));
|
|
2286
|
+
}
|
|
2287
|
+
if (cmd === "site-content-repair") {
|
|
2288
|
+
const keyIdx = argv.indexOf("--key");
|
|
2289
|
+
const contentIdx = argv.indexOf("--content");
|
|
2290
|
+
const questionIdx = argv.indexOf("--question");
|
|
2291
|
+
const reviewGateIdx = argv.indexOf("--review-gate");
|
|
2292
|
+
const reviewGate = reviewGateIdx >= 0 ? JSON.parse(fs.readFileSync(argv[reviewGateIdx + 1], "utf8")) : undefined;
|
|
2293
|
+
return print(await post("/api/site_agents/call", {
|
|
2294
|
+
url,
|
|
2295
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2296
|
+
action: "content_repair_pack",
|
|
2297
|
+
...(reviewGate ? { review_gate: reviewGate } : {}),
|
|
2298
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2299
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : []
|
|
2300
|
+
}));
|
|
2301
|
+
}
|
|
2302
|
+
if (cmd === "site-content-publication") {
|
|
2303
|
+
const keyIdx = argv.indexOf("--key");
|
|
2304
|
+
const evidenceIdx = argv.indexOf("--evidence");
|
|
2305
|
+
const publishedItems = evidenceIdx >= 0 ? JSON.parse(fs.readFileSync(argv[evidenceIdx + 1], "utf8")) : [];
|
|
2306
|
+
return print(await post("/api/site_agents/call", {
|
|
2307
|
+
url,
|
|
2308
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2309
|
+
action: "content_publication_package",
|
|
2310
|
+
published_items: publishedItems,
|
|
2311
|
+
audit_url: argv.includes("--audit"),
|
|
2312
|
+
verify_publication: argv.includes("--verify")
|
|
2313
|
+
}));
|
|
2314
|
+
}
|
|
2315
|
+
if (cmd === "site-citation-gap") {
|
|
2316
|
+
const keyIdx = argv.indexOf("--key");
|
|
2317
|
+
const contentIdx = argv.indexOf("--content");
|
|
2318
|
+
const questionIdx = argv.indexOf("--question");
|
|
2319
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2320
|
+
return print(await post("/api/site_agents/call", {
|
|
2321
|
+
url,
|
|
2322
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2323
|
+
action: "citation_gap_matrix",
|
|
2324
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2325
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2326
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2327
|
+
audit_url: argv.includes("--audit")
|
|
2328
|
+
}));
|
|
2329
|
+
}
|
|
2330
|
+
if (cmd === "site-community-plan") {
|
|
2331
|
+
const keyIdx = argv.indexOf("--key");
|
|
2332
|
+
const contentIdx = argv.indexOf("--content");
|
|
2333
|
+
const questionIdx = argv.indexOf("--question");
|
|
2334
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2335
|
+
return print(await post("/api/site_agents/call", {
|
|
2336
|
+
url,
|
|
2337
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2338
|
+
action: "community_citation_plan",
|
|
2339
|
+
content: contentIdx >= 0 ? argv[contentIdx + 1] : "",
|
|
2340
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2341
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2342
|
+
audit_url: argv.includes("--audit")
|
|
2343
|
+
}));
|
|
2344
|
+
}
|
|
2345
|
+
if (cmd === "site-prompt-sheet") {
|
|
2346
|
+
const keyIdx = argv.indexOf("--key");
|
|
2347
|
+
const questionIdx = argv.indexOf("--question");
|
|
2348
|
+
const topicIdx = argv.indexOf("--topic");
|
|
2349
|
+
const engineIdx = argv.indexOf("--engine");
|
|
2350
|
+
const competitorIdx = argv.indexOf("--competitor");
|
|
2351
|
+
const marketIdx = argv.indexOf("--market");
|
|
2352
|
+
return print(await post("/api/site_agents/call", {
|
|
2353
|
+
url,
|
|
2354
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2355
|
+
action: "prompt_test_run_sheet",
|
|
2356
|
+
questions: questionIdx >= 0 ? [argv[questionIdx + 1]] : [],
|
|
2357
|
+
topics: topicIdx >= 0 ? [argv[topicIdx + 1]] : [],
|
|
2358
|
+
engines: engineIdx >= 0 ? argv[engineIdx + 1] : "",
|
|
2359
|
+
competitors: competitorIdx >= 0 ? [argv[competitorIdx + 1]] : [],
|
|
2360
|
+
market: marketIdx >= 0 ? argv[marketIdx + 1] : "",
|
|
2361
|
+
source: "agent-id-cli"
|
|
2362
|
+
}));
|
|
2363
|
+
}
|
|
2364
|
+
if (cmd === "site-prompt-results") {
|
|
2365
|
+
const keyIdx = argv.indexOf("--key");
|
|
2366
|
+
const payload = JSON.parse(fs.readFileSync(argv[2], "utf8"));
|
|
2367
|
+
return print(await post("/api/site_agents/call", {
|
|
2368
|
+
...payload,
|
|
2369
|
+
url,
|
|
2370
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2371
|
+
action: "prompt_test_results"
|
|
2372
|
+
}));
|
|
2373
|
+
}
|
|
2374
|
+
if (cmd === "site-b1-package") {
|
|
2375
|
+
const keyIdx = argv.indexOf("--key");
|
|
2376
|
+
const eventsIdx = argv.indexOf("--events");
|
|
2377
|
+
const events = eventsIdx >= 0 ? JSON.parse(fs.readFileSync(argv[eventsIdx + 1], "utf8")) : [];
|
|
2378
|
+
return print(await post("/api/site_agents/call", {
|
|
2379
|
+
url,
|
|
2380
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2381
|
+
action: "b1_conversion_evidence_package",
|
|
2382
|
+
events
|
|
2383
|
+
}));
|
|
2384
|
+
}
|
|
2385
|
+
if (cmd === "site-job-drafts") {
|
|
2386
|
+
const keyIdx = argv.indexOf("--key");
|
|
2387
|
+
const currencyIdx = argv.indexOf("--currency");
|
|
2388
|
+
const providerIdx = argv.indexOf("--provider");
|
|
2389
|
+
const evaluatorIdx = argv.indexOf("--evaluator");
|
|
2390
|
+
return print(await post("/api/site_agents/call", {
|
|
2391
|
+
url,
|
|
2392
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2393
|
+
action: "job_drafts",
|
|
2394
|
+
currency: currencyIdx >= 0 ? argv[currencyIdx + 1] : undefined,
|
|
2395
|
+
provider: providerIdx >= 0 ? argv[providerIdx + 1] : undefined,
|
|
2396
|
+
evaluator: evaluatorIdx >= 0 ? argv[evaluatorIdx + 1] : undefined,
|
|
2397
|
+
audit_url: argv.includes("--audit")
|
|
2398
|
+
}));
|
|
2399
|
+
}
|
|
2400
|
+
if (cmd === "site-accept-draft") {
|
|
2401
|
+
const keyIdx = argv.indexOf("--key");
|
|
2402
|
+
const draft = JSON.parse(fs.readFileSync(argv[2], "utf8"));
|
|
2403
|
+
return print(await post("/api/site_agents/call", {
|
|
2404
|
+
url,
|
|
2405
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2406
|
+
action: "accept_job_draft",
|
|
2407
|
+
draft
|
|
2408
|
+
}));
|
|
2409
|
+
}
|
|
2410
|
+
if (cmd === "site-decide-draft") {
|
|
2411
|
+
const keyIdx = argv.indexOf("--key");
|
|
2412
|
+
const decisionIdx = argv.indexOf("--decision");
|
|
2413
|
+
const reasonIdx = argv.indexOf("--reason");
|
|
2414
|
+
const draftIdIdx = argv.indexOf("--draft-id");
|
|
2415
|
+
const draft = argv[2] && !argv[2].startsWith("--") ? JSON.parse(fs.readFileSync(argv[2], "utf8")) : undefined;
|
|
2416
|
+
return print(await post("/api/site_agents/call", {
|
|
2417
|
+
url,
|
|
2418
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2419
|
+
action: "decide_job_draft",
|
|
2420
|
+
decision: decisionIdx >= 0 ? argv[decisionIdx + 1] : "defer",
|
|
2421
|
+
draft,
|
|
2422
|
+
draft_id: draftIdIdx >= 0 ? argv[draftIdIdx + 1] : undefined,
|
|
2423
|
+
reason: reasonIdx >= 0 ? argv[reasonIdx + 1] : undefined
|
|
2424
|
+
}));
|
|
2425
|
+
}
|
|
2426
|
+
if (cmd === "site-draft-decisions") {
|
|
2427
|
+
const keyIdx = argv.indexOf("--key");
|
|
2428
|
+
const decisionIdx = argv.indexOf("--decision");
|
|
2429
|
+
const draftIdIdx = argv.indexOf("--draft-id");
|
|
2430
|
+
return print(await post("/api/site_agents/call", {
|
|
2431
|
+
url,
|
|
2432
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2433
|
+
action: "draft_decisions",
|
|
2434
|
+
decision: decisionIdx >= 0 ? argv[decisionIdx + 1] : undefined,
|
|
2435
|
+
draft_id: draftIdIdx >= 0 ? argv[draftIdIdx + 1] : undefined
|
|
2436
|
+
}));
|
|
2437
|
+
}
|
|
2438
|
+
if (cmd === "site-decision-reviews") {
|
|
2439
|
+
const keyIdx = argv.indexOf("--key");
|
|
2440
|
+
const decisionIdx = argv.indexOf("--decision");
|
|
2441
|
+
const itemIdx = argv.indexOf("--item-id");
|
|
2442
|
+
return print(await post("/api/site_agents/call", {
|
|
2443
|
+
url,
|
|
2444
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2445
|
+
action: "decision_reviews",
|
|
2446
|
+
decision: decisionIdx >= 0 ? argv[decisionIdx + 1] : undefined,
|
|
2447
|
+
apply_item_id: itemIdx >= 0 ? argv[itemIdx + 1] : undefined
|
|
2448
|
+
}));
|
|
2449
|
+
}
|
|
2450
|
+
if (cmd === "site-jobs") {
|
|
2451
|
+
const keyIdx = argv.indexOf("--key");
|
|
2452
|
+
const agentKey = keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY;
|
|
2453
|
+
return print(await post("/api/site_agents/call", { url, agent_key: agentKey, action: "jobs" }));
|
|
2454
|
+
}
|
|
2455
|
+
if (cmd === "site-c5-repairs") {
|
|
2456
|
+
const keyIdx = argv.indexOf("--key");
|
|
2457
|
+
const agentKey = keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY;
|
|
2458
|
+
return print(await post("/api/site_agents/call", { url, agent_key: agentKey, action: "c5_repair_history" }));
|
|
2459
|
+
}
|
|
2460
|
+
if (cmd === "site-job-evidence") {
|
|
2461
|
+
const keyIdx = argv.indexOf("--key");
|
|
2462
|
+
const uriIdx = argv.indexOf("--uri");
|
|
2463
|
+
const evidenceIdx = argv.indexOf("--evidence");
|
|
2464
|
+
const evidence = evidenceIdx >= 0 ? JSON.parse(fs.readFileSync(argv[evidenceIdx + 1], "utf8")) : undefined;
|
|
2465
|
+
return print(await post("/api/site_agents/call", {
|
|
2466
|
+
url,
|
|
2467
|
+
agent_key: keyIdx >= 0 ? argv[keyIdx + 1] : process.env.AEO_AGENT_KEY,
|
|
2468
|
+
action: "report_job_evidence",
|
|
2469
|
+
job_id: argv[2],
|
|
2470
|
+
evidence_uri: uriIdx >= 0 ? argv[uriIdx + 1] : "",
|
|
2471
|
+
evidence
|
|
2472
|
+
}));
|
|
2473
|
+
}
|
|
2474
|
+
if (cmd === "job-drafts") return print(await post("/api/agent/job_drafts", { url }));
|
|
2475
|
+
if (cmd === "job-accept-draft") {
|
|
2476
|
+
const drafts = await post("/api/agent/job_drafts", { url });
|
|
2477
|
+
const draft = drafts.drafts && drafts.drafts[0];
|
|
2478
|
+
return print(draft ? await post("/api/agent/job_drafts/accept", { draft }) : drafts);
|
|
2479
|
+
}
|
|
2480
|
+
if (cmd === "job-create") return print(await post("/api/agent/jobs/create", { url, job_type: "aeo_setup" }));
|
|
2481
|
+
if (cmd === "job-fund") return print(await post("/api/agent/jobs/fund", { job_id: url }));
|
|
2482
|
+
if (cmd === "job-payment-quote") return print(await post("/api/agent/jobs/payment_quote", { job_id: url }));
|
|
2483
|
+
if (cmd === "job-fund-proof") return print(await post("/api/agent/jobs/fund_with_proof", { job_id: url, payment_proof: { source: "agent-id-cli", proof: argv[2] || "" } }));
|
|
2484
|
+
if (cmd === "job-submit") return print(await post("/api/agent/jobs/submit", { job_id: url, deliverable: { source: "agent-id-cli" } }));
|
|
2485
|
+
if (cmd === "job-evaluate") {
|
|
2486
|
+
const decisionIdx = argv.indexOf("--decision");
|
|
2487
|
+
const reasonIdx = argv.indexOf("--reason");
|
|
2488
|
+
const evaluatorIdx = argv.indexOf("--evaluator");
|
|
2489
|
+
return print(await post("/api/agent/jobs/evaluate", {
|
|
2490
|
+
job_id: url,
|
|
2491
|
+
decision: decisionIdx >= 0 ? argv[decisionIdx + 1] : "complete",
|
|
2492
|
+
reason: reasonIdx >= 0 ? argv[reasonIdx + 1] : undefined,
|
|
2493
|
+
evaluator: evaluatorIdx >= 0 ? argv[evaluatorIdx + 1] : undefined
|
|
2494
|
+
}));
|
|
2495
|
+
}
|
|
2496
|
+
if (cmd === "checkout") return print(await post("/api/agent/checkout", { plan: url }));
|
|
2497
|
+
if (cmd === "register") return print(await post("/api/site_agents/register", { url }));
|
|
2498
|
+
if (cmd === "install-guide") return print(await get(url ? `/api/site_agents/install_guide?url=${encodeURIComponent(url)}` : "/api/site_agents/install_guide"));
|
|
2499
|
+
if (cmd === "install") {
|
|
2500
|
+
if (!url) throw new Error("install requires a site URL");
|
|
2501
|
+
const projectRoot = readFlagValue(argv, "--project-root") || process.cwd();
|
|
2502
|
+
const detectedPlan = await buildInstallPlan({ url, projectRoot, endpoint });
|
|
2503
|
+
const plan = {
|
|
2504
|
+
schema: "agentx-signed-install-plan-v1",
|
|
2505
|
+
site_url: detectedPlan.site_url,
|
|
2506
|
+
parent_endpoint: detectedPlan.parent_endpoint,
|
|
2507
|
+
project_root: detectedPlan.project_root,
|
|
2508
|
+
framework: detectedPlan.framework,
|
|
2509
|
+
package_manager: detectedPlan.package_manager,
|
|
2510
|
+
identity_mode: "ed25519_domain_bound",
|
|
2511
|
+
approval_required: true,
|
|
2512
|
+
side_effects: ["create_customer_private_key", "write_agent_id_state", "write_public_domain_proof"],
|
|
2513
|
+
excluded_side_effects: ["package_install", "shared_site_agent_key", "customer_content_change", "deployment", "database_change", "default_branch_push"],
|
|
2514
|
+
};
|
|
2515
|
+
if (!argv.includes("--apply")) {
|
|
2516
|
+
return printSignedInstallResult({
|
|
2517
|
+
ok: true,
|
|
2518
|
+
dry_run: true,
|
|
2519
|
+
plan,
|
|
2520
|
+
next_command: `agent-id install ${url} --project-root ${projectRoot} --apply`,
|
|
2521
|
+
non_claims: ["does_not_register_domain", "does_not_create_private_key", "does_not_modify_customer_site"]
|
|
2522
|
+
});
|
|
2523
|
+
}
|
|
2524
|
+
const publicRoot = path.resolve(readFlagValue(argv, "--public-root") || projectRoot);
|
|
2525
|
+
const gate = await releaseCheck({ printResult: false, setExitCode: false });
|
|
2526
|
+
if (!gate.ok) throw new Error(`release gate blocked: ${gate.blockers.join(", ")}`);
|
|
2527
|
+
const enrollment = await createEnterpriseEnrollment({
|
|
2528
|
+
siteUrl: url,
|
|
2529
|
+
projectRoot: path.resolve(projectRoot),
|
|
2530
|
+
publicRoot,
|
|
2531
|
+
environment: readFlagValue(argv, "--environment") || "production",
|
|
2532
|
+
method: readFlagValue(argv, "--method") || "well_known",
|
|
2533
|
+
applyProof: true,
|
|
2534
|
+
});
|
|
2535
|
+
if (!enrollment.ok) throw new Error(enrollment.error || "enterprise_enrollment_failed");
|
|
2536
|
+
return printSignedInstallResult({
|
|
2537
|
+
ok: true,
|
|
2538
|
+
dry_run: false,
|
|
2539
|
+
plan,
|
|
2540
|
+
release: gate,
|
|
2541
|
+
enrollment,
|
|
2542
|
+
non_claims: ["domain_verification_still_required", "shared_site_agent_key_not_used", "does_not_modify_customer_content"]
|
|
2543
|
+
});
|
|
2544
|
+
}
|
|
2545
|
+
if (cmd === "install-resume") {
|
|
2546
|
+
return print(await resumeInstall(readFlagValue(argv, "--project-root") || process.cwd()));
|
|
2547
|
+
}
|
|
2548
|
+
if (cmd === "install-uninstall") {
|
|
2549
|
+
return print(await uninstallInstall(readFlagValue(argv, "--project-root") || process.cwd(), { approved: argv.includes("--approve") }));
|
|
2550
|
+
}
|
|
2551
|
+
if (cmd === "enterprise-enroll") {
|
|
2552
|
+
if (!url || url.startsWith("--")) throw new Error("enterprise-enroll requires a site URL");
|
|
2553
|
+
const projectRoot = path.resolve(readFlagValue(argv, "--project-root") || process.cwd());
|
|
2554
|
+
const environment = readFlagValue(argv, "--environment") || "production";
|
|
2555
|
+
const method = readFlagValue(argv, "--method") || "well_known";
|
|
2556
|
+
const gate = await releaseCheck({ printResult: false, setExitCode: false });
|
|
2557
|
+
if (!gate.ok) throw new Error(`release gate blocked: ${gate.blockers.join(", ")}`);
|
|
2558
|
+
const enrollment = await createEnterpriseEnrollment({ siteUrl: url, projectRoot, publicRoot: projectRoot, environment, method });
|
|
2559
|
+
return print(enrollment);
|
|
2560
|
+
}
|
|
2561
|
+
if (cmd === "enterprise-domain-proof") {
|
|
2562
|
+
const projectRoot = path.resolve(readFlagValue(argv, "--project-root") || process.cwd());
|
|
2563
|
+
const publicRoot = path.resolve(readFlagValue(argv, "--public-root") || projectRoot);
|
|
2564
|
+
const statePath = path.join(projectRoot, ".agent-id", "enterprise-state.json");
|
|
2565
|
+
const state = JSON.parse(fs.readFileSync(statePath, "utf8"));
|
|
2566
|
+
const document = buildWellKnownProofDocument(state.domain_proof, { now: Math.floor(Date.now() / 1000) });
|
|
2567
|
+
const { target } = resolveProofTarget({ projectRoot, publicRoot });
|
|
2568
|
+
if (!argv.includes("--apply")) {
|
|
2569
|
+
return print({
|
|
2570
|
+
ok: true,
|
|
2571
|
+
dry_run: true,
|
|
2572
|
+
schema: "agentx-domain-proof-plan-v1",
|
|
2573
|
+
target,
|
|
2574
|
+
document,
|
|
2575
|
+
next_command: `agent-id enterprise-domain-proof --project-root ${projectRoot} --public-root ${publicRoot} --apply`,
|
|
2576
|
+
non_claims: ["does_not_verify_domain", "does_not_issue_credentials", "does_not_overwrite_customer_managed_files"]
|
|
2577
|
+
});
|
|
2578
|
+
}
|
|
2579
|
+
const receipt = await writeWellKnownProofDocument({ challenge: state.domain_proof, projectRoot, publicRoot, approved: true });
|
|
2580
|
+
return print({ ok: true, dry_run: false, receipt, next_command: `agent-id enterprise-domain-verify --project-root ${projectRoot}` });
|
|
2581
|
+
}
|
|
2582
|
+
if (cmd === "enterprise-domain-verify") {
|
|
2583
|
+
const projectRoot = path.resolve(readFlagValue(argv, "--project-root") || process.cwd());
|
|
2584
|
+
const statePath = path.join(projectRoot, ".agent-id", "enterprise-state.json");
|
|
2585
|
+
const state = JSON.parse(fs.readFileSync(statePath, "utf8"));
|
|
2586
|
+
if (!state.challenge_id) throw new Error("enterprise enrollment challenge is missing");
|
|
2587
|
+
const existing = await readEnterpriseBootstrapCredential(projectRoot);
|
|
2588
|
+
if (existing) {
|
|
2589
|
+
const credential = existing.credential;
|
|
2590
|
+
const recoveredIdentity = generateSiteAgentIdentity({ keyPath: existing.key_path });
|
|
2591
|
+
const canonicalThumbprint = state.domain_proof && state.domain_proof.public_key_thumbprint;
|
|
2592
|
+
const expected = {
|
|
2593
|
+
host: state.domain_proof && state.domain_proof.host,
|
|
2594
|
+
environment: state.environment,
|
|
2595
|
+
agent_id: state.agent_id,
|
|
2596
|
+
public_key_thumbprint: canonicalThumbprint
|
|
2597
|
+
};
|
|
2598
|
+
if (Object.entries(expected).some(([field, value]) => !value || credential[field] !== value)) {
|
|
2599
|
+
throw new Error("existing enterprise credential does not match enrollment state");
|
|
2600
|
+
}
|
|
2601
|
+
if (recoveredIdentity.public_key_thumbprint !== credential.public_key_thumbprint) {
|
|
2602
|
+
throw new Error("enterprise private key does not match the verified credential");
|
|
2603
|
+
}
|
|
2604
|
+
const validationSession = createEnterpriseSession({
|
|
2605
|
+
serviceOrigin: endpoint,
|
|
2606
|
+
siteUrl: state.site_url,
|
|
2607
|
+
environment: state.environment,
|
|
2608
|
+
credential,
|
|
2609
|
+
identity: recoveredIdentity
|
|
2610
|
+
});
|
|
2611
|
+
try {
|
|
2612
|
+
await validationSession.getAccessToken(["tasks:read"]);
|
|
2613
|
+
} finally {
|
|
2614
|
+
validationSession.clear();
|
|
2615
|
+
}
|
|
2616
|
+
await writeEnterpriseEnrollmentState(projectRoot, {
|
|
2617
|
+
...state,
|
|
2618
|
+
status: "verified_domain",
|
|
2619
|
+
credential_id: credential.credential_id,
|
|
2620
|
+
public_key_thumbprint: canonicalThumbprint
|
|
2621
|
+
});
|
|
2622
|
+
return print({
|
|
2623
|
+
ok: true,
|
|
2624
|
+
recovered_from_local_credential: true,
|
|
2625
|
+
mother_service_credential_validated: true,
|
|
2626
|
+
credential_id: credential.credential_id,
|
|
2627
|
+
credential_path: existing.credential_path,
|
|
2628
|
+
private_key_path: existing.key_path,
|
|
2629
|
+
secret_storage_required: "move both customer secret files into the customer secret manager before production runtime",
|
|
2630
|
+
next_command: `agent-id enterprise-policy-init --project-root ${projectRoot}`
|
|
2631
|
+
});
|
|
2632
|
+
}
|
|
2633
|
+
const response = await post("/api/site_agents/v1/challenges/verify", { challenge_id: state.challenge_id });
|
|
2634
|
+
if (!response || response.ok !== true) return print(response || { ok: false, error: "domain_verification_failed" });
|
|
2635
|
+
let secretReceipt;
|
|
2636
|
+
try {
|
|
2637
|
+
secretReceipt = await writeEnterpriseBootstrapCredential(
|
|
2638
|
+
projectRoot,
|
|
2639
|
+
response.credential,
|
|
2640
|
+
response.bootstrap_secret
|
|
2641
|
+
);
|
|
2642
|
+
} catch (_error) {
|
|
2643
|
+
throw new Error(`enterprise_credential_delivery_failed; request a new single-use challenge with: agent-id enterprise-enroll ${state.site_url} --environment ${state.environment} --method well_known --project-root ${projectRoot}`);
|
|
2644
|
+
}
|
|
2645
|
+
await writeEnterpriseEnrollmentState(projectRoot, {
|
|
2646
|
+
...state,
|
|
2647
|
+
status: "verified_domain",
|
|
2648
|
+
credential_id: response.credential && response.credential.credential_id || "",
|
|
2649
|
+
public_key_thumbprint: response.credential && response.credential.public_key_thumbprint || state.public_key_thumbprint
|
|
2650
|
+
});
|
|
2651
|
+
return print({
|
|
2652
|
+
ok: true,
|
|
2653
|
+
subject: response.subject,
|
|
2654
|
+
verification_receipt: response.verification_receipt,
|
|
2655
|
+
credential: response.credential,
|
|
2656
|
+
one_time_secret: true,
|
|
2657
|
+
secret_persisted_locally: secretReceipt.secret_persisted_locally,
|
|
2658
|
+
credential_path: secretReceipt.credential_path,
|
|
2659
|
+
private_key_path: path.join(projectRoot, ".agent-id", "secrets", "enterprise-ed25519.pem"),
|
|
2660
|
+
secret_storage_required: "move both customer secret files into the customer secret manager before production runtime",
|
|
2661
|
+
next_command: `agent-id enterprise-policy-init --project-root ${projectRoot}`
|
|
2662
|
+
});
|
|
2663
|
+
}
|
|
2664
|
+
if (cmd === "enterprise-credential-rotate") {
|
|
2665
|
+
if (!argv.includes("--approve")) throw new Error("enterprise credential rotation requires --approve");
|
|
2666
|
+
const projectRoot = path.resolve(readFlagValue(argv, "--project-root") || process.cwd());
|
|
2667
|
+
const statePath = path.join(projectRoot, ".agent-id", "enterprise-state.json");
|
|
2668
|
+
const state = JSON.parse(fs.readFileSync(statePath, "utf8"));
|
|
2669
|
+
const existing = await readEnterpriseBootstrapCredential(projectRoot);
|
|
2670
|
+
if (!existing) throw new Error("enterprise credential is not installed");
|
|
2671
|
+
const identity = generateSiteAgentIdentity({ keyPath: existing.key_path });
|
|
2672
|
+
const session = createEnterpriseSession({ serviceOrigin: endpoint, siteUrl: state.site_url, environment: state.environment, credential: existing.credential, identity });
|
|
2673
|
+
let response;
|
|
2674
|
+
try { response = await session.rotateCredential(); } finally { session.clear(); }
|
|
2675
|
+
const receipt = await replaceEnterpriseBootstrapCredential(projectRoot, response.credential, response.bootstrap_secret, existing.credential.credential_id);
|
|
2676
|
+
await writeEnterpriseEnrollmentState(projectRoot, { ...state, status: "verified_domain", credential_id: response.credential.credential_id });
|
|
2677
|
+
return print({ ok: true, schema: "agentx-enterprise-credential-rotation-v1", receipt, next_action: "update_the_customer_secret_manager_copy" });
|
|
2678
|
+
}
|
|
2679
|
+
if (cmd === "enterprise-credential-revoke") {
|
|
2680
|
+
if (!argv.includes("--approve")) throw new Error("enterprise credential revocation requires --approve");
|
|
2681
|
+
const reason = readFlagValue(argv, "--reason") || "";
|
|
2682
|
+
if (!reason) throw new Error("enterprise credential revocation requires --reason");
|
|
2683
|
+
const projectRoot = path.resolve(readFlagValue(argv, "--project-root") || process.cwd());
|
|
2684
|
+
const statePath = path.join(projectRoot, ".agent-id", "enterprise-state.json");
|
|
2685
|
+
const state = JSON.parse(fs.readFileSync(statePath, "utf8"));
|
|
2686
|
+
const existing = await readEnterpriseBootstrapCredential(projectRoot);
|
|
2687
|
+
if (!existing) throw new Error("enterprise credential is not installed");
|
|
2688
|
+
const identity = generateSiteAgentIdentity({ keyPath: existing.key_path });
|
|
2689
|
+
const session = createEnterpriseSession({ serviceOrigin: endpoint, siteUrl: state.site_url, environment: state.environment, credential: existing.credential, identity });
|
|
2690
|
+
let response;
|
|
2691
|
+
try { response = await session.revokeCredential(reason); } finally { session.clear(); }
|
|
2692
|
+
const receipt = await removeEnterpriseBootstrapCredential(projectRoot, existing.credential.credential_id);
|
|
2693
|
+
await writeEnterpriseEnrollmentState(projectRoot, { ...state, status: "revoked", credential_id: existing.credential.credential_id });
|
|
2694
|
+
return print({ ok: true, schema: "agentx-enterprise-credential-revocation-v1", credential: response.credential, receipt, next_action: "remove_the_customer_secret_manager_copy" });
|
|
2695
|
+
}
|
|
2696
|
+
if (cmd === "enterprise-policy-init") {
|
|
2697
|
+
const projectRoot = path.resolve(readFlagValue(argv, "--project-root") || process.cwd());
|
|
2698
|
+
const policyPath = path.join(projectRoot, ".agent-id", "enterprise-policy.json");
|
|
2699
|
+
if (fs.existsSync(policyPath)) throw new Error("enterprise policy already exists");
|
|
2700
|
+
const policy = initializeLocalPolicy(policyPath);
|
|
2701
|
+
return print({ ok: true, schema: "agentx-enterprise-policy-init-v1", policy, policy_path: policyPath, mutation_authority: "none_until_explicit_rule_approval" });
|
|
2702
|
+
}
|
|
2703
|
+
if (cmd === "enterprise-policy-approve") {
|
|
2704
|
+
if (!url || url.startsWith("--")) throw new Error("enterprise-policy-approve requires a rule JSON file");
|
|
2705
|
+
const projectRoot = path.resolve(readFlagValue(argv, "--project-root") || process.cwd());
|
|
2706
|
+
const approvedBy = readFlagValue(argv, "--approved-by") || "";
|
|
2707
|
+
const policy = loadLocalPolicy(path.join(projectRoot, ".agent-id", "enterprise-policy.json"));
|
|
2708
|
+
const rule = JSON.parse(fs.readFileSync(path.resolve(url), "utf8"));
|
|
2709
|
+
const updated = approvePolicyRule(policy, rule, { approved: argv.includes("--approve"), approvedBy });
|
|
2710
|
+
return print({ ok: true, schema: "agentx-enterprise-policy-approval-v1", policy: updated, approval: updated.approvals[updated.approvals.length - 1] });
|
|
2711
|
+
}
|
|
2712
|
+
if (cmd === "enterprise-status") {
|
|
2713
|
+
return print(await enterpriseInstallStatus(readFlagValue(argv, "--project-root") || process.cwd()));
|
|
2714
|
+
}
|
|
2715
|
+
if ([
|
|
2716
|
+
"enterprise-managed-enable",
|
|
2717
|
+
"enterprise-managed-status",
|
|
2718
|
+
"enterprise-managed-pause",
|
|
2719
|
+
"enterprise-managed-resume",
|
|
2720
|
+
"enterprise-managed-runs",
|
|
2721
|
+
].includes(cmd)) {
|
|
2722
|
+
const projectRoot = readFlagValue(argv, "--project-root") || process.cwd();
|
|
2723
|
+
const { session } = await enterpriseSessionForProject(projectRoot);
|
|
2724
|
+
try {
|
|
2725
|
+
if (cmd === "enterprise-managed-enable") return printManagedResult(await session.enableManagedInspection());
|
|
2726
|
+
if (cmd === "enterprise-managed-status") return printManagedResult(await session.getManagedInspection());
|
|
2727
|
+
if (cmd === "enterprise-managed-runs") return printManagedResult(await session.listManagedRuns(readFlagValue(argv, "--limit") || 20));
|
|
2728
|
+
const current = await session.getManagedInspection();
|
|
2729
|
+
const version = Number((current.subscription || {}).version || 0);
|
|
2730
|
+
if (!version) throw new Error("managed subscription version is missing");
|
|
2731
|
+
return printManagedResult(
|
|
2732
|
+
cmd === "enterprise-managed-pause"
|
|
2733
|
+
? await session.pauseManagedInspection(version)
|
|
2734
|
+
: await session.resumeManagedInspection(version)
|
|
2735
|
+
);
|
|
2736
|
+
} finally {
|
|
2737
|
+
session.clear();
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
if (cmd === "repository-patch-plan") {
|
|
2741
|
+
const root = url;
|
|
2742
|
+
const changesFile = argv[2];
|
|
2743
|
+
if (!root || !changesFile) throw new Error("repository-patch-plan requires <root> <changes-json-file>");
|
|
2744
|
+
const input = JSON.parse(fs.readFileSync(changesFile, "utf8"));
|
|
2745
|
+
return print(await buildRepositoryPatch({ repositoryRoot: root, changes: Array.isArray(input) ? input : input.changes }));
|
|
2746
|
+
}
|
|
2747
|
+
if (cmd === "repository-patch-apply") {
|
|
2748
|
+
if (!url) throw new Error("repository-patch-apply requires <plan-json-file>");
|
|
2749
|
+
return print(await applyRepositoryPatch(JSON.parse(fs.readFileSync(url, "utf8")), { approved: argv.includes("--approve") }));
|
|
2750
|
+
}
|
|
2751
|
+
if (cmd === "repository-patch-rollback") {
|
|
2752
|
+
if (!url) throw new Error("repository-patch-rollback requires <receipt-json-file>");
|
|
2753
|
+
return print(await rollbackRepositoryPatch(JSON.parse(fs.readFileSync(url, "utf8")), { approved: argv.includes("--approve") }));
|
|
2754
|
+
}
|
|
2755
|
+
if (cmd === "verify-domain") {
|
|
2756
|
+
const m = argv.indexOf("--method");
|
|
2757
|
+
const method = m >= 0 ? argv[m + 1] : "well_known";
|
|
2758
|
+
return print(await post("/api/site_agents/verify_domain", { url, method }));
|
|
2759
|
+
}
|
|
2760
|
+
if (cmd === "verify") {
|
|
2761
|
+
const key = argv[argv.indexOf("--key") + 1] || process.env.AEO_AGENT_KEY;
|
|
2762
|
+
return print(await post("/api/site_agents/verify", { url, agent_key: key }));
|
|
2763
|
+
}
|
|
2764
|
+
if (cmd === "mcp") return runMcp();
|
|
2765
|
+
throw new Error(`Unknown command: ${cmd}`);
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
function send(id, result) {
|
|
2769
|
+
process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id, result }) + "\n");
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
function sendError(id, message) {
|
|
2773
|
+
process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id, error: { code: -32000, message } }) + "\n");
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
function runMcp() {
|
|
2777
|
+
process.stdin.setEncoding("utf8");
|
|
2778
|
+
let buf = "";
|
|
2779
|
+
process.stdin.on("data", chunk => {
|
|
2780
|
+
buf += chunk;
|
|
2781
|
+
let i;
|
|
2782
|
+
while ((i = buf.indexOf("\n")) >= 0) {
|
|
2783
|
+
const line = buf.slice(0, i).trim();
|
|
2784
|
+
buf = buf.slice(i + 1);
|
|
2785
|
+
if (!line) continue;
|
|
2786
|
+
handleMcpLine(line).catch(err => sendError(null, err.message));
|
|
2787
|
+
}
|
|
2788
|
+
});
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
async function handleMcpLine(line) {
|
|
2792
|
+
const msg = JSON.parse(line);
|
|
2793
|
+
if (msg.method === "initialize") return send(msg.id, { protocolVersion: "2024-11-05", serverInfo: { name: "agent-id", version: "0.1.0" } });
|
|
2794
|
+
if (msg.method === "tools/list") {
|
|
2795
|
+
const tools = [
|
|
2796
|
+
{ name: "audit_url", description: "Audit a website for SEO/AEO/GEO/Agent readiness.", inputSchema: { type: "object", properties: { url: { type: "string" } }, required: ["url"] } },
|
|
2797
|
+
{ 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" } } } },
|
|
2798
|
+
{ 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" } } } },
|
|
2799
|
+
{ name: "google_cloud_alignment", description: "Return Google Cloud Enterprise Agent Platform alignment.", inputSchema: { type: "object", properties: {} } },
|
|
2800
|
+
{ name: "trust_commerce_stack", description: "Return the AgentX.ID Passport, SBT, ERC-8004, x402, ERC-8183, and AP2 architecture plan.", inputSchema: { type: "object", properties: {} } },
|
|
2801
|
+
{ 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" } } } },
|
|
2802
|
+
{ 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" } } } },
|
|
2803
|
+
{ 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" } } } },
|
|
2804
|
+
{ 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" } } } },
|
|
2805
|
+
{ 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"] } },
|
|
2806
|
+
{ 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" } } } },
|
|
2807
|
+
{ 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" } } } },
|
|
2808
|
+
{ 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" } } } },
|
|
2809
|
+
{ 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" } } } },
|
|
2810
|
+
{ 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" } } } },
|
|
2811
|
+
{ 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" } } } },
|
|
2812
|
+
{ 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" } } } },
|
|
2813
|
+
{ 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" } } } },
|
|
2814
|
+
{ 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" } } } },
|
|
2815
|
+
{ 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" } } } },
|
|
2816
|
+
{ 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" } } } },
|
|
2817
|
+
{ 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" } } } },
|
|
2818
|
+
{ 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" } } } },
|
|
2819
|
+
{ 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" } } } },
|
|
2820
|
+
{ 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" } } } },
|
|
2821
|
+
{ 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" } } } },
|
|
2822
|
+
{ 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" } } } },
|
|
2823
|
+
{ 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" } } } },
|
|
2824
|
+
{ 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" } } } },
|
|
2825
|
+
{ 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" } } } },
|
|
2826
|
+
{ 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" } } } },
|
|
2827
|
+
{ 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" } } } },
|
|
2828
|
+
{ 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" } } } },
|
|
2829
|
+
{ 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" } } } },
|
|
2830
|
+
{ 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" } } } },
|
|
2831
|
+
{ 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" } } } },
|
|
2832
|
+
{ 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" } } } },
|
|
2833
|
+
{ 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" } } } },
|
|
2834
|
+
{ 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" } } } },
|
|
2835
|
+
{ 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" } } } },
|
|
2836
|
+
{ 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"] } },
|
|
2837
|
+
{ 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"] } },
|
|
2838
|
+
{ 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"] } },
|
|
2839
|
+
{ 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"] } },
|
|
2840
|
+
{ 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"] } },
|
|
2841
|
+
{ 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"] } },
|
|
2842
|
+
{ name: "get_pricing", description: "Return machine-readable plans and checkout endpoint.", inputSchema: { type: "object", properties: {} } },
|
|
2843
|
+
{ name: "agent_billing_guide", description: "Return free routes, paid routes, checkout intents, and x402-style job payment boundaries.", inputSchema: { type: "object", properties: {} } },
|
|
2844
|
+
{ 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" } } } },
|
|
2845
|
+
{ 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" } } } },
|
|
2846
|
+
{ 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" } } } },
|
|
2847
|
+
{ 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" } } } },
|
|
2848
|
+
{ 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" } } } },
|
|
2849
|
+
{ 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" } } } },
|
|
2850
|
+
{ name: "google_marketplace_pricing_pack", description: "Return Google Cloud Marketplace AI Agent pricing review material.", inputSchema: { type: "object", properties: {} } },
|
|
2851
|
+
{ 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" } } } },
|
|
2852
|
+
{ 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" } } } },
|
|
2853
|
+
{ 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" } } } },
|
|
2854
|
+
{ 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" } } } },
|
|
2855
|
+
{ 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" } } } },
|
|
2856
|
+
{ 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" } } } },
|
|
2857
|
+
{ 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" } } } },
|
|
2858
|
+
{ 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" } } } },
|
|
2859
|
+
{ 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" } } } },
|
|
2860
|
+
{ 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" } } } },
|
|
2861
|
+
{ 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" } } } },
|
|
2862
|
+
{ 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" } } } },
|
|
2863
|
+
{ 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" } } } },
|
|
2864
|
+
{ 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" } } } },
|
|
2865
|
+
{ 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" } } } },
|
|
2866
|
+
{ 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" } } } },
|
|
2867
|
+
{ 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" } } } },
|
|
2868
|
+
{ 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" } } } },
|
|
2869
|
+
{ 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" } } } },
|
|
2870
|
+
{ 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" } } } },
|
|
2871
|
+
{ 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" } } } },
|
|
2872
|
+
{ 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" } } } },
|
|
2873
|
+
{ 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" } } } },
|
|
2874
|
+
{ 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" } } } },
|
|
2875
|
+
{ 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" } } } },
|
|
2876
|
+
{ 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" } } } },
|
|
2877
|
+
{ 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" } } } },
|
|
2878
|
+
{ 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" } } } },
|
|
2879
|
+
{ name: "google_marketplace_evidence_template", description: "Generate a fillable Google Marketplace application evidence template for operators.", inputSchema: { type: "object", properties: {} } },
|
|
2880
|
+
{ name: "google_marketplace_evidence_example", description: "Generate an example-only Google Marketplace evidence starter file for operators.", inputSchema: { type: "object", properties: {} } },
|
|
2881
|
+
{ 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" } } } },
|
|
2882
|
+
{ 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"] } },
|
|
2883
|
+
{ name: "google_marketplace_procurement_state", description: "Read local Google Marketplace procurement state and pending actions.", inputSchema: { type: "object", properties: {} } },
|
|
2884
|
+
{ 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" } } } },
|
|
2885
|
+
{ 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"] } },
|
|
2886
|
+
{ name: "google_marketplace_frontend_integration", description: "Return Google Marketplace sign-up/login URLs and JWT verification requirements.", inputSchema: { type: "object", properties: {} } },
|
|
2887
|
+
{ 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" } } } },
|
|
2888
|
+
{ 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" } } } },
|
|
2889
|
+
{ name: "agent_checkout", description: "Create a checkout session for a paid AEO Agent plan.", inputSchema: { type: "object", properties: { plan: { type: "string" } }, required: ["plan"] } },
|
|
2890
|
+
{ name: "self_audit", description: "Audit this service's own Agent-first surfaces.", inputSchema: { type: "object", properties: {} } },
|
|
2891
|
+
{ name: "get_health", description: "Return this service's Agent-first health state.", inputSchema: { type: "object", properties: {} } },
|
|
2892
|
+
{ name: "self_backlog", description: "Generate this service's self-optimization backlog.", inputSchema: { type: "object", properties: {} } },
|
|
2893
|
+
{ name: "agentx_passport", description: "Return this service's AgentX.ID Passport.", inputSchema: { type: "object", properties: {} } },
|
|
2894
|
+
{ name: "proof_graph", description: "Return the proof graph behind the AgentX.ID Passport.", inputSchema: { type: "object", properties: {} } },
|
|
2895
|
+
{ 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" } } } },
|
|
2896
|
+
{ 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" } } } },
|
|
2897
|
+
{ 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" } } } },
|
|
2898
|
+
{ name: "site_agent_install_guide", description: "Return the public no-side-effect Site Agent installation guide.", inputSchema: { type: "object", properties: { url: { type: "string" } } } },
|
|
2899
|
+
{ 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"] } },
|
|
2900
|
+
{ 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"] } },
|
|
2901
|
+
{ 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"] } },
|
|
2902
|
+
{ name: "site_agent_actions", description: "Read the machine-readable Site Agent action catalog.", inputSchema: { type: "object", properties: {} } },
|
|
2903
|
+
{ 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"] } },
|
|
2904
|
+
{ 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"] } },
|
|
2905
|
+
{ 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"] } },
|
|
2906
|
+
{ 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"] } },
|
|
2907
|
+
{ 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"] } },
|
|
2908
|
+
{ 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"] } },
|
|
2909
|
+
{ 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"] } },
|
|
2910
|
+
{ 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"] } },
|
|
2911
|
+
{ 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"] } },
|
|
2912
|
+
{ 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"] } },
|
|
2913
|
+
{ 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"] } },
|
|
2914
|
+
{ 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"] } },
|
|
2915
|
+
{ 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"] } },
|
|
2916
|
+
{ 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"] } },
|
|
2917
|
+
{ 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"] } },
|
|
2918
|
+
{ 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"] } },
|
|
2919
|
+
{ 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"] } },
|
|
2920
|
+
{ 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"] } },
|
|
2921
|
+
{ 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"] } },
|
|
2922
|
+
{ 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"] } },
|
|
2923
|
+
{ 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"] } },
|
|
2924
|
+
{ 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"] } },
|
|
2925
|
+
{ 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"] } },
|
|
2926
|
+
{ 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"] } },
|
|
2927
|
+
{ 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"] } },
|
|
2928
|
+
{ 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"] } },
|
|
2929
|
+
{ 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"] } },
|
|
2930
|
+
{ 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"] } },
|
|
2931
|
+
{ 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"] } },
|
|
2932
|
+
{ 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"] } },
|
|
2933
|
+
{ 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"] } },
|
|
2934
|
+
{ 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"] } },
|
|
2935
|
+
{ 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"] } },
|
|
2936
|
+
{ 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"] } },
|
|
2937
|
+
{ 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"] } },
|
|
2938
|
+
{ 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"] } },
|
|
2939
|
+
{ 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"] } },
|
|
2940
|
+
{ 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"] } },
|
|
2941
|
+
{ 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"] } }
|
|
2942
|
+
];
|
|
2943
|
+
return send(msg.id, { tools: withSiteAgentFixedActionSchemas(tools) });
|
|
2944
|
+
}
|
|
2945
|
+
if (msg.method === "tools/call") {
|
|
2946
|
+
const name = msg.params?.name;
|
|
2947
|
+
const args = msg.params?.arguments || {};
|
|
2948
|
+
if (name === "audit_url") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/audit", args), null, 2) }] });
|
|
2949
|
+
if (name === "w1_workflow_router") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/workflow_router", args), null, 2) }] });
|
|
2950
|
+
if (name === "s2_package_review") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/package_review", args), null, 2) }] });
|
|
2951
|
+
if (name === "google_cloud_alignment") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/google_alignment"), null, 2) }] });
|
|
2952
|
+
if (name === "trust_commerce_stack") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/trust_stack"), null, 2) }] });
|
|
2953
|
+
if (name === "a1_ai_reads") {
|
|
2954
|
+
const hasEvents = Array.isArray(args.events) || Array.isArray(args.logs) || args.user_agent;
|
|
2955
|
+
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");
|
|
2956
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2957
|
+
}
|
|
2958
|
+
if (name === "a1_ai_read_dashboard") {
|
|
2959
|
+
const hasEvents = Array.isArray(args.events) || Array.isArray(args.logs) || args.user_agent;
|
|
2960
|
+
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");
|
|
2961
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2962
|
+
}
|
|
2963
|
+
if (name === "a1_ai_read_evidence_package") {
|
|
2964
|
+
const hasEvents = Array.isArray(args.events) || Array.isArray(args.logs) || args.user_agent;
|
|
2965
|
+
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");
|
|
2966
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2967
|
+
}
|
|
2968
|
+
if (name === "a2_ai_citations") {
|
|
2969
|
+
const hasProbes = Array.isArray(args.probes) || args.prompt || args.answer || Array.isArray(args.citations);
|
|
2970
|
+
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");
|
|
2971
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2972
|
+
}
|
|
2973
|
+
if (name === "a2_ai_citation_evidence_package") {
|
|
2974
|
+
const hasProbes = Array.isArray(args.probes) || Array.isArray(args.events) || args.prompt || args.answer;
|
|
2975
|
+
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");
|
|
2976
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2977
|
+
}
|
|
2978
|
+
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) }] });
|
|
2979
|
+
if (name === "b1_conversions") {
|
|
2980
|
+
const hasEvents = Array.isArray(args.events) || Array.isArray(args.conversions) || args.event || args.referrer || args.survey_source || args.value;
|
|
2981
|
+
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");
|
|
2982
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2983
|
+
}
|
|
2984
|
+
if (name === "b1_conversion_evidence_package") {
|
|
2985
|
+
const hasEvents = Array.isArray(args.events) || Array.isArray(args.conversions);
|
|
2986
|
+
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");
|
|
2987
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2988
|
+
}
|
|
2989
|
+
if (name === "g1_google_official") {
|
|
2990
|
+
const hasReports = Array.isArray(args.reports) || Array.isArray(args.results) || args.report || args.result || args.lighthouseResult;
|
|
2991
|
+
const fetchFlag = args.fetch ? "&fetch=1" : "";
|
|
2992
|
+
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");
|
|
2993
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2994
|
+
}
|
|
2995
|
+
if (name === "g2_google_delta") {
|
|
2996
|
+
const hasReports = Array.isArray(args.reports) || Array.isArray(args.results) || args.before || args.after || args.report || args.result;
|
|
2997
|
+
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");
|
|
2998
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
2999
|
+
}
|
|
3000
|
+
if (name === "g3_google_verification_plan") {
|
|
3001
|
+
const auditFlag = args.audit ? "&audit=1" : "";
|
|
3002
|
+
const out = await get(args.url ? `/api/agent/g3_google_verification_plan?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/g3_google_verification_plan");
|
|
3003
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3004
|
+
}
|
|
3005
|
+
if (name === "a0_audit_file_package") {
|
|
3006
|
+
const hasBody = args.content || args.page || args.questions || args.competitors || args.topics || args.engines;
|
|
3007
|
+
const auditFlag = args.audit ? "&audit=1" : "";
|
|
3008
|
+
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");
|
|
3009
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3010
|
+
}
|
|
3011
|
+
if (name === "s1_skill_package") {
|
|
3012
|
+
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");
|
|
3013
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3014
|
+
}
|
|
3015
|
+
if (name === "s1_skill_package_validation") {
|
|
3016
|
+
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");
|
|
3017
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3018
|
+
}
|
|
3019
|
+
if (name === "marketplace_submission_pack") {
|
|
3020
|
+
const hasBody = args.public_metadata || args.setup_metadata || args.public || args.setup;
|
|
3021
|
+
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");
|
|
3022
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3023
|
+
}
|
|
3024
|
+
if (name === "marketplace_readiness_score") {
|
|
3025
|
+
const hasBody = args.submission || args.pack || args.public_metadata || args.setup_metadata || args.public || args.setup;
|
|
3026
|
+
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");
|
|
3027
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3028
|
+
}
|
|
3029
|
+
if (name === "marketplace_approval_receipts") {
|
|
3030
|
+
const hasBody = args.platform_id || args.platform || args.listing_url || args.platform_receipt_id || args.proof_url || args.evidence_url;
|
|
3031
|
+
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");
|
|
3032
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3033
|
+
}
|
|
3034
|
+
if (name === "google_marketplace_agent_card") {
|
|
3035
|
+
const hasBody = args.product_metadata || args.product || args.public_metadata;
|
|
3036
|
+
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");
|
|
3037
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3038
|
+
}
|
|
3039
|
+
if (name === "google_marketplace_submission_pack") {
|
|
3040
|
+
const hasBody = args.product_metadata || args.setup_metadata || args.product || args.setup || args.public_metadata;
|
|
3041
|
+
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");
|
|
3042
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3043
|
+
}
|
|
3044
|
+
if (name === "google_marketplace_readiness_score") {
|
|
3045
|
+
const hasBody = args.submission || args.pack || args.product_metadata || args.setup_metadata || args.product || args.setup || args.public_metadata;
|
|
3046
|
+
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");
|
|
3047
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3048
|
+
}
|
|
3049
|
+
if (name === "google_marketplace_pricing_pack") {
|
|
3050
|
+
const out = await get("/api/agent/google_marketplace_pricing");
|
|
3051
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3052
|
+
}
|
|
3053
|
+
if (name === "google_marketplace_develop_flow_gate") {
|
|
3054
|
+
const hasBody = args.setup_metadata || args.product_metadata || args.pricing_metadata || args.setup || args.product || args.pricing;
|
|
3055
|
+
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");
|
|
3056
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3057
|
+
}
|
|
3058
|
+
if (name === "google_marketplace_listing_requirements_gate") {
|
|
3059
|
+
const hasBody = args.product_metadata || args.setup_metadata || args.product || args.setup || args.public_metadata;
|
|
3060
|
+
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");
|
|
3061
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3062
|
+
}
|
|
3063
|
+
if (name === "google_marketplace_listing_pack") {
|
|
3064
|
+
const hasBody = args.product_metadata || args.product || args.public_metadata;
|
|
3065
|
+
const out = hasBody ? await post("/api/agent/google_marketplace_listing", args) : await get("/api/agent/google_marketplace_listing");
|
|
3066
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3067
|
+
}
|
|
3068
|
+
if (name === "google_marketplace_discovery_metadata_gate") {
|
|
3069
|
+
const hasBody = args.product_metadata || args.product || args.public_metadata;
|
|
3070
|
+
const out = hasBody ? await post("/api/agent/google_marketplace_discovery_metadata", args) : await get("/api/agent/google_marketplace_discovery_metadata");
|
|
3071
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3072
|
+
}
|
|
3073
|
+
if (name === "google_marketplace_technical_integration_pack") {
|
|
3074
|
+
const hasBody = args.setup_metadata || args.setup || args.pricing_metadata || args.pricing;
|
|
3075
|
+
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");
|
|
3076
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3077
|
+
}
|
|
3078
|
+
if (name === "google_marketplace_backend_gate") {
|
|
3079
|
+
const hasBody = args.setup_metadata || args.setup || args.pricing_metadata || args.pricing;
|
|
3080
|
+
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");
|
|
3081
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3082
|
+
}
|
|
3083
|
+
if (name === "google_marketplace_lifecycle_smoke") {
|
|
3084
|
+
const params = new URLSearchParams();
|
|
3085
|
+
if (args.url) params.set("url", args.url);
|
|
3086
|
+
if (args.provider_id) params.set("provider_id", args.provider_id);
|
|
3087
|
+
if (args.account_id) params.set("account_id", args.account_id);
|
|
3088
|
+
if (args.entitlement_id) params.set("entitlement_id", args.entitlement_id);
|
|
3089
|
+
const out = await get(params.toString() ? `/api/agent/google_marketplace_lifecycle_smoke?${params.toString()}` : "/api/agent/google_marketplace_lifecycle_smoke");
|
|
3090
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3091
|
+
}
|
|
3092
|
+
if (name === "google_marketplace_runtime_smoke") {
|
|
3093
|
+
const params = new URLSearchParams();
|
|
3094
|
+
if (args.url) params.set("url", args.url);
|
|
3095
|
+
if (args.provider_id) params.set("provider_id", args.provider_id);
|
|
3096
|
+
if (args.account_id) params.set("account_id", args.account_id);
|
|
3097
|
+
if (args.entitlement_id) params.set("entitlement_id", args.entitlement_id);
|
|
3098
|
+
if (args.pricing_model) params.set("pricing_model", args.pricing_model);
|
|
3099
|
+
const out = await get(params.toString() ? `/api/agent/google_marketplace_runtime_smoke?${params.toString()}` : "/api/agent/google_marketplace_runtime_smoke");
|
|
3100
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3101
|
+
}
|
|
3102
|
+
if (name === "google_marketplace_runtime_receipt") {
|
|
3103
|
+
const out = await post("/api/agent/google_marketplace_runtime_receipt", args);
|
|
3104
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3105
|
+
}
|
|
3106
|
+
if (name === "google_marketplace_runtime_evidence_ledger") {
|
|
3107
|
+
const hasBody = args.receipt || args.receipts || args.pricing_metadata || args.pricing || args.evidence_kind || args.receipt_type || args.schema;
|
|
3108
|
+
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");
|
|
3109
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3110
|
+
}
|
|
3111
|
+
if (name === "google_marketplace_runtime_evidence_gate") {
|
|
3112
|
+
const hasBody = args.setup_metadata || args.setup || args.pricing_metadata || args.pricing;
|
|
3113
|
+
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");
|
|
3114
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3115
|
+
}
|
|
3116
|
+
if (name === "google_marketplace_test_billing_gate") {
|
|
3117
|
+
const hasBody = args.setup_metadata || args.setup || args.pricing_metadata || args.pricing;
|
|
3118
|
+
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");
|
|
3119
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3120
|
+
}
|
|
3121
|
+
if (name === "google_marketplace_agent_card_validation_gate") {
|
|
3122
|
+
const hasBody = args.setup_metadata || args.setup || args.product_metadata || args.product || args.public_metadata;
|
|
3123
|
+
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");
|
|
3124
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3125
|
+
}
|
|
3126
|
+
if (name === "google_marketplace_agent_card_gcs_upload_pack") {
|
|
3127
|
+
const hasBody = args.setup_metadata || args.setup || args.product_metadata || args.product || args.public_metadata;
|
|
3128
|
+
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");
|
|
3129
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3130
|
+
}
|
|
3131
|
+
if (name === "google_marketplace_product_details_review_gate") {
|
|
3132
|
+
const hasBody = args.setup_metadata || args.setup || args.product_metadata || args.product || args.public_metadata;
|
|
3133
|
+
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");
|
|
3134
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3135
|
+
}
|
|
3136
|
+
if (name === "google_marketplace_review_bundle") {
|
|
3137
|
+
const hasBody = args.product_metadata || args.setup_metadata || args.pricing_metadata || args.product || args.setup || args.pricing || args.public_metadata;
|
|
3138
|
+
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");
|
|
3139
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3140
|
+
}
|
|
3141
|
+
if (name === "google_marketplace_review_index") {
|
|
3142
|
+
const hasBody = args.product_metadata || args.setup_metadata || args.pricing_metadata || args.product || args.setup || args.pricing || args.public_metadata;
|
|
3143
|
+
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");
|
|
3144
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3145
|
+
}
|
|
3146
|
+
if (name === "google_marketplace_core_technology_source_map") {
|
|
3147
|
+
const out = await get(args.url ? `/api/agent/google_marketplace_core_source_map?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_core_source_map");
|
|
3148
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3149
|
+
}
|
|
3150
|
+
if (name === "google_marketplace_application_status") {
|
|
3151
|
+
const hasBody = args.setup_metadata || args.product_metadata || args.pricing_metadata || args.setup || args.product || args.pricing || args.public_metadata;
|
|
3152
|
+
const out = hasBody ? await post("/api/agent/google_marketplace_application_status", args) : await get("/api/agent/google_marketplace_application_status");
|
|
3153
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3154
|
+
}
|
|
3155
|
+
if (name === "google_marketplace_application_evidence") {
|
|
3156
|
+
const hasBody = args.setup_metadata || args.product_metadata || args.pricing_metadata || args.setup || args.product || args.pricing || args.public_metadata;
|
|
3157
|
+
const out = hasBody ? await post("/api/agent/google_marketplace_application_evidence", args) : await get("/api/agent/google_marketplace_application_evidence");
|
|
3158
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3159
|
+
}
|
|
3160
|
+
if (name === "google_marketplace_partner_application_gate") {
|
|
3161
|
+
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;
|
|
3162
|
+
const out = hasBody ? await post("/api/agent/google_marketplace_partner_application_gate", args) : await get("/api/agent/google_marketplace_partner_application_gate");
|
|
3163
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3164
|
+
}
|
|
3165
|
+
if (name === "google_marketplace_operations_gate") {
|
|
3166
|
+
const hasBody = args.setup_metadata || args.setup;
|
|
3167
|
+
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");
|
|
3168
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3169
|
+
}
|
|
3170
|
+
if (name === "google_marketplace_ops_identity_gate") {
|
|
3171
|
+
const hasBody = args.setup_metadata || args.pricing_metadata || args.setup || args.pricing || args.producer_portal_iam || args.partner_procurement_api;
|
|
3172
|
+
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");
|
|
3173
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3174
|
+
}
|
|
3175
|
+
if (name === "google_marketplace_cloud_run_deployment_gate") {
|
|
3176
|
+
const hasBody = args.setup_metadata || args.pricing_metadata || args.setup || args.pricing || args.cloud_run || args.cloud_run_deployment;
|
|
3177
|
+
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");
|
|
3178
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3179
|
+
}
|
|
3180
|
+
if (name === "google_marketplace_live_surface_gate") {
|
|
3181
|
+
const out = await get(args.url ? `/api/agent/google_marketplace_live_surface_gate?url=${encodeURIComponent(args.url)}` : "/api/agent/google_marketplace_live_surface_gate");
|
|
3182
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3183
|
+
}
|
|
3184
|
+
if (name === "google_marketplace_preflight_check") {
|
|
3185
|
+
const hasBody = args.setup_metadata || args.product_metadata || args.pricing_metadata || args.setup || args.product || args.pricing || args.public_metadata;
|
|
3186
|
+
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");
|
|
3187
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3188
|
+
}
|
|
3189
|
+
if (name === "google_marketplace_publish_gate") {
|
|
3190
|
+
const hasBody = args.setup_metadata || args.setup;
|
|
3191
|
+
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");
|
|
3192
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3193
|
+
}
|
|
3194
|
+
if (name === "google_marketplace_review_receipt_gate") {
|
|
3195
|
+
const hasBody = args.setup_metadata || args.setup;
|
|
3196
|
+
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");
|
|
3197
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3198
|
+
}
|
|
3199
|
+
if (name === "google_marketplace_evidence_template") {
|
|
3200
|
+
const out = await get("/api/agent/google_marketplace_evidence_template");
|
|
3201
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3202
|
+
}
|
|
3203
|
+
if (name === "google_marketplace_evidence_example") {
|
|
3204
|
+
const out = await get("/api/agent/google_marketplace_evidence_example");
|
|
3205
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3206
|
+
}
|
|
3207
|
+
if (name === "google_marketplace_procurement_event") {
|
|
3208
|
+
const payload = args.procurement_event || args.event || args.payload || args;
|
|
3209
|
+
const out = await post("/api/agent/google_marketplace_procurement_event", payload);
|
|
3210
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3211
|
+
}
|
|
3212
|
+
if (name === "google_marketplace_procurement_execute") {
|
|
3213
|
+
const out = await post("/api/agent/google_marketplace_procurement_execute", args);
|
|
3214
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3215
|
+
}
|
|
3216
|
+
if (name === "google_marketplace_procurement_state") {
|
|
3217
|
+
const out = await get("/api/agent/google_marketplace_procurement_state");
|
|
3218
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3219
|
+
}
|
|
3220
|
+
if (name === "google_marketplace_usage_report_payload") {
|
|
3221
|
+
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;
|
|
3222
|
+
const out = hasBody ? await post("/api/agent/google_marketplace_usage_report_payload", args) : await get("/api/agent/google_marketplace_usage_report_payload");
|
|
3223
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3224
|
+
}
|
|
3225
|
+
if (name === "google_marketplace_usage_report_execute") {
|
|
3226
|
+
const out = await post("/api/agent/google_marketplace_usage_report_execute", args);
|
|
3227
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3228
|
+
}
|
|
3229
|
+
if (name === "google_marketplace_frontend_integration") {
|
|
3230
|
+
const out = await get("/api/agent/google_marketplace_frontend_integration");
|
|
3231
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3232
|
+
}
|
|
3233
|
+
if (name === "google_marketplace_account_link") {
|
|
3234
|
+
const out = await post("/api/agent/google_marketplace_account_link", args);
|
|
3235
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3236
|
+
}
|
|
3237
|
+
if (name === "google_marketplace_jwt_verifier_gate") {
|
|
3238
|
+
const hasBody = args.setup_metadata || args.setup || args.jwt || args.token || args.token_context || args["x-gcp-marketplace-token"];
|
|
3239
|
+
const out = hasBody ? await post("/api/agent/google_marketplace_jwt_verifier_gate", args) : await get("/api/agent/google_marketplace_jwt_verifier_gate");
|
|
3240
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3241
|
+
}
|
|
3242
|
+
if (name === "f1_implementation_bundle") {
|
|
3243
|
+
const auditFlag = args.audit ? "&audit=1" : "";
|
|
3244
|
+
const out = await get(args.url ? `/api/agent/implementation_bundle?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/implementation_bundle");
|
|
3245
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3246
|
+
}
|
|
3247
|
+
if (name === "e1_evidence_pack") {
|
|
3248
|
+
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");
|
|
3249
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3250
|
+
}
|
|
3251
|
+
if (name === "v1_installation_verification") {
|
|
3252
|
+
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");
|
|
3253
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3254
|
+
}
|
|
3255
|
+
if (name === "c1_content_optimization_plan") {
|
|
3256
|
+
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");
|
|
3257
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3258
|
+
}
|
|
3259
|
+
if (name === "c4_content_workflow_package") {
|
|
3260
|
+
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");
|
|
3261
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3262
|
+
}
|
|
3263
|
+
if (name === "content_optimization_pack") {
|
|
3264
|
+
const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.audit || args.published_items || args.items || args.evidence;
|
|
3265
|
+
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");
|
|
3266
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3267
|
+
}
|
|
3268
|
+
if (name === "c5_content_workflow_review") {
|
|
3269
|
+
const hasPackage = args.content_pack || args.pack || args.content_workflow_package || args.package;
|
|
3270
|
+
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");
|
|
3271
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3272
|
+
}
|
|
3273
|
+
if (name === "m8_content_publication_evidence_package") {
|
|
3274
|
+
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");
|
|
3275
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3276
|
+
}
|
|
3277
|
+
if (name === "c1_citation_gap_matrix") {
|
|
3278
|
+
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");
|
|
3279
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3280
|
+
}
|
|
3281
|
+
if (name === "c1_community_citation_plan") {
|
|
3282
|
+
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");
|
|
3283
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3284
|
+
}
|
|
3285
|
+
if (name === "c2_prompt_test_run_sheet") {
|
|
3286
|
+
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");
|
|
3287
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3288
|
+
}
|
|
3289
|
+
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) }] });
|
|
3290
|
+
if (name === "r1_audit_report") {
|
|
3291
|
+
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");
|
|
3292
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3293
|
+
}
|
|
3294
|
+
if (name === "o1_optimization_cycle") {
|
|
3295
|
+
const auditFlag = args.audit ? "&audit=1" : "";
|
|
3296
|
+
const out = await get(args.url ? `/api/agent/optimization_cycle?url=${encodeURIComponent(args.url)}${auditFlag}` : "/api/agent/optimization_cycle");
|
|
3297
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3298
|
+
}
|
|
3299
|
+
if (name === "m2_monthly_optimization_package") {
|
|
3300
|
+
const auditFlag = args.audit ? "&audit=1" : "";
|
|
3301
|
+
const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.content_publication_package || args.a2_citation_package;
|
|
3302
|
+
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");
|
|
3303
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3304
|
+
}
|
|
3305
|
+
if (name === "m3_monthly_execution_tracker") {
|
|
3306
|
+
const auditFlag = args.audit ? "&audit=1" : "";
|
|
3307
|
+
const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.content_publication_package || args.a2_citation_package;
|
|
3308
|
+
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");
|
|
3309
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3310
|
+
}
|
|
3311
|
+
if (name === "m4_monthly_outcome_scorecard") {
|
|
3312
|
+
const auditFlag = args.audit ? "&audit=1" : "";
|
|
3313
|
+
const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.content_publication_package || args.a2_citation_package;
|
|
3314
|
+
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");
|
|
3315
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3316
|
+
}
|
|
3317
|
+
if (name === "m5_monthly_dashboard") {
|
|
3318
|
+
const auditFlag = args.audit ? "&audit=1" : "";
|
|
3319
|
+
const hasBody = args.content || args.page || args.questions || args.competitors || args.engines || args.topics || args.content_publication_package || args.a2_citation_package;
|
|
3320
|
+
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");
|
|
3321
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3322
|
+
}
|
|
3323
|
+
if (name === "i1_insights") {
|
|
3324
|
+
const out = args.audit ? await post("/api/agent/insights", args) : await get(args.url ? `/api/agent/insights?url=${encodeURIComponent(args.url)}` : "/api/agent/insights");
|
|
3325
|
+
return send(msg.id, { content: [{ type: "text", text: JSON.stringify(out, null, 2) }] });
|
|
3326
|
+
}
|
|
3327
|
+
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) }] });
|
|
3328
|
+
if (name === "aeo_job_drafts") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/job_drafts", args), null, 2) }] });
|
|
3329
|
+
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) }] });
|
|
3330
|
+
if (name === "aeo_job_create") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/create", args), null, 2) }] });
|
|
3331
|
+
if (name === "aeo_job_fund") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/fund", args), null, 2) }] });
|
|
3332
|
+
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) }] });
|
|
3333
|
+
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) }] });
|
|
3334
|
+
if (name === "aeo_job_submit") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/submit", args), null, 2) }] });
|
|
3335
|
+
if (name === "aeo_job_evaluate") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/jobs/evaluate", args), null, 2) }] });
|
|
3336
|
+
if (name === "get_pricing") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/pricing"), null, 2) }] });
|
|
3337
|
+
if (name === "agent_billing_guide") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/billing_guide"), null, 2) }] });
|
|
3338
|
+
if (name === "agent_checkout") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/agent/checkout", args), null, 2) }] });
|
|
3339
|
+
if (name === "self_audit") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/self_audit"), null, 2) }] });
|
|
3340
|
+
if (name === "get_health") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/agent/health.json"), null, 2) }] });
|
|
3341
|
+
if (name === "self_backlog") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/self_backlog"), null, 2) }] });
|
|
3342
|
+
if (name === "agentx_passport") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/passport"), null, 2) }] });
|
|
3343
|
+
if (name === "proof_graph") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/agent/proof_graph"), null, 2) }] });
|
|
3344
|
+
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) }] });
|
|
3345
|
+
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) }] });
|
|
3346
|
+
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) }] });
|
|
3347
|
+
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) }] });
|
|
3348
|
+
if (name === "register_site_agent") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/register", args), null, 2) }] });
|
|
3349
|
+
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) }] });
|
|
3350
|
+
if (name === "site_agent_actions") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get("/api/site_agents/actions"), null, 2) }] });
|
|
3351
|
+
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) }] });
|
|
3352
|
+
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) }] });
|
|
3353
|
+
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) }] });
|
|
3354
|
+
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) }] });
|
|
3355
|
+
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) }] });
|
|
3356
|
+
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) }] });
|
|
3357
|
+
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) }] });
|
|
3358
|
+
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) }] });
|
|
3359
|
+
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) }] });
|
|
3360
|
+
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) }] });
|
|
3361
|
+
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) }] });
|
|
3362
|
+
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) }] });
|
|
3363
|
+
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) }] });
|
|
3364
|
+
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) }] });
|
|
3365
|
+
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) }] });
|
|
3366
|
+
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) }] });
|
|
3367
|
+
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) }] });
|
|
3368
|
+
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) }] });
|
|
3369
|
+
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) }] });
|
|
3370
|
+
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) }] });
|
|
3371
|
+
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) }] });
|
|
3372
|
+
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) }] });
|
|
3373
|
+
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) }] });
|
|
3374
|
+
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) }] });
|
|
3375
|
+
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) }] });
|
|
3376
|
+
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) }] });
|
|
3377
|
+
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) }] });
|
|
3378
|
+
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) }] });
|
|
3379
|
+
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) }] });
|
|
3380
|
+
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) }] });
|
|
3381
|
+
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) }] });
|
|
3382
|
+
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) }] });
|
|
3383
|
+
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) }] });
|
|
3384
|
+
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) }] });
|
|
3385
|
+
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) }] });
|
|
3386
|
+
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) }] });
|
|
3387
|
+
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) }] });
|
|
3388
|
+
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) }] });
|
|
3389
|
+
if (name === "site_agent_call") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", args), null, 2) }] });
|
|
3390
|
+
return sendError(msg.id, `Unknown tool: ${name}`);
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
runCli(process.argv.slice(2)).catch(err => {
|
|
3395
|
+
console.error(err.message);
|
|
3396
|
+
process.exit(1);
|
|
3397
|
+
});
|