Three ways to touch a project

Read-only on the host, a sealed Docker room, or a permanent bench on this machine or another.

beginner9 min read

You have a checkout open in your editor. You ask Pipal to explain a function, and give it the filename. With the default setup, the filename alone gives the assistant no way to open it. The work you want back tells you which access to give it. A review needs a way to read. A fix needs a place to write. An app you can come back to tomorrow needs somewhere to keep running.

In this chapter

  • Choose where the assistant can read, edit, and run commands.
  • Share a host checkout or a directory of text files with the right profile.
  • Tell which setup will keep a file or a running app between calls.
  • Find out why a configured project tool can be missing.

Start with the work you want done

For edits and commands, Developer needs a locationThe place a chat uses for project tools, either the Pipal host, an account reached over SSH, or a Docker project.. Choose Docker to edit and run commands in temporary containers. A development workspaceA project folder that Developer’s tools can return to across chats, on the Pipal host or under an account reached over SSH. can be on This machine or on an SSH machine. Host readers have their own configuration and can serve a review even with every location off. contracts.ts main.ts

Three ways to reach a project
FeatureHost readers Docker Development workspace This machine or SSH machine
Where tools runIn the Pipal host process, with a local helper and rg for checkout search.In a new container that Pipal creates for each Bash call or file operation.Directly on the Pipal host or through SSH to the configured Linux account.
Where files liveIn a configured checkout or notes folder on the Pipal host.In a named volume on the selected Docker engine, mounted at /workspace.In a project under the host’s data directory or in a project folder on the SSH machine.
What persistsYour existing files.Files saved in the volume.Files saved in the project, including the checkout and dependencies installed there.
Attach a project file to a chatHost reader tools only open and search files.Use publish_file with a coding grant and approval or YOLO.Use publish_file with a coding grant and approval or YOLO.
Network for project workLocal reads and searches only.Bash and file calls run offline. Optional web lookups run outside the project. An enabled git_clone uses a separate networked container.Network access available to the account running Bash.
What can keep runningNo shell tool.Processes inside a tool container end with it.A service started under Docker or a user service manager can outlive the call.
What bounds accessThe configured root and each reader’s path and file checks.A restricted container and volume.Bash has the Pipal service user’s permissions on This machine, or the separate development account’s permissions over SSH.
What you set upA directory and a profile grant. rg for code search.Engine access, a Linux image, a writable volume, and tool grants. Enable Docker in Settings.For This machine, run Pipal as an unprivileged Linux or macOS user with /bin/bash available. For SSH machine, configure a separate Linux account, Bash, Node.js, SSH, and a project root or named folders. Enable the location in Settings.
When to choose itRead a checkout or look up shared notes.Edit and test offline.Install packages and keep apps running.

Choose up to two columns

Choose up to two columns

FeatureHost readers Docker Development workspace This machine or SSH machine
Where tools runIn the Pipal host process, with a local helper and rg for checkout search.In a new container that Pipal creates for each Bash call or file operation.Directly on the Pipal host or through SSH to the configured Linux account.
Where files liveIn a configured checkout or notes folder on the Pipal host.In a named volume on the selected Docker engine, mounted at /workspace.In a project under the host’s data directory or in a project folder on the SSH machine.
What persistsYour existing files.Files saved in the volume.Files saved in the project, including the checkout and dependencies installed there.
Attach a project file to a chatHost reader tools only open and search files.Use publish_file with a coding grant and approval or YOLO.Use publish_file with a coding grant and approval or YOLO.
Network for project workLocal reads and searches only.Bash and file calls run offline. Optional web lookups run outside the project. An enabled git_clone uses a separate networked container.Network access available to the account running Bash.
What can keep runningNo shell tool.Processes inside a tool container end with it.A service started under Docker or a user service manager can outlive the call.
What bounds accessThe configured root and each reader’s path and file checks.A restricted container and volume.Bash has the Pipal service user’s permissions on This machine, or the separate development account’s permissions over SSH.
What you set upA directory and a profile grant. rg for code search.Engine access, a Linux image, a writable volume, and tool grants. Enable Docker in Settings.For This machine, run Pipal as an unprivileged Linux or macOS user with /bin/bash available. For SSH machine, configure a separate Linux account, Bash, Node.js, SSH, and a project root or named folders. Enable the location in Settings.
When to choose itRead a checkout or look up shared notes.Edit and test offline.Install packages and keep apps running.
Compare where the work happens with what you can come back to after a tool call.

With a fresh installation and the default configuration, the bundled profiles have no tools for opening files in your checkout or running its commands. You can paste code into the conversation and ask about it right away. To let the assistant open a project file itself, the server needs to offer the right extension, a named bundle of tools, and the profile needs a grant for that extension. Tools and extensions follows those grants. config.ts workspace-locations.ts

Give Code reviewer a checkout to inspect

