# jayleaton/orca-agent-packs architecture

> Architecture diagram of the GitHub repository jayleaton/orca-agent-packs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jayleaton/orca-agent-packs
- Repository: https://github.com/jayleaton/orca-agent-packs

## Overview

Orca Agent Packs lets users define and manage reusable agents, bot templates, and skills from local or Git-based packs, then apply them in Orca workspaces. The main workflow runs from the sidebar or other launch surfaces through the trusted worker, which synchronizes and parses packs, resolves templates, and provisions or launches workspace bots; the panel also exposes fleet and upstream-update capabilities. The excerpts establish several worker dependencies, but omit much of the worker’s routing and launch code, so uncertain UI-to-worker and runtime links are left dashed or absent.

Main entry points: [`plugin/worker/main.ts`](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/main.ts) (Trusted worker), [`plugin/worker/pack-sync.ts`](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-sync.ts) (Pack source sync), [`plugin/worker/pack-upstream.ts`](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-upstream.ts) (Upstream sync), [`plugin/worker/starter-pack.ts`](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/starter-pack.ts) (Starter pack)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Plugin interface"]
  node_panel["Packs panel<br/>[panel.tsx]"]
  node_protocol["Shared protocol<br/>[protocol.ts]"]
  node_worker["Trusted worker<br/>[main.ts]"]
end

subgraph group_pack_lifecycle["Pack lifecycle"]
  node_pack_sync["Pack source sync<br/>[pack-sync.ts]"]
  node_pack_parser["Pack validation<br/>[pack-parser.ts]"]
  node_starter_pack["Starter pack<br/>[starter-pack.ts]"]
  node_pack_writer["Pack editing<br/>[pack-writer.ts]"]
  node_upstream["Upstream sync<br/>[pack-upstream.ts]"]
  node_github["GitHub API<br/>[github-api.ts]"]
end

subgraph group_workspace_runtime["Workspace runtime"]
  node_bot_sync["Bot provisioning<br/>[bot-sync.ts]"]
  node_bot_intent["Bot commissioning<br/>[bot-intent.ts]"]
  node_shell_builder["Agent shell setup<br/>[shell-builder.ts]"]
  node_workspace_provisioner["Workspace setup"]
  node_agy_shim["Orca API shim<br/>[agy-shim.ts]"]
end

subgraph group_fleet_state["Fleet and state"]
  node_fleet["Fleet collection<br/>[fleet-collector.ts]"]
  node_workspace_records[("Workspace records")]
  node_worker_naming["Worker chat naming<br/>[worker-naming.ts]"]
end

node_user(("Orca user"))
node_orca["Orca workspaces"]
node_git_hosts["Git hosts"]

node_user -->|"uses"| node_panel
node_panel -.->|"requests actions"| node_worker
node_worker -->|"syncs sources"| node_pack_sync
node_worker -->|"loads packs"| node_pack_parser
node_worker -->|"resolves fallback"| node_starter_pack
node_worker -->|"loads overrides"| node_pack_writer
node_worker -->|"applies updates"| node_upstream
node_worker -.->|"collects fleet"| node_fleet
node_worker -.->|"commissions bots"| node_bot_intent
node_worker -.->|"syncs bots"| node_bot_sync
node_worker -.->|"provisions workspace"| node_workspace_provisioner
node_worker -.->|"builds launch shell"| node_shell_builder
node_worker -.->|"uses Orca API"| node_agy_shim
node_worker -.->|"reads records"| node_workspace_records
node_worker -->|"renames chats"| node_worker_naming
node_pack_sync -->|"uses slugify"| node_pack_parser
node_pack_sync -->|"resolves starter"| node_starter_pack
node_starter_pack -->|"validates pack"| node_pack_parser
node_pack_writer -->|"opens pull request"| node_github
node_upstream -->|"checks access"| node_github
node_upstream -->|"commits updates"| node_pack_writer
node_worker -.->|"syncs pack sources"| node_git_hosts
node_worker -.->|"configures bots"| node_orca
node_worker -.->|"uses message types"| node_protocol
node_fleet -->|"looks up records"| node_workspace_records
node_worker_naming -->|"runs Orca CLI"| node_fleet

