@twin3-ai/agent-id 0.3.40 → 0.3.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/agent-id.js +35 -2
  2. package/package.json +1 -1
package/bin/agent-id.js CHANGED
@@ -36,12 +36,38 @@ async function post(path, body, headers = {}) {
36
36
  try { return JSON.parse(text); } catch { return { ok: res.ok, text }; }
37
37
  }
38
38
 
39
- async function get(path) {
40
- const res = await fetch(endpoint + path);
39
+ async function get(path, headers = {}) {
40
+ const res = await fetch(endpoint + path, { headers });
41
41
  const text = await res.text();
42
42
  try { return JSON.parse(text); } catch { return text; }
43
43
  }
44
44
 
45
+ function jobbankCompanyRequest(args = {}) {
46
+ const url = String(args.url || "").trim();
47
+ const agentKey = String(args.agent_key || "").trim();
48
+ if (!url) throw new Error("jobbank_company requires url");
49
+ if (!agentKey) throw new Error("jobbank_company requires agent_key");
50
+ const query = new URLSearchParams({ url });
51
+ if (args.registration_id) query.set("registration_id", String(args.registration_id));
52
+ if (args.source_employer_id) query.set("source_employer_id", String(args.source_employer_id));
53
+ if (args.job_limit !== undefined) query.set("job_limit", String(args.job_limit));
54
+ if (args.include_jobs !== undefined) query.set("include_jobs", args.include_jobs ? "true" : "false");
55
+ return {
56
+ path: `/api/site_agents/v1/jobbank/company?${query.toString()}`,
57
+ headers: { Authorization: `Bearer ${agentKey}` },
58
+ };
59
+ }
60
+
61
+ function companyCardResolveRequest(args = {}) {
62
+ const registrationId = String(args.registration_id || "").trim();
63
+ const companyId = String(args.company_id || "").trim();
64
+ if (!registrationId && !companyId) throw new Error("company_card_resolve requires registration_id or company_id");
65
+ const query = new URLSearchParams();
66
+ if (registrationId) query.set("registration_id", registrationId);
67
+ if (companyId) query.set("company_id", companyId);
68
+ return `/api/company-card/resolve?${query.toString()}`;
69
+ }
70
+
45
71
  async function getText(path) {
46
72
  const res = await fetch(endpoint + path);
47
73
  return await res.text();
@@ -3496,6 +3522,8 @@ async function handleMcpLine(line) {
3496
3522
  { name: "site_agent_draft_decisions", description: "List draft decision receipts for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, decision: { type: "string" }, draft_id: { type: "string" } }, required: ["url", "agent_key"] } },
3497
3523
  { name: "site_agent_decision_reviews", description: "List owner apply-plan decision review receipts for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, decision: { type: "string" }, apply_item_id: { type: "string" }, item_id: { type: "string" } }, required: ["url", "agent_key"] } },
3498
3524
  { name: "site_agent_jobs", description: "List redacted AEO job records for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" } }, required: ["url", "agent_key"] } },
3525
+ { name: "jobbank_company", description: "Read the verified website's own source-backed LEI candidates and public TaiwanJobs summaries. Returns no Human ID or person/candidate data.", inputSchema: { type: "object", properties: { url: { type: "string", format: "uri" }, agent_key: { type: "string", writeOnly: true }, registration_id: { type: "string", pattern: "^[0-9]{8}$" }, source_employer_id: { type: "string", pattern: "^[0-9]{1,20}$" }, job_limit: { type: "integer", minimum: 1, maximum: 50, default: 50 }, include_jobs: { type: "boolean", default: true } }, required: ["url", "agent_key"], additionalProperties: false } },
3526
+ { name: "company_card_resolve", description: "Resolve one exact Taiwan registration/company ID to an unclaimed public company-card URL. This is not a company directory or candidate search.", inputSchema: { type: "object", properties: { registration_id: { type: "string", pattern: "^[0-9]{8}$" }, company_id: { type: "string", pattern: "^TW:RA000551:[0-9]{8}$" } }, anyOf: [{ required: ["registration_id"] }, { required: ["company_id"] }], additionalProperties: false } },
3499
3527
  { name: "site_agent_c5_repair_history", description: "Return redacted C5 content repair history for the verified website agent only.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" } }, required: ["url", "agent_key"] } },
3500
3528
  { name: "site_agent_report_job_evidence", description: "Attach implementation evidence to one of the verified website agent's own jobs.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, action: { type: "string", const: "report_job_evidence" }, job_id: { type: "string" }, evidence_uri: { type: "string" }, evidence: { type: "object" } }, required: ["url", "agent_key", "action", "job_id"] } },
3501
3529
  { name: "site_agent_call", description: "Call twin3 with an installed Site Agent Key.", inputSchema: { type: "object", properties: { url: { type: "string" }, agent_key: { type: "string" }, action: { type: "string" } }, required: ["url", "agent_key"] } }
@@ -3950,6 +3978,11 @@ async function handleMcpLine(line) {
3950
3978
  if (name === "site_agent_draft_decisions") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "draft_decisions" }), null, 2) }] });
3951
3979
  if (name === "site_agent_decision_reviews") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "decision_reviews" }), null, 2) }] });
3952
3980
  if (name === "site_agent_jobs") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "jobs" }), null, 2) }] });
3981
+ if (name === "jobbank_company") {
3982
+ const request = jobbankCompanyRequest(args);
3983
+ return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get(request.path, request.headers), null, 2) }] });
3984
+ }
3985
+ if (name === "company_card_resolve") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await get(companyCardResolveRequest(args)), null, 2) }] });
3953
3986
  if (name === "site_agent_c5_repair_history") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "c5_repair_history" }), null, 2) }] });
3954
3987
  if (name === "site_agent_report_job_evidence") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", { ...args, action: "report_job_evidence" }), null, 2) }] });
3955
3988
  if (name === "site_agent_call") return send(msg.id, { content: [{ type: "text", text: JSON.stringify(await post("/api/site_agents/call", args), null, 2) }] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin3-ai/agent-id",
3
- "version": "0.3.40",
3
+ "version": "0.3.42",
4
4
  "description": "Domain-bound AgentX portable alias, AEO evidence, and website-Agent integration SDK.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,