← 提示词库 Meta/muse-agent/skills/google-contacts/SKILL.md 原文 md
🌐 中英双语对照

name: "google_contacts"
description: "Search, view, create, update, and delete the user's Google Contacts."
icon: "google_contacts"
metadata: { "includeInPrompt": false }

Google Contacts

Everything runs through hatch_gws_cli people <resource> <method> — resource and method as separate words, with parameters in a --params JSON object and, for creates and edits, a --json request body. The flows below give the exact command for each task, so start there; for a command's flags run hatch_gws_cli people <resource> <method> --help, and for a method's --params/--json shape run hatch_gws_cli schema people.people.searchContacts (and so on).

一切操作都通过 hatch_gws_cli people <resource> <method> 运行——resource 和 method 作为分开的词,参数放在 --params JSON 对象中,创建和编辑操作还需一个 --json 请求体。下面的流程给出了每项任务的确切命令,请从这里开始;查看某个命令的标志可运行 hatch_gws_cli people <resource> <method> --help,查看某个方法的 --params/--json 结构可运行 hatch_gws_cli schema people.people.searchContacts(依此类推)。

A contact's id is an opaque resourceName like people/c1234567890, and people/me is the connected account itself. Reads must name the fields they want: searches take a readMask, and get/connections list take a personFields mask (both a comma list like names,emailAddresses,phoneNumbers). Never invent a resourceName — carry the one a read returned straight through to the edit or delete.

联系人的 id 是形如 people/c1234567890 的不透明 resourceName,而 people/me 代表已连接账户本身。读取操作必须指明所需字段:搜索使用 readMask,get/connections list 使用 personFields 掩码(两者都是逗号分隔列表,如 names,emailAddresses,phoneNumbers)。绝不要凭空编造 resourceName——把读取返回的那个 resourceName 原样传递给后续的编辑或删除。

Connecting / 建立连接

Contacts needs a one-time connect before commands return data. Run hatch_gws_cli people status. If it is not connected, post the exact connect_url it returns as [Connect Google Contacts](<connect_url>) and wait for the user to tap it. Don't invent a URL, send the user to Settings, or ask for credentials.

Contacts 需要先进行一次性连接,命令才会返回数据。运行 hatch_gws_cli people status。如果未连接,把它返回的 connect_url 原样以 [Connect Google Contacts](<connect_url>) 形式发出,并等待用户点击。不要编造 URL,不要让用户去设置页面,也不要索要凭据。

To disconnect, run hatch_gws_cli people disconnect and post its disconnect_url as [Disconnect Google Contacts](<disconnect_url>).

要断开连接,运行 hatch_gws_cli people disconnect,并把它的 disconnect_url 以 [Disconnect Google Contacts](<disconnect_url>) 形式发出。

If a command reports an auth failure or not-connected, rerun status and follow the link it returns. If status is unavailable, say Google Contacts isn't available on this device and stop. Auth flows only through status and disconnect, with no hand-authored credential files or raw gws auth.

如果某个命令报告认证失败或未连接,重新运行 status 并遵循它返回的链接。如果 status 不可用,告知用户此设备上 Google Contacts 不可用并停止。认证只经由 status 和 disconnect 进行,不要手写凭据文件,也不要直接运行 gws auth。

Common flows / 常用流程

Find a contact / 查找联系人

Add a contact / 添加联系人

people people createContact --json '{"names":[{"givenName":"Alice","familyName":"Smith"}],"emailAddresses":[{"value":"alice@example.com"}],"phoneNumbers":[{"value":"+15551234567"}]}'. A name is enough; add emailAddresses and phoneNumbers when the user gives them.

people people createContact --json '{"names":[{"givenName":"Alice","familyName":"Smith"}],"emailAddresses":[{"value":"alice@example.com"}],"phoneNumbers":[{"value":"+15551234567"}]}'。有姓名即可;当用户提供邮箱和电话时,再加上 emailAddresses 和 phoneNumbers。

Edit a contact / 编辑联系人

people people updateContact --params '{"resourceName":"people/<id>","updatePersonFields":"emailAddresses"}' --json '{"etag":"<etag>","emailAddresses":[<the full list with your change>]}'.

people people updateContact --params '{"resourceName":"people/<id>","updatePersonFields":"emailAddresses"}' --json '{"etag":"<etag>","emailAddresses":[<the full list with your change>]}'。

Delete a contact / 删除联系人

people people deleteContact --params '{"resourceName":"people/<id>"}'.

people people deleteContact --params '{"resourceName":"people/<id>"}'。

Rules / 规则

Limits / 限制