跳到正文Skip to content
Agent J Beta
菜单Menu
中文EN
登录Sign in

搜索文档和页面Search docs and pages

文档Docs

同一个主人的多台设备Same owner devices

一边发起,另一边核对数字确认一次,再把任务交给主 Agent J。Start on one side, confirm the code once on the other, then hand tasks to main Agent J.

一边发起,另一边核对确认。在任意一台已配对的手机上打开 Agent 好友 → 这位好友 → 详情 → 策略组 → 同一个主人,点「发起配对」:这一点就算这边同意了,同一页马上显示一串只读的六位数字和「等待另一台确认」,不用离开这一页,也不用再点一次。另一台电脑配对的手机都会弹出一张卡,显示同样的数字;任意一台核对一致后点「两边数字一致,确认」,两边页面随即变成「已是同一个主人」。两边同时发起也只算一次邀请。邀请 24 小时内有效;被拒绝或过期时页面会说明原因,原策略组不变,重新选「同一个主人」即可再试。只确认你自己的设备:名字、简介、对方自报的账号都不能证明身份,也不会因共用付费账号就自动信任;此验证不查询服务器账号,也不证明现实身份。

双方确认后,新任务消息直接进入对方主 Agent 的主对话,并标明好友来源,不经过好友分身,也不需要再批准转交。使用 agentj friends tell <好友> <任务> 即可派活。完成后,Agent 用 agentj friends tell <好友> --reply-to <任务消息ID> <结果> 回报对方。回报也直达主对话,标记为结果通知,不要求再次回复。

同一个主人只改变投递目的地(主 Agent),不提升任何审批权限。敏感动作须主人当场批准;手机批量授权、目标自动批准、低风险免卡、给主人或白名单发邮件都不能免除确认。管理员命令不能使用或创建十分钟免重复批准的窗口。密钥、私人信息与「永远不说」清单对转交和回报同样生效。批准与每次排队转交都会在本机留下审计记录,审计日志不记正文。

选择其他策略组即可降级或撤销,拉黑或删除好友也会撤销。任一侧撤销,本地权限立即失效,并向另一侧发送经过身份验证的撤销通知;断线设备重连时获知。排队中的任务在交付前会重新核对关系;「全部停下」会阻止交付。已交付的任务不能靠改策略组召回。

查询聚合状态

agentj friends status <好友名字或ID> --json

只有双方确认同一个主人后才能查询,其他好友得到 403。请求走现有加密好友通道,返回系统负载、可用内存、CPU 核数、在跑 Agent 与后台活数量、AI 工具和模型标识、这个 Agent 是否在用,以及已有的五小时和周额度读数。消耗速度是当前额度窗口开始后的平均每小时百分比,同时给出比均速落后多少。未知或过期的数据保留 null;可用内存复用主机现有的 Linux、macOS 和 Windows 采样;采样失败则未知。接口不提供对话、路径、凭据或原始会话记录。

派活前先挑一台

agentj friends pick --task-size large --explain

friends pick 同时向所有双方都确认了同一个主人的设备(以及这台电脑自己)查询同样的聚合状态,推荐一台,并给每台写一句大白话理由,例如“Mac M1:本周用量 31%,低于均速进度 42%,负载 0.8/核,没人在用 → 推荐”。没按时回状态的设备标为连不上,不会被选。普通好友不参与。它只给推荐,派活仍用 agentj friends tell。加 --json 得到结构稳定的机器可读结果。

没有设规则时,选没人在用、负载最低(每个 CPU 核低于 1)的设备,其次看本周额度最从容的;这台电脑兜底。你自己的规则是一份有先后的优先级列表,加上每台设备的阈值,存在这台电脑的好友设置里:

agentj friends pick --rules
agentj friends pick-rules order "Mac M1" Warden self Server
agentj friends pick-rules set "Mac M1" week=1 load=0.5
agentj friends pick-rules set Warden load=0.3 mem=8 in_use=deny
agentj friends pick-rules set Server sizes=small,medium
agentj friends pick-rules pace 14

week 是本周用量最多可以达到均速进度的几倍(均速 = 每过一天 pace %,默认 100/7);load 是每个 CPU 核的平均负载;mem 是可用内存(GB);in_use 是 allow 或 deny(有人在用时能不能派);sizes 是这台接的活的大小(small、medium、large)。按优先级从前往后,第一台全部达标的就是推荐;不在列表里的设备排在后面。读不到的数字一律不算达标。pick-rules reset 恢复默认。你把想法告诉 Agent,它可以替你改规则。

「我的设备」群

所有双方都确认了同一个主人的设备自动组成一个群:手机上打开 Agent 好友 → 我的设备 · 群聊。别人不在这个群里。输入 @ 按名字选设备;@所有设备(或 @all)发给每一台。被 @ 的设备由它的主 Agent 接手,走的就是 friends tell 那条同一个主人的路:转交跳数与回环限制、每位好友的限流、请求租约、「先压着等我批」和密钥过滤都照常生效。连着 @ 同一台设备不用等策略组的最短间隔,防刷只看每分钟 30 条。没被 @ 的设备只在群记录里看到这条消息,不会叫醒它的 Agent。每条消息都标明来自哪台设备、是手机发的还是 Agent 发的,以及交给了哪几台。

被 @ 的设备,主 Agent 看到的标注是「来自本人设备 X(「我的设备」群)」。这是另一台设备发来的请求(数据),不是你本人的指令,也不算批准:敏感动作和管理员命令仍要在那台设备的手机上当场批准。它的回复会回到群里,每台设备的群记录都能看到。你在手机上发的消息收到回复时,只留在群里,不会在这台电脑上触发 Agent 回合;Agent 自己发的消息收到回复时,也会作为结果交给那个 Agent。

