Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs-site/docs/api/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ curl http://localhost:9200/health
- 普通 `utok_` / `ntok_` 只看到其有权访问网络的 session;无网络成员关系时返回空对象。

::: tip `license` 字段是 v0.6 legacy
`license: "trial"` 是 v0.6 时代 14 天试用机制的残留字段,Apache 2.0 OSS 后**不再作为商业功能门控**(自部署没有"过期"概念)。`send_task` 路径仍跑 trial 检查仅为后向兼容(verify [`server/src/tools.ts:521`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts#L521) `license_expired` 仍 emit),若命中见 [troubleshooting](/troubleshooting)。**v0.9.x / v0.10.x scope 都未动**(Recovery & Observability 主题为先),整段移除排到 v0.11+ / 未排期。
`license: "trial"` 是 v0.6 时代 14 天试用机制的残留字段,Apache 2.0 OSS 后**不再作为商业功能门控**(自部署没有"过期"概念)。`send_task` 路径仍跑 trial 检查仅为后向兼容(verify [`server/src/tools.ts:521`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts) `license_expired` 仍 emit),若命中见 [troubleshooting](/troubleshooting)。**v0.9.x / v0.10.x scope 都未动**(Recovery & Observability 主题为先),整段移除排到 v0.11+ / 未排期。
:::

---
Expand Down Expand Up @@ -393,7 +393,7 @@ curl -X POST http://localhost:9200/api/networks \
| 状态 | `error` 值 | 触发条件 |
|------|------------|---------|
| 400 | `network name already exists` | 同一 owner 名下已有同名 network(`UNIQUE(owner_id, network_name)` 约束) |
| 400 | `quota exceeded: max N networks for free plan` | 触发 plan quota 配额限制(v0.8 起 admin 用户豁免;free plan 默认 max_networks_owned=2,**当前 quota 仍在 `auth.ts:184-189` enforced**,跟 networks 表的 `max_members` 不同:那个 dormant、这个 active) |
| 400 | `quota exceeded: max N networks for free plan` | 触发 plan quota 配额限制(v0.8 起 admin 用户豁免;free plan 默认 max_networks_owned=2,**真正会拒绝建网的是 plan 配额** —— `auth.ts` 的 `createNetwork()` 按 `max_networks_owned` 校验(free=2,admin 豁免)。注意它与 `/api/license` 的 `limits` 不是一回事:后者(trial 默认 `max_agents=5` / `max_networks=3` / `max_tasks_day=500`)**是软限额**,服务端只存储和返回、不做任何拦截(CLI 里直接标作 `Soft limits`),而且两者的 networks 数字不同(3 vs 2)—— 以实际生效的 plan 配额为准(原文钉的 `184-189` 已漂到发 token 的代码上,所以这里改钉函数名),跟 networks 表的 `max_members` 不同:那个 dormant、这个 active) |
| 401 | `token required` / `invalid token` | 未提供 / 提供了无效 utok_ |

---
Expand Down Expand Up @@ -1539,10 +1539,10 @@ curl -N "http://localhost:9200/events/代码1号?token=ntok_xxx"
| `new_message` | 收到新消息(`send_message`) | `{from, message_id}` |
| `new_reply` | 收到 reply(`send_reply`) | `{from, message_id, in_reply_to, status}` |
| `broadcast` | 收到广播(`broadcast` 工具) | `{inbox_count}` |
| `chained_reply` | 子任务完成自动串回上游父任务发起者 ([`tools.ts:286/646`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts#L286)) | `{parent_task_id, child_task_id, child_alias}` |
| `chained_reply` | 子任务完成自动串回上游父任务发起者 ([`tools.ts:286/646`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts)) | `{parent_task_id, child_task_id, child_alias}` |
| `node.renamed` | RFC-010 节点改名 COMMIT 时广播([`rename.ts:100-123`](https://github.com/sleep2agi/agent-network/blob/main/server/src/rename.ts#L100)),推给 old + new 两个 alias 流 **+ 每个网络成员的 user channel**(dashboard 订阅的是 `/events/<username>` user channel、不是 per-alias 流,#84 SSE channel fix) | `{txn_id, alias(=new_alias), network_id, data:{old_alias, new_alias, surfaces_updated[], history_policy:"preserve"}}` |

> 旧 doc 在 `new_message` 上写过 `message` 字段、`broadcast` 上写过 `{content, from}` —— 都不对。verify [`tools.ts:571 + 911`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts#L571) 实际 payload 以上表为准。另注:`new_task` / `new_message` 在目标 alias **刚被改名**时会额外带一个 `renamed_from` 字段(指向旧 alias,`tools.ts` 的 `canonical.renamed` 分支)。
> 旧 doc 在 `new_message` 上写过 `message` 字段、`broadcast` 上写过 `{content, from}` —— 都不对。verify [`tools.ts:571 + 911`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts) 实际 payload 以上表为准。另注:`new_task` / `new_message` 在目标 alias **刚被改名**时会额外带一个 `renamed_from` 字段(指向旧 alias,`tools.ts` 的 `canonical.renamed` 分支)。
>
> **校正**:原表列过 `heartbeat` event with `{time}` payload,源码不发这个事件。[`push.ts:38-44`](https://github.com/sleep2agi/agent-network/blob/main/server/src/push.ts#L38) 实际发 SSE **comment 行** `: keepalive\n\n`(每 30s 一次,纯粹是给 proxy / LB 防 idle timeout 用),不会被 EventSource `onmessage` / `addEventListener` 触发,也不带 JSON payload。`connected` event 才是真正每次连接发一次的初始事件(agent-node 在 [`agent-node/src/cli.ts`](https://github.com/sleep2agi/agent-network/blob/main/agent-node/src/cli.ts) 显式处理它)。

Expand Down Expand Up @@ -2181,7 +2181,7 @@ curl http://localhost:9200/api/license
{
"ok": true,
"license": { "type": "trial", "expires_at": "2026-04-25 12:00:00", "days_left": 12, "expired": false },
"limits": { "max_agents": 5, "max_networks": 1, "max_tasks_day": 100 }
"limits": { "max_agents": 5, "max_networks": 3, "max_tasks_day": 500 }
}
```

Expand Down
11 changes: 6 additions & 5 deletions docs-site/docs/en/api/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sessions from networks they may access (or an empty object when they belong to
none).

::: tip The `license` field is a v0.6 legacy
`license: "trial"` is a leftover from the v0.6 era 14-day trial mechanism. After the Apache 2.0 OSS transition it is **no longer a commercial feature gate** (self-hosted has no notion of "expired"). The `send_task` path still runs the trial check only for backward compatibility (verify [`server/src/tools.ts:521`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts#L521) where `license_expired` is still emitted); if you hit it, see [troubleshooting](/en/troubleshooting). **The v0.9.x and v0.10.x scopes did not touch this** (Recovery & Observability took priority); full removal is queued for v0.11+ / unscheduled.
`license: "trial"` is a leftover from the v0.6 era 14-day trial mechanism. After the Apache 2.0 OSS transition it is **no longer a commercial feature gate** (self-hosted has no notion of "expired"). The `send_task` path still runs the trial check only for backward compatibility (verify [`server/src/tools.ts:521`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts) where `license_expired` is still emitted); if you hit it, see [troubleshooting](/en/troubleshooting). **The v0.9.x and v0.10.x scopes did not touch this** (Recovery & Observability took priority); full removal is queued for v0.11+ / unscheduled.
:::

---
Expand Down Expand Up @@ -395,7 +395,8 @@ curl -X POST http://localhost:9200/api/networks \
| Status | `error` value | Trigger |
|------|------------|---------|
| 400 | `network name already exists` | Same owner already has a network with this name (`UNIQUE(owner_id, network_name)` constraint) |
| 400 | `quota exceeded: max N networks for free plan` | Plan quota gate ([`auth.ts:184-189`](https://github.com/sleep2agi/agent-network/blob/main/server/src/auth.ts#L184); admins are exempt; free plan default `max_networks_owned = 2`). Note this gate **is** enforced, unlike the `max_members` column, which is dormant |
| 400 | `quota exceeded: max N networks for free plan` | **What actually rejects a network creation is the plan quota** — enforced in [`auth.ts`](https://github.com/sleep2agi/agent-network/blob/main/server/src/auth.ts) `createNetwork()` (the old `L184-189` pin has drifted onto token-issuing code, so this now pins the function name; admins are exempt; free plan default `max_networks_owned = 2`). Note this gate **is** enforced, unlike the `max_members` column, which is dormant.
⚠️ Do not confuse it with the `limits` block from `/api/license` (trial defaults `max_agents=5` / `max_networks=3` / `max_tasks_day=500`): those are **soft limits** — the server only stores and returns them and enforces nothing (the CLI prints them as `Soft limits`). The two `networks` numbers even differ (3 vs 2); the plan quota is the one that applies |
| 401 | `token required` / `invalid token` | Missing / invalid utok_ |

---
Expand Down Expand Up @@ -1485,10 +1486,10 @@ curl -N "http://localhost:9200/events/coder-1?token=ntok_xxx"
| `new_message` | New chat message (`send_message`) | `{from, message_id}` |
| `new_reply` | Reply to a task (`send_reply`) | `{from, message_id, in_reply_to, status}` |
| `broadcast` | Broadcast received (`broadcast` tool) | `{inbox_count}` |
| `chained_reply` | Sub-task completion routed back to the parent task's originator ([`tools.ts:286/646`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts#L286)) | `{parent_task_id, child_task_id, child_alias}` |
| `chained_reply` | Sub-task completion routed back to the parent task's originator ([`tools.ts:286/646`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts)) | `{parent_task_id, child_task_id, child_alias}` |
| `node.renamed` | Broadcast on RFC-010 node-rename COMMIT ([`rename.ts:100-123`](https://github.com/sleep2agi/agent-network/blob/main/server/src/rename.ts#L100)); pushed to the old + new alias streams **plus every network member's user channel** (the dashboard subscribes to `/events/<username>`, not per-alias streams — #84 SSE channel fix) | `{txn_id, alias(=new_alias), network_id, data:{old_alias, new_alias, surfaces_updated[], history_policy:"preserve"}}` |

> Earlier docs claimed `new_message` carried a `message` field and `broadcast` carried `{content, from}` — neither is correct. Verify [`tools.ts:571 + 911`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts#L571) for the actual payloads. Note: `new_task` / `new_message` additionally carry a `renamed_from` field (the old alias) when the target alias was just renamed — the `canonical.renamed` branch in `tools.ts`.
> Earlier docs claimed `new_message` carried a `message` field and `broadcast` carried `{content, from}` — neither is correct. Verify [`tools.ts:571 + 911`](https://github.com/sleep2agi/agent-network/blob/main/server/src/tools.ts) for the actual payloads. Note: `new_task` / `new_message` additionally carry a `renamed_from` field (the old alias) when the target alias was just renamed — the `canonical.renamed` branch in `tools.ts`.
>
> **Correction**: the table previously listed a `heartbeat` event with `{time}` payload. No such JSON event is emitted. [`push.ts:38-44`](https://github.com/sleep2agi/agent-network/blob/main/server/src/push.ts#L38) sends an SSE **comment line** `: keepalive\n\n` every 30s purely to defeat proxy/LB idle timeouts — comments are NOT delivered to `EventSource.onmessage` / `addEventListener` and carry no payload. The real once-per-connection initial event is `connected` (agent-node handles it explicitly at [`agent-node/src/cli.ts`](https://github.com/sleep2agi/agent-network/blob/main/agent-node/src/cli.ts)).

Expand Down Expand Up @@ -2083,7 +2084,7 @@ curl http://localhost:9200/api/license
{
"ok": true,
"license": { "type": "trial", "expires_at": "2026-04-25 12:00:00", "days_left": 12, "expired": false },
"limits": { "max_agents": 5, "max_networks": 1, "max_tasks_day": 100 }
"limits": { "max_agents": 5, "max_networks": 3, "max_tasks_day": 500 }
}
```

Expand Down
Loading