# 库状态

Canonical URL: https://developers.iagenify.com/zh/sdk/agent/skills-and-subagents/library-status/
Language: zh

表示为何图书馆为空的字段:这里没有源, 或源拒绝, 这是它的代码 。

Status: {} means both were read · "none" is normal · a code is a refusal

```javascript
await agent.run({ inputs: "…" });

agent.libraryStatus;
// {}                               both read, whatever they returned
// { subagents: "none" }            no source for subagents on this machine
// { skills: "storage_not_local" }  a source was there and refused
```

## 两种价值 {#values}

| 值 | 含义 | 通常通常 |
| --- | --- | --- |
| `"none"` | 这里没有这种来源。 | 手机或云工作空间,没有磁盘,账户没有任何保存。 |
| 错误代码 | 来源存在,但被拒绝。 | `storage_not_local`, `storage_not_on_this_machine`,或者网络功能不全 。 |

成功读取对象中不存在的某类内容,包括当它返回空列表时,这仅仅意味着没有保存。

## 设计目的 {#why}

> **空的库和拒绝的库, 外外看起来相同**
>
> 两者都给予一个没有技能和没有任务工具的代理。 没有这个字段, 差异是隐形的, “代理从未像代表一样作为示范选择, 而不是作为无法阅读的图书馆。 ”

## 冲着它 {#surfacing}

```javascript
const problems = Object.entries(agent.libraryStatus).filter(([, value]) => value !== "none");

if (problems.length) {
  console.warn("library unavailable:", problems.map(([kind, code]) => `${kind}: ${code}`).join(", "));
}
```

处理 `"none"` 以信息和任何其他方式作为警告——第一个是配置,第二个是失败。

## 填满时 {#when}

每次运行开始时, 当两个库都重新阅读时。 在第一次运行之前, 它是一个空对象, 还没有意义 。

- [技能与子智能体](/zh/sdk/agent/skills-and-subagents): 都来自哪里 赢家是谁
- [选项 · 工具与库](/zh/sdk/ref/agents/options/tools): 选择一个跑步得到什么。

```python
agent.run(inputs="…")

# The Python engine has no library_status: it reads the libraries at creation,
# and an unreadable source simply leaves the list empty.
agent.skills, agent.subagents
```

```python
if not agent.skills and api.agents.skills.list():
    print("library unavailable: skills exist on the account but this agent has none")
```