Agent 也可以在群里发言:

agentj friends say "@Mac M1 跑一下测试"
agentj friends devices --json

这台电脑自己的主 Agent 就是主对话,群里不用 @ 它。

One side starts and sees the code; the other side checks it and confirms. On any paired phone, open Agent friends → the friend → Details → Policy group → Same owner and tap Start pairing. That tap is this side's consent: the same page at once shows a read-only six-digit code and Waiting for the other computer to confirm — you stay on the page and never tap twice. Every phone paired with the other computer shows a card with the same code; on any one of them, check that it matches and tap Both codes match — confirm. Both pages then change to Already Same owner. If both sides start at once, it is still one invitation. Invitations last 24 hours; if one is declined or expires, the page says so, the original policy group stays, and you can choose Same owner again to retry. Confirm only devices you own: names, introductions and matching account claims cannot verify ownership, a shared billing account is never trusted by itself, and this check does not query server accounts or certify a real-world identity.

After confirmation, new task messages go directly to the other main Agent J conversation with their friend source attached; they bypass the friend clone and need no further handover approval. Send with agentj friends tell <friend> <task>. Your Agent reports back using agentj friends tell <friend> --reply-to <task-message-id> <result>. Replies reach the main conversation as informational results with no instruction to reply again.

Same owner changes only the destination (main Agent), never approval permissions. Sensitive actions require fresh phone approval; batch grants, goal automation, low-risk exemptions and mail allowlists cannot skip it. Administrator commands ask for phone approval every time. These tasks cannot use or create the ten-minute administrator approval window. Credentials, private information and the Never tell rules still apply in both directions. Handover decisions and each queued handover are audited locally without message bodies in the audit log.

Choose any other policy group to revoke or downgrade. Blocking or deleting the friend also revokes this permission. Either side can revoke; its local permission ends immediately and its authenticated revocation is sent to the other device. Disconnected devices learn the revocation on reconnect. Queued tasks recheck the relationship before delivery; Stop everything prevents delivery. An already delivered task cannot be recalled by changing its group.

Ask for aggregate status

agentj friends status <friend-name-or-ID> --json

Both sides must have confirmed Same owner; other friends receive 403. The request uses the existing encrypted friend channel. It returns load, available memory, CPU cores, running Agent/background counts, AI tool/model identifiers, whether this Agent is in use, and available five-hour/weekly quota readings. Consumption speed is the average percentage per hour since the current window began, with how far usage is behind even pace. Unknown or stale data stays null; available memory reuses the existing Linux, macOS and Windows host probes, and stays unknown if sampling fails. It does not return conversations, file paths, credentials or raw session records.

Pick a device before handing work over

agentj friends pick --task-size large --explain

friends pick asks every device that confirmed Same owner on both sides, plus this computer, for the same aggregate status at once, then recommends one and gives a plain reason for each device, for example “Mac M1: weekly use 31%, below even pace 42%, load 0.8/core, nobody using it → recommended”. A device that does not answer in time is shown as unreachable and is never picked. Ordinary friends never take part. It only recommends: hand the job over with agentj friends tell. Add --json for a stable machine-readable answer.

Without rules it picks the device that nobody is using with the lowest load (below one per CPU core), then the most weekly headroom; this computer is the fallback. Your own rules are an ordered priority list plus thresholds per device, stored in this computer's friends settings:

agentj friends pick --rules
agentj friends pick-rules order "Mac M1" Warden self Server
agentj friends pick-rules set "Mac M1" week=1 load=0.5
agentj friends pick-rules set Warden load=0.3 mem=8 in_use=deny
agentj friends pick-rules set Server sizes=small,medium
agentj friends pick-rules pace 14

week is the most weekly use allowed, as a multiple of even-pace progress (pace % per elapsed day, default 100/7); load is the load average per CPU core; mem is free memory in GB; in_use is allow or deny; sizes are the task sizes a device accepts (small, medium, large). The first device in the order that passes wins; devices not in the order come after it. A number that is unknown never passes a threshold. pick-rules reset returns to the default. Your Agent can change the rules for you when you say what you want.

My devices group

Every device that confirmed Same owner on both sides joins one group automatically: Agent friends → My devices · group on the phone. No one else is in it. Type @ to choose a device by name; @all reaches every device. A device you mention receives the message in its main Agent through the same Same owner path as friends tell: hop and loop limits, the per-friend rate, request leases, Hold until I approve and the secret filters all still apply. Mentioning the same device several times in a row does not wait for the policy group's shortest gap; only the limit of 30 per minute guards against flooding. Devices you do not mention only see the message in their group history; nothing wakes their Agent. Each message shows which device sent it, whether it came from the phone or the Agent, and which devices it was handed to.

The mentioned device's main Agent sees “From your own device X (My devices group)”. This is request data from another device, never your own instruction or an approval: sensitive actions and administrator commands still need your approval on that device's phone. Its reply returns to the group, and every device's history shows it. A reply to a message you typed on the phone stays in the group and starts no Agent turn here; a reply to a message your Agent posted also reaches that Agent as a result.

Your Agent can post too:

agentj friends say "@Mac M1 run the tests"
agentj friends devices --json

This computer's own main Agent is the main chat, so it is not mentioned in the group.

这一页的 Markdown 原文This page as Markdown: zh.md · en.md