# 计算机

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/providers/computer/
Language: zh

`await api.storage.get() → ConnectedStorage (type: "filesystem")`

您的代码运行的机器, 在第一个密钥交换器上注册为存储 。 它的数据是它的文件, 他们从不离开它 。

Status: type: filesystem · registers itself · files and terminals

计算机不能连接, 软件包登记了它正在使用的计算机。 在第一个关键交换时, 它报告运行时间、 机器及其拥有的东西, 账户也为机器储存了它。

## 得到它 {#get}

```javascript
const pc = await api.storage.get();              // the account's default
const computers = (await api.storage.list()).filter((s) => s.type === "filesystem");
```

> **默认值不一定是此机器**
>
> 账户的默认值是它自己的对象存储。 api.storage.list() 而不是假设自己脚下能拿到磁盘。

## 随它携带的 {#properties}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `type` | string |  | 总是 `filesystem`. |
| `provider` | string |  | `machine`. |
| `machineId` | string |  | 哪个机器 比较了之前的文件操作。 |
| `hostname` | string|null |  | 机器的名字,它报告它的名字。 |
| `limits` | object |  | 报道了它自己的磁盘。 |

## 电脑只有两件东西 {#two-extras}

| 成员 | 是 |
| --- | --- |
| [文件 文件](/zh/sdk/ref/local-files) | 机器的工作空间——六种方法,没有网络。 |
| [终端终端](/zh/sdk/ref/connected-storage/terminals) | 贝壳和服务器 寿命超过一个答案 |

```javascript
await pc.files.write("notes.md", "# Today");
const shell = await pc.terminals.create({ name: "dev" });
```

## 运行() 不是进入路径 {#no-run}

计算机在账户上没有字节, 因此数据动作没有读取内容 : `run()` 存储是本地存储的答案。 其文件通过 `files`机器本身。

## api.files 无法保存到它 {#no-save}

`file.save({ storageId })` 拒绝计算机 `storage_is_local`:在账户上没有地方可以放字节。写成 `files.write()`,或使用 `save({ path, localOnly: true })` 直走你选择的道路

## 经纪人怎么用它 {#agent}

代理代理代理机构创建 `machine: pc` 在此工作 : 它读取它正在打开的磁盘, 编辑在同一个进程树上运行命令 。 边界是工作空间, 决定是您的许可回调 —— 没有任何东西上传给模型看 。

```javascript
const agent = api.agents.create({
  runtime: "local",
  machine: pc,
  model: "gemini-3.5-flash",
  mode: "ask",
  onPermission: async ({ tool, category }) => (category === "exec" ? "deny" : "once"),
});
```

## 需要它需要 Node {#runtime}

浏览器和工人没有文件系统登记,所以这种存储属于 Node。文件方法本身会用它来表示 `local_files_require_node`.

- [本地文件](/zh/sdk/ref/local-files): 六种文件方法全部完成
- [手机](/zh/sdk/ref/providers/phone): 设备,其文件在浏览器中。
- [设备即存储](/zh/sdk/concepts/machines-are-storages): 为什么一个装置是这样的模型?

```python
pc = api.storage.get()   # the account's default
computers = [s for s in api.storage.list() if s.type == "filesystem"]
```

```python
pc.files.write("notes.md", "# Today")
shell = pc.terminals.create(name="dev")
```

```python
agent = api.agents.create(
    runtime="local",
    machine=pc,
    model="gemini-3.5-flash",
    mode="ask",
    on_permission=lambda request: "deny" if request["category"] == "exec" else "once",
)
```