click node_panel "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/src/panel.tsx"
click node_protocol "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/src/protocol.ts"
click node_worker "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/main.ts"
click node_pack_sync "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-sync.ts"
click node_pack_parser "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-parser.ts"
click node_starter_pack "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/starter-pack.ts"
click node_pack_writer "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-writer.ts"
click node_upstream "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-upstream.ts"
click node_github "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/github-api.ts"
click node_bot_sync "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/bot-sync.ts"
click node_bot_intent "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/bot-intent.ts"
click node_shell_builder "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/shell-builder.ts"
click node_workspace_provisioner "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/workspace-provisioner.ts"
click node_agy_shim "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/agy-shim.ts"
click node_fleet "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/fleet-collector.ts"
click node_workspace_records "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/workspace-records.ts"
click node_worker_naming "https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/worker-naming.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_panel,node_protocol,node_worker,node_user toneBlue
class node_pack_sync,node_pack_parser,node_starter_pack,node_pack_writer,node_upstream,node_github toneAmber
class node_bot_sync,node_bot_intent,node_shell_builder,node_workspace_provisioner,node_agy_shim toneMint
class node_fleet,node_workspace_records,node_worker_naming toneRose
class node_orca,node_git_hosts toneIndigo
```

## Components

### Plugin interface

- [Packs panel](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/src/panel.tsx): `plugin/src/panel.tsx`
- [Shared protocol](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/src/protocol.ts): `plugin/src/protocol.ts`
- [Trusted worker](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/main.ts): `plugin/worker/main.ts`

### Pack lifecycle

- [Pack source sync](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-sync.ts): `plugin/worker/pack-sync.ts`
- [Pack validation](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-parser.ts): `plugin/worker/pack-parser.ts`
- [Starter pack](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/starter-pack.ts): `plugin/worker/starter-pack.ts`
- [Pack editing](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-writer.ts): `plugin/worker/pack-writer.ts`
- [Upstream sync](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/pack-upstream.ts): `plugin/worker/pack-upstream.ts`
- [GitHub API](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/github-api.ts): `plugin/worker/github-api.ts`

### Workspace runtime

- [Bot provisioning](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/bot-sync.ts): `plugin/worker/bot-sync.ts`
- [Bot commissioning](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/bot-intent.ts): `plugin/worker/bot-intent.ts`
- [Agent shell setup](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/shell-builder.ts): `plugin/worker/shell-builder.ts`
- [Workspace setup](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/workspace-provisioner.ts): `plugin/worker/workspace-provisioner.ts`
- [Orca API shim](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/agy-shim.ts): `plugin/worker/agy-shim.ts`

### Fleet and state

- [Fleet collection](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/fleet-collector.ts): `plugin/worker/fleet-collector.ts`
- [Workspace records](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/workspace-records.ts): `plugin/worker/workspace-records.ts`
- [Worker chat naming](https://github.com/jayleaton/orca-agent-packs/blob/main/plugin/worker/worker-naming.ts): `plugin/worker/worker-naming.ts`

### Other components

- **Orca user**
- **Orca workspaces**
- **Git hosts**

## Connections

- Orca user → Packs panel: uses (evidence: `README.md`)
- Packs panel → Trusted worker: requests actions
- Trusted worker → Pack source sync: syncs sources (evidence: `plugin/worker/main.ts`)
- Trusted worker → Pack validation: loads packs (evidence: `plugin/worker/main.ts`)
- Trusted worker → Starter pack: resolves fallback (evidence: `plugin/worker/main.ts`)
- Trusted worker → Pack editing: loads overrides (evidence: `plugin/worker/main.ts`)
- Trusted worker → Upstream sync: applies updates (evidence: `plugin/worker/main.ts`)
- Trusted worker → Fleet collection: collects fleet (evidence: `plugin/worker/main.ts`)
- Trusted worker → Bot commissioning: commissions bots (evidence: `plugin/worker/main.ts`)
- Trusted worker → Bot provisioning: syncs bots (evidence: `plugin/worker/main.ts`)
- Trusted worker → Workspace setup: provisions workspace (evidence: `plugin/worker/main.ts`)
- Trusted worker → Agent shell setup: builds launch shell (evidence: `plugin/worker/main.ts`)
- Trusted worker → Orca API shim: uses Orca API (evidence: `plugin/worker/main.ts`)
- Trusted worker → Workspace records: reads records (evidence: `plugin/worker/main.ts`)
- Trusted worker → Worker chat naming: renames chats (evidence: `plugin/worker/main.ts`)
- Pack source sync → Pack validation: uses slugify (evidence: `plugin/worker/pack-sync.ts`)
- Pack source sync → Starter pack: resolves starter (evidence: `plugin/worker/pack-sync.ts`)
- Starter pack → Pack validation: validates pack (evidence: `plugin/worker/starter-pack.ts`)
- Pack editing → GitHub API: opens pull request (evidence: `plugin/worker/pack-writer.ts`)
- Upstream sync → GitHub API: checks access (evidence: `plugin/worker/pack-upstream.ts`)
- Upstream sync → Pack editing: commits updates (evidence: `plugin/worker/pack-upstream.ts`)
- Trusted worker → Git hosts: syncs pack sources
- Trusted worker → Orca workspaces: configures bots
- Trusted worker → Shared protocol: uses message types (evidence: `plugin/worker/main.ts`)
- Fleet collection → Workspace records: looks up records (evidence: `plugin/worker/fleet-collector.ts`)
- Worker chat naming → Fleet collection: runs Orca CLI (evidence: `plugin/worker/worker-naming.ts`)