Enable host readers in config.toml
[extensions]
enabled = [
  "pipal.delegate",
  "pipal.system-diagnostics",
  "pipal.web-artifacts",
  "pipal.project-read",
  "pipal.workspace",
]
coding_root = "./review-copy"
workspace_root = "./shared-notes"
  1. Enable the readers

    An explicit list replaces the defaults. This example leaves out the project tool bundles pipal.coding and pipal.bash, so it gives profiles only reader access to project files.

  2. Point at a checkout

    pipal.project-read makes this tree available to Code reviewer through ls, find, grep, and read.

  3. Point at shared text

    pipal.workspace makes this folder available to profiles that request it, including the bundled Developer and Code reviewer.

[extensions]








1 Enable the readers

An explicit list replaces the defaults. This example leaves out the project tool bundles pipal.coding and pipal.bash, so it gives profiles only reader access to project files.

Example host-reader settings. The two paths point to separate directories beside config.toml.

Suppose you want a review of a change already in a checkout on the host. Set extensions.coding_root to that checkout and include pipal.project-read in an explicit extensions.enabled list. Keep any other bundles you need, including pipal.coding and pipal.bash if you also want Developer to edit and run code. Restart Pipal and select Code reviewer, whose bundled profile requests the host reader when it is enabled. The coding rootThe directory on the Pipal host that the read-only project tools use as their starting point and limit. gives the reviewer a place to start looking and bounds which project files its tools can open. config.ts reviewer.md

Ask where a function is used and the reviewer can use grep to look for its name in file contents, then read to open one of the matches. ls lists the immediate entries in a directory. find gives you filenames that match a pattern such as **/*.ts. The host supplies those three navigation tools and runs Pi’s read with a restricted set of file operations. coding.ts coding-search.ts

Deep diveHow the code reader checks a path and bounds a search

createProjectReadExtension resolves the configured root to its real path and rejects hidden roots, roots containing the home directory, and roots in Pipal storage. If your checkout contains the data directory, individual reads and searches exclude that subtree. The reader resolves each requested path under the root, walks the normalized path components, and rejects symlinks, special files, regular files with multiple hard links, and dot-prefixed names except for a regular .gitignore. It checks the real paths as well and asks Pi’s binary reader to open with noFollow. These checks assume operator control of the project and its parent directories. coding.ts coding-environment.ts

ls stops on the 200th entry it visits, counting even entries it filters out. For find and grep, the host checks the starting path and starts project-search.ts with a 10-second deadline. The helper invokes rg with its external config disabled, using file enumeration for find and JSON match records for grep. It applies the glob to the basename unless the glob contains a slash, in which case it matches relative to the search base. It filters the returned paths again for visibility, storage, and file type before emitting them. It returns up to 200 results and reports truncation when it finds another. coding-search.ts project-search.ts

Share a folder of notes with other profiles

If you want Developer to look up release instructions, put shareable text in a dedicated folder and set extensions.workspace_root. Enable pipal.workspace and restart. Both the bundled Developer and Code reviewer profiles request this extension. You can use it alongside a write-capable project so that the project holds the code and the host folder supplies the notes. config.ts developer.md

Ask for the release checklist and Developer can call workspace_list for immediate directories and readable text files, workspace_search to look through subdirectories for exact text, or workspace_read for a file it knows by name. The reader takes a relative path and accepts single-link regular UTF-8 files up to 16 KiB without NUL bytes. That makes this a good place for short instructions and handover notes. workspace.ts

Deep diveHow the text workspace treats paths, links, and search

workspaceRoot rejects a root inside Pipal storage and a root containing storage. It also rejects hidden roots and roots that contain the home directory. For a direct read, workspacePath checks the relative path, resolves it with realpath, and verifies that the resolved target still lies inside the visible workspace. That permits a visible symlink to a permitted file inside the workspace. Listing and search skip symlink entries during enumeration. Reads open the resolved path with O_NOFOLLOW and check that it is a regular file with exactly one hard link. workspace.ts

packages/core/src/workspace.ts
async function workspacePath(root: string, path: string) {
if (!path || path.includes('\0') || isAbsolute(path) || hidden(path))
throw new Error('Path outside allowed workspace');
const target = await realpath(resolve(root, path));
if (!contains(root, target) || hidden(relative(root, target)))
throw new Error('Path outside allowed workspace');
return target;
}

Search uses a case-sensitive substring of up to 128 characters on a single line. It walks directories and returns paths, one-based line numbers, and excerpts of up to 240 characters. List and search examine up to 512 entries and return up to 50 items within a budget of 12,000 characters, counted as each item’s JSON length plus one. If the scan or the next result would exceed a limit, truncated is true. workspace.ts

Give Developer a place to write and run

If the test starts with a package download or ends with an app you want to leave running, use a development workspace. On This machine, projects live under the data directory’s projects/ folder. An approved command runs as the Pipal service user and can read that account’s files, including durable.sqlite and any saved model login. That access also applies when YOLO approves a command automatically. The development workspace follows a call on either machine. development-workspace.ts DeveloperWorkspace.svelte

The operator describes an SSH destination in [extensions.development_workspace], or supplies the image and Docker volumeA folder managed by Docker whose files can outlive the containers that use it. in [extensions.project_shell]. Pipal accepts only one of those tables. Either location can be enabled alongside This machine. The default extension list includes pipal.coding and pipal.bash, which the bundled Developer profile requests. For Docker, explicitly list the project bundles you need in extensions.enabled. The Docker project follows an offline call and the files it leaves behind. config.ts developer.md

On a fresh installation, the owner opens Settings → Workspace with every location off. On upgrade, if durable.sqlite exists and there is no workspace-settings.json, Pipal imports an existing configured SSH or Docker grant. Select where Developer may work. With more than one location selected, choose Default for new chats. When you click Save changes, Pipal checks each newly enabled location before writing the choices to workspace-settings.json on the server. DeveloperWorkspace.svelte workspace-locations.ts

The same panel has a separate Start new chats in YOLO mode checkbox. It starts off. Enabling it gives each new chat with workspace access a grant for its own workspace. You can override the default in the composer before the first send. Approvals and YOLO follows a command through that check. DeveloperWorkspace.svelte index.ts

In a new Developer chat, the Runtime chip shows the location and, for a development workspace, the project. A fresh draft starts with your default location. Open Runtime to change it when there is a choice or use the Project field to pick or name a development project. On the first Send, Pipal pins the chat to that location and its selected project. For Docker, the pin covers the image, the named volume and whether cloning is enabled. To switch locations or projects, start a new chat. RuntimePicker.svelte index.ts

At any project location, Pipal asks before edits, writes, commands, and copying a file into the chat with publish_file. read skips the approval step. Approvals and YOLO explains what you’re agreeing to when the card appears. For longer assignments in named projects, see Workers. index.ts project-coding.ts

Code reviewer can still have its own host reader while Developer works in any location. When delegation is available, Developer’s profile instructs it to send the diff, surrounding code, and behavior to check for an independent review. The reviewer can use that material and whatever host copy you separately shared, which can be older than the file Developer edited in the project. developer.md reviewer.md

Deep diveWhy the chat can open when the project tools are missing

loadWorkspaceLocations rejects a profile with grants for both pipal.project-read and pipal.coding, since both offer read. Invalid saved workspace settings also stop startup. Pipal probes enabled locations before the harness resumes work. If a startup probe fails, Pipal logs the failure and keeps the location selected. A backend error shows as Unavailable with the reason. After fixing the cause, use Retry connection. If Settings shows setup instructions, follow them and restart Pipal after any TOML changes. workspace-locations.ts DeveloperWorkspace.svelte

The server registers one set of project tools. When none of the enabled locations is open, GET /api/v1/extensions leaves out the project tool bundles. That list describes the server as a whole. For a particular call, core checks the chat’s pinned location and project and route checks them again before passing the call to the location’s tool. app.ts index.ts workspace-locations.ts

When Docker is your choice, what happens between approving a test run and seeing its exit code, and where do the files land? The Docker project opens up one call.

Recap

  • Project access starts with an enabled extension and a profile that can use it. For Developer’s project tools, the owner enables locations in Settings → Workspace, and the first Send pins the chat’s choice.
  • Host readers serve separate jobs. Use pipal.project-read for a checkout and pipal.workspace for shared text.
  • Pipal creates disposable containers for the Docker project and keeps project files in a volume. In a development workspace it starts tools on the Pipal host or over SSH, and you can run an app as a separate service.
Check yourself
  1. You want a reviewer to find callers of a function in a host checkout. Which tools fit?
    • The host project reader
    • The isolated Bash tool
    • The development project picker
    Answer and explanation

    The host project reader

    The project reader can search and open source files in the configured checkout without granting a shell.

  2. The tests need package downloads, and the app should still respond when you return in a new chat. Where should Developer work?
    • A host notes folder
    • A Docker project with git_clone enabled
    • A development workspace with a managed service
    Answer and explanation

    A development workspace with a managed service

    In a development workspace, Bash can download dependencies and start services managed by Docker or the account’s service manager. The Docker project’s clone feature fetches a checkout without giving Bash network access.

  3. Developer changed a file in its Docker volume, but the reviewer opens a different version. What should Developer send?
    • The absolute path from the container
    • The diff and enough context to review it
    • The chat’s approval card
    Answer and explanation

    The diff and enough context to review it

    The reviewer’s file tools point to the host copy. The diff carries the changes across that boundary.

  1. You want a reviewer to find callers of a function in a host checkout. Which tools fit?

  2. The tests need package downloads, and the app should still respond when you return in a new chat. Where should Developer work?

  3. Developer changed a file in its Docker volume, but the reviewer opens a different version. What should Developer send?

In the source

Book contents

Search the book