orkestrate 0.1.14 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/AGENTS.md +56 -0
  2. package/CONTRIBUTING.md +35 -0
  3. package/README.md +38 -58
  4. package/SECURITY.md +24 -0
  5. package/bin/orkestrate.ts +2 -0
  6. package/docs/concepts.md +119 -0
  7. package/docs/demo-extension-builder.md +82 -0
  8. package/docs/extensions/adapters.md +57 -0
  9. package/docs/extensions/architecture.md +49 -0
  10. package/docs/extensions/introduction.md +26 -0
  11. package/docs/getting-started.md +85 -0
  12. package/docs/hosted-registry.md +90 -0
  13. package/docs/pack-authoring.md +75 -0
  14. package/docs/roadmap.md +59 -0
  15. package/docs/troubleshooting.md +28 -0
  16. package/extensions/opencode-adapter/index.ts +106 -0
  17. package/extensions/opencode-adapter/orkestrate.extension.json +17 -0
  18. package/package.json +40 -33
  19. package/packs/coding/harnesses/opencode/agents/coding.md +8 -0
  20. package/packs/coding/harnesses/opencode/opencode.json +24 -0
  21. package/packs/coding/harnesses/opencode/skills/orkestrate/SKILL.md +57 -0
  22. package/packs/coding/pack.yaml +5 -0
  23. package/packs/extension-builder/harnesses/opencode/agents/extension-builder.md +8 -0
  24. package/packs/extension-builder/harnesses/opencode/opencode.json +31 -0
  25. package/packs/extension-builder/harnesses/opencode/skills/orkestrate/SKILL.md +54 -0
  26. package/packs/extension-builder/harnesses/opencode/skills/orkestrate-pack-author/SKILL.md +59 -0
  27. package/packs/extension-builder/pack.yaml +5 -0
  28. package/src/cli/cmd/extension-submit.ts +267 -0
  29. package/src/cli/cmd/pack-create.ts +43 -0
  30. package/src/cli/cmd/pack.ts +53 -0
  31. package/src/cli/cmd/profile-create.ts +199 -0
  32. package/src/cli/cmd/profile-submit.ts +236 -0
  33. package/src/cli/cmd/profile-validate.ts +5 -0
  34. package/src/cli/cmd/registry.ts +66 -0
  35. package/src/cli/cmd/run.ts +37 -0
  36. package/src/cli/index.ts +163 -0
  37. package/src/cli/tui.ts +355 -0
  38. package/src/cli/ui/welcome.ts +73 -0
  39. package/src/cli.ts +1 -0
  40. package/src/sdk/cross-platform.ts +25 -0
  41. package/src/sdk/extensions/loader.ts +89 -0
  42. package/src/sdk/extensions/manifest.ts +193 -0
  43. package/src/sdk/extensions/types.ts +12 -0
  44. package/src/sdk/harness/sync-slice.ts +57 -0
  45. package/src/sdk/launch/broker.ts +87 -0
  46. package/src/sdk/launch/runner.ts +57 -0
  47. package/src/sdk/launch/terminal.ts +75 -0
  48. package/src/sdk/launch/types.ts +7 -0
  49. package/src/sdk/launch/windows.ts +109 -0
  50. package/src/sdk/packs/catalog.ts +172 -0
  51. package/src/sdk/packs/create.ts +99 -0
  52. package/src/sdk/packs/fs.ts +52 -0
  53. package/src/sdk/packs/github.ts +249 -0
  54. package/src/sdk/packs/paths.ts +19 -0
  55. package/src/sdk/packs/registry.ts +40 -0
  56. package/src/sdk/packs/schema.ts +51 -0
  57. package/src/sdk/packs/store.ts +172 -0
  58. package/src/sdk/profiles/catalog.ts +199 -0
  59. package/src/sdk/profiles/github.ts +177 -0
  60. package/src/sdk/profiles/install.ts +161 -0
  61. package/src/sdk/profiles/load.ts +209 -0
  62. package/src/sdk/profiles/materialize.ts +85 -0
  63. package/src/sdk/profiles/pack.ts +128 -0
  64. package/src/sdk/profiles/schema.ts +201 -0
  65. package/src/sdk/registry.ts +19 -0
  66. package/src/sdk/runs/registry.ts +142 -0
  67. package/src/sdk/runs/types.ts +15 -0
  68. package/src/sdk/types.ts +39 -0
  69. package/src/version.ts +3 -0
  70. package/dist/cli.js +0 -1668
  71. package/dist/cli.js.map +0 -1
  72. package/dist/mcp-entry.js +0 -181
  73. package/dist/mcp-entry.js.map +0 -1
package/AGENTS.md ADDED
@@ -0,0 +1,56 @@
1
+ # Orkestrate — agent instructions
2
+
3
+ Help the user **browse, use, and share specialized harnesses** for **agent packs**.
4
+
5
+ ## What it is
6
+
7
+ | Term | Meaning |
8
+ |------|---------|
9
+ | Agent pack | `pack.yaml` + `harnesses/opencode/` — installable agent product |
10
+ | Harness slice | Task-specific runtime (tools, prompts, skills) inside the pack |
11
+ | Orkestrate | CLI + TUI: install packs, launch OpenCode in a **new terminal**, persist sessions in `.orkestrate/pack-homes/<packId>/` |
12
+
13
+ v0 is **OpenCode only**. Orkestrate does not replace OpenCode.
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install -g orkestrate
19
+ # Bun 1.3+ — or: bun install -g orkestrate
20
+
21
+ orkestrate doctor
22
+ orkestrate registry install coding
23
+ orkestrate run launch coding
24
+ ```
25
+
26
+ ## Commands (trust only these)
27
+
28
+ ```text
29
+ orkestrate # TUI workbench
30
+ orkestrate doctor
31
+ orkestrate pack list|install|create|validate
32
+ orkestrate run launch|list|status|stop <pack-id>
33
+ orkestrate registry list|search|install
34
+ orkestrate extension validate
35
+ ```
36
+
37
+ ## Paths
38
+
39
+ ```text
40
+ <workspace>/.orkestrate/packs/<id>/
41
+ <workspace>/.orkestrate/pack-homes/<id>/home/
42
+ ```
43
+
44
+ Bundled packs: `coding`, `extension-builder`. Registry: `https://orkestrate.space/api/registry`.
45
+
46
+ ## Rules
47
+
48
+ 1. Say **pack**, not legacy **profile**.
49
+ 2. Launch = **new terminal**; sessions live in the pack home.
50
+ 3. Do not promise Pi/Claude adapters, CLI registry submit, or agent-generated slices (roadmap).
51
+ 4. Windows launch needs **Windows Terminal** (`wt` on PATH).
52
+
53
+ ## More context
54
+
55
+ - Index: https://orkestrate.space/llms.txt
56
+ - Docs: https://orkestrate.space/docs
@@ -0,0 +1,35 @@
1
+ # Contributing
2
+
3
+ Orkestrate is early. Keep contributions small and aligned with the OpenCode-first
4
+ profile workbench.
5
+
6
+ Roadmap: [../plan.md](../plan.md) (work phase-by-phase with maintainers).
7
+
8
+ ## Setup
9
+
10
+ From this directory (`orkestrate/`):
11
+
12
+ ```sh
13
+ bun install
14
+ bun run check
15
+ ```
16
+
17
+ Use Bun only unless a maintainer explicitly approves another package manager.
18
+
19
+ ## Product boundary
20
+
21
+ ```text
22
+ specialized agent = profile + harness adapter + extensions
23
+ ```
24
+
25
+ - OpenCode is the only supported harness today.
26
+ - Profiles are the main user-facing primitive.
27
+ - Extensions can register adapters; marketplace flows are partial.
28
+ - Do not add fake harness support or undocumented CLI commands.
29
+
30
+ ## Pull requests
31
+
32
+ - Keep changes focused.
33
+ - Update docs when behavior changes.
34
+ - Run `bun run typecheck`.
35
+ - Do not commit `.orkestrate/`, `node_modules/`, `.env*`, or local session artifacts.
package/README.md CHANGED
@@ -1,79 +1,59 @@
1
- # orkestrate
1
+ # Orkestrate
2
2
 
3
- **The CLI for [Orkestrate](https://orkestrate.space) the coordination layer for autonomous AI coding agents.**
3
+ Browse, use, and share **specialized harnesses** for **agent packs**. Install packs from the registry, launch OpenCode in a new terminal with an isolated pack home — your personal OpenCode config stays untouched.
4
4
 
5
- Connect your AI coding tools (Claude Code, OpenCode, Cursor, Windsurf, Codex) to Orkestrate in seconds.
6
-
7
- ---
8
-
9
- ## Install
10
-
11
- ```bash
12
- # Global install
13
- bun install -g orkestrate
14
-
15
- # Or run without installing
16
- bunx orkestrate login
5
+ ```text
6
+ pack = pack.yaml + harnesses/opencode/
7
+ launch = new terminal + .orkestrate/pack-homes/<packId>/
17
8
  ```
18
9
 
19
- ## Quick Start
10
+ ## Install
20
11
 
21
- ```bash
22
- # 1. Authenticate
23
- orkestrate login
12
+ Requires [Bun](https://bun.sh) 1.3+.
24
13
 
25
- # 2. Connect your AI tool
26
- orkestrate connect claude
14
+ ```sh
15
+ npm install -g orkestrate
16
+ # or: bun install -g orkestrate
27
17
 
28
- # 3. Done. Start coding.
18
+ orkestrate doctor
19
+ orkestrate registry install coding
20
+ orkestrate
29
21
  ```
30
22
 
31
23
  ## Commands
32
24
 
33
- | Command | Description |
34
- |---|---|
35
- | `orkestrate login` | Authenticate via browser OAuth |
36
- | `orkestrate logout` | Clear stored credentials |
37
- | `orkestrate connect <tool>` | Configure MCP for an AI tool |
38
- | `orkestrate status` | Show team coordination state |
39
- | `orkestrate workspace list` | List all workspaces |
40
- | `orkestrate workspace switch <name>` | Switch active workspace |
41
- | `orkestrate workspace create <name> <repo-url>` | Create new workspace |
42
- | `orkestrate init` | Initialize Orkestrate in current project |
43
- | `orkestrate whoami` | Show current auth & config |
25
+ | Command | Purpose |
26
+ |---------|---------|
27
+ | `orkestrate` | OpenTUI workbench |
28
+ | `orkestrate pack list\|install\|create\|validate` | Packs |
29
+ | `orkestrate run launch <id>` | New terminal OpenCode |
30
+ | `orkestrate registry list\|search\|install` | Catalog |
31
+ | `orkestrate doctor` | Harness health |
44
32
 
45
- ### Supported Tools
33
+ ## For coding agents
46
34
 
47
- - **Claude Code** — `orkestrate connect claude`
48
- - **OpenCode** `orkestrate connect opencode`
49
- - **Cursor** — `orkestrate connect cursor`
50
- - **Windsurf** — `orkestrate connect windsurf`
51
- - **Codex** — `orkestrate connect codex`
35
+ - Machine index: [llms.txt](https://orkestrate.space/llms.txt)
36
+ - Instructions: [AGENTS.md](./AGENTS.md) (also at https://orkestrate.space/agents.md)
52
37
 
53
- ## How It Works
38
+ ## Publish to npm
54
39
 
55
- 1. **`orkestrate login`** opens your browser for OAuth authentication, then stores credentials locally in `~/.config/orkestrate/`.
40
+ From this directory, with `NPM_TOKEN` or `npm login`:
56
41
 
57
- 2. **`orkestrate connect <tool>`** auto-detects your AI coding tool and writes the MCP server configuration pointing to `https://orkestrate.space/api/mcp`.
58
-
59
- 3. Your AI tools can now coordinate — sharing state, claiming file scopes, and avoiding collisions — all through the Orkestrate MCP protocol.
60
-
61
- ## What This CLI Does NOT Do
62
-
63
- - ❌ Not an AI agent — doesn't write or edit code
64
- - ❌ Not a task runner — doesn't execute prompts
65
- - ❌ Not a git wrapper — doesn't commit or push
66
- - ❌ Not a proxy — MCP traffic goes directly from your tool to Orkestrate
67
-
68
- The CLI is purely **setup, wiring, and observability**. The coordination magic happens through MCP.
42
+ ```sh
43
+ bun run check
44
+ npm publish --access public
45
+ ```
69
46
 
70
- ---
47
+ CI: tag `orkestrate-v*` or run the **Publish npm** workflow (set repo secret `NPM_TOKEN`).
71
48
 
72
- ## Links
49
+ ## Development
73
50
 
74
- - **Website**: [orkestrate.space](https://orkestrate.space)
75
- - **GitHub**: [github.com/system1970/Orkestrate](https://github.com/system1970/Orkestrate)
51
+ ```sh
52
+ bun install
53
+ bun run dev
54
+ bun run check
55
+ ```
76
56
 
77
- ---
57
+ Docs: [pack-authoring](docs/pack-authoring.md), [getting-started](docs/getting-started.md).
78
58
 
79
- © 2026 Orkestrate. Built for the autonomous age.
59
+ MIT see [LICENSE](LICENSE).
package/SECURITY.md ADDED
@@ -0,0 +1,24 @@
1
+ # Security
2
+
3
+ Orkestrate launches local agent harnesses and may pass prompts, skills, MCP
4
+ definitions, paths, and extension code into those harnesses.
5
+
6
+ ## Trust model (v0)
7
+
8
+ - Intended for **local, trusted** use on your machine.
9
+ - **OpenCode** is the executing harness for launch builds.
10
+ - **Orkestrate extensions** load via dynamic `import()` in the same process as
11
+ the CLI — treat them as trusted code (no sandbox).
12
+ - **OpenCode plugins** are separate; they run inside OpenCode per
13
+ [OpenCode plugin docs](https://opencode.ai/docs/plugins/).
14
+ - Do not commit secrets. Keep `.env*` and `.orkestrate/` out of git.
15
+
16
+ ## Reporting
17
+
18
+ Open a private security advisory or email maintainers with:
19
+
20
+ - affected version or commit
21
+ - reproduction steps
22
+ - impact (data exposure, arbitrary execution, etc.)
23
+
24
+ Do not post exploit details publicly before maintainers respond.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ import "../src/cli/index.ts";
@@ -0,0 +1,119 @@
1
+ # Concepts
2
+
3
+ Orkestrate is an open workbench for specialized AI agent profiles.
4
+
5
+ The core loop is simple:
6
+
7
+ ```text
8
+ browse profile -> install profile -> inspect requirements -> launch harness
9
+ ```
10
+
11
+ ## Profile
12
+
13
+ A profile is a packaged agent identity.
14
+
15
+ It defines:
16
+
17
+ - what the agent does;
18
+ - which harness it runs on;
19
+ - model defaults;
20
+ - prompt and operating workflow;
21
+ - tools and permissions;
22
+ - skills or other context resources;
23
+ - harness-specific launch configuration.
24
+
25
+ Profiles are the user-facing primitive. A user should be able to choose
26
+ `math-researcher`, `proof-referee`, `coding`, or `frontend-polisher` without
27
+ understanding every config file behind it.
28
+
29
+ Current profiles are JSON files stored in:
30
+
31
+ ```text
32
+ orkestrate/profiles/ bundled seed + catalog templates
33
+ ~/.orkestrate/profiles/ global installed profiles
34
+ <workspace>/.orkestrate/profiles/ workspace installed profiles
35
+ ```
36
+
37
+ ## Harness
38
+
39
+ A harness is the runtime that actually runs the agent.
40
+
41
+ Examples:
42
+
43
+ - OpenCode
44
+ - Claude Code
45
+ - Codex
46
+ - future domain-specific harnesses
47
+
48
+ The harness owns the agent loop, terminal UI, tool execution, model calls, and
49
+ session behavior. Orkestrate does not replace the harness. It prepares a profile
50
+ for the harness and launches it.
51
+
52
+ ## Adapter
53
+
54
+ An adapter teaches Orkestrate how to launch profiles for one harness.
55
+
56
+ An adapter can:
57
+
58
+ - detect whether a harness is installed;
59
+ - report version/status;
60
+ - translate a profile into harness config;
61
+ - prepare environment variables and launch args;
62
+ - avoid mutating global harness configuration.
63
+
64
+ Adapters are not a separate ecosystem category. An adapter is one contribution
65
+ type inside an extension.
66
+
67
+ For the launch build, the OpenCode adapter is built into the package. The
68
+ future extension system should let harness makers ship adapter extensions.
69
+
70
+ ## Extension
71
+
72
+ An extension is an installable package of contributions.
73
+
74
+ It may contribute:
75
+
76
+ - profiles;
77
+ - harness adapters;
78
+ - skills;
79
+ - MCP server templates;
80
+ - commands;
81
+ - permission policies;
82
+ - docs and examples.
83
+
84
+ This is the ecosystem primitive. A profile pack, a Lean skill pack, a Supabase
85
+ MCP pack, and an OpenCode adapter are all extensions with different
86
+ contributions.
87
+
88
+ ## Skill
89
+
90
+ A skill is reusable domain or workflow knowledge for an agent.
91
+
92
+ In the current OpenCode adapter, profile skills are prototype local references:
93
+ Orkestrate looks for matching `SKILL.md` files and injects their text into the
94
+ profile prompt. Native OpenCode skills are disabled for the generated profile.
95
+
96
+ That is enough for the launch demo, but not the final portability model. The
97
+ future model should let extension packs contribute pinned or bundled skills.
98
+
99
+ ## Catalog
100
+
101
+ The catalog merges:
102
+
103
+ - bundled JSON under `orkestrate/profiles/`
104
+ - approved items from `orkestrate.space/api/registry` when online
105
+
106
+ Install copies a template into `~/.orkestrate/profiles/` or the workspace store.
107
+
108
+ ## Session And Config
109
+
110
+ Orkestrate currently uses `.orkestrate/` for workspace-local profile installs
111
+ and generated harness launch artifacts.
112
+
113
+ For OpenCode launches, Orkestrate creates a temporary per-launch home/config
114
+ inside `.orkestrate/sessions/...`, writes generated OpenCode config, launches
115
+ OpenCode in the real current directory, and cleans the generated launch folder
116
+ when the harness exits.
117
+
118
+ This should be treated as isolated harness launch config, not long-lived
119
+ Orkestrate-owned session management.
@@ -0,0 +1,82 @@
1
+ # Demo: extension-builder → new pack → launch
2
+
3
+ This is the v0 “agents build agents” path using only the CLI (no registry).
4
+
5
+ ## Prerequisites
6
+
7
+ - Bun 1.3+
8
+ - [OpenCode](https://opencode.ai) on `PATH` (`opencode --version`)
9
+ - Windows Terminal recommended on Windows
10
+
11
+ ## Steps
12
+
13
+ From the `orkestrate/` package:
14
+
15
+ ```sh
16
+ bun install
17
+ bun run src/cli/index.ts doctor
18
+ ```
19
+
20
+ ### 1. Install builder pack (if needed)
21
+
22
+ ```sh
23
+ bun run src/cli/index.ts pack install extension-builder
24
+ # or: bun run src/cli/index.ts pack install coding
25
+ ```
26
+
27
+ ### 2. Scaffold a new pack from template
28
+
29
+ ```sh
30
+ bun run src/cli/index.ts pack create demo-agent \
31
+ --from coding \
32
+ --description "Demo pack created by the extension-builder flow"
33
+ bun run src/cli/index.ts pack validate demo-agent
34
+ ```
35
+
36
+ This writes `.orkestrate/packs/demo-agent/` in your current working directory.
37
+
38
+ ### 3. Launch from CLI
39
+
40
+ ```sh
41
+ bun run src/cli/index.ts run launch demo-agent
42
+ ```
43
+
44
+ A new terminal tab opens OpenCode. Create a session, then exit OpenCode.
45
+
46
+ ### 4. Prove session persistence
47
+
48
+ ```sh
49
+ bun run src/cli/index.ts run launch demo-agent
50
+ ```
51
+
52
+ The second window should list the session from step 3 (same pack home under
53
+ `.orkestrate/pack-homes/demo-agent/`).
54
+
55
+ ### 5. Launch via TUI
56
+
57
+ ```sh
58
+ bun run dev
59
+ ```
60
+
61
+ Select `demo-agent` → **Enter**. Status should show **running**, then **idle**
62
+ after you close the OpenCode window.
63
+
64
+ ## Optional: run the scripted check
65
+
66
+ ```sh
67
+ bun run scripts/demo-pack-builder.ts
68
+ ```
69
+
70
+ This runs steps 2–3 non-interactively (does not open OpenCode UI for you).
71
+
72
+ ## Using extension-builder in OpenCode
73
+
74
+ For the full meta flow, launch the builder pack and ask it to author a pack:
75
+
76
+ ```sh
77
+ bun run src/cli/index.ts run launch extension-builder
78
+ ```
79
+
80
+ In that OpenCode session, use the bundled `orkestrate-pack-author` skill and CLI
81
+ commands (`pack create`, `pack validate`, `run launch`) from a shell in your
82
+ real repo cwd.
@@ -0,0 +1,57 @@
1
+ # Harness Adapters
2
+
3
+ Harness Adapters are the runtime bridges that translate high-level Orkestrate agent profiles into execution configurations for external CLI or TUI engines. By building a harness adapter, you enable Orkestrate to launch and control entirely new agent environments.
4
+
5
+ ## The Harness Adapter Interface
6
+
7
+ To register a new runtime engine, your extension must provide an implementation of the `HarnessAdapter` interface.
8
+
9
+ ```typescript
10
+ export interface HarnessAdapter {
11
+ id: string;
12
+ name: string;
13
+
14
+ capabilities: {
15
+ mcp: boolean;
16
+ systemPrompt: boolean;
17
+ skills: boolean;
18
+ modelSelection: boolean;
19
+ };
20
+
21
+ detect(): Promise<HarnessStatus>;
22
+
23
+ prepareLaunch(
24
+ profile: Profile,
25
+ context: LaunchContext
26
+ ): Promise<{
27
+ config: HarnessLaunchConfig;
28
+ cleanup: () => Promise<void>;
29
+ }>;
30
+ }
31
+ ```
32
+
33
+ ## Core Responsibilities
34
+
35
+ An adapter must handle three primary phases of the agent lifecycle: **Detection**, **Environment Preparation**, and **Cleanup**.
36
+
37
+ ### 1. Detection
38
+
39
+ Before a profile can be launched, Orkestrate asks the adapter if the target harness is available on the user's system. The `detect()` method typically spawns a synchronous subprocess (e.g., `opencode --version`) to verify installation and report the status.
40
+
41
+ ### 2. Environment Preparation
42
+
43
+ The `prepareLaunch()` method is where the heavy lifting occurs. When a user requests to run a profile, the adapter must convert the profile's declarative manifest into something the target harness understands.
44
+
45
+ Common tasks in this phase include:
46
+ - **Session Isolation**: Spawning unique session root folders (e.g., `.orkestrate/sessions/<uuid>`).
47
+ - **Home Hijacking**: Redirecting environment variables like `USERPROFILE`, `HOME`, and `XDG_CONFIG_HOME` to prevent the agent from modifying the user's global settings.
48
+ - **Dynamic Configuration**: Converting Orkestrate tool policies and MCP server definitions into the native configuration format of the harness (e.g., generating an `opencode.json` file).
49
+ - **Prompt Construction**: Merging profile-scoped `SKILL.md` files into a unified system instruction set.
50
+
51
+ ### 3. Cleanup
52
+
53
+ To prevent stale environments and dangling files, `prepareLaunch` must return an asynchronous `cleanup()` callback. Orkestrate guarantees that this callback is invoked recursively upon process exit, ensuring temporary session folders are properly removed.
54
+
55
+ ## Example: The OpenCode Adapter
56
+
57
+ The bundled `opencode-adapter` demonstrates the full capability of the adapter contract. It handles deep session isolation, dynamically parses tool constraints into OpenCode permissions (`read`, `edit`, `bash`, `skill`), and manages temporary execution environments.
@@ -0,0 +1,49 @@
1
+ # Architecture
2
+
3
+ The Orkestrate extension system is designed to dynamically discover, load, and activate modules during the CLI bootstrapping phase. This approach ensures that extensions are isolated and can be injected without modifying the core codebase.
4
+
5
+ ## Discovery and Load Paths
6
+
7
+ When Orkestrate starts, the `loadExtensions()` routine scans specific directories for executable extensions. The resolution order is strictly prioritized:
8
+
9
+ 1. **Bundled Extensions**: `<package-root>/extensions/`
10
+ First-party extensions that ship with Orkestrate (e.g., `opencode-adapter`).
11
+ 2. **Global Extensions**: `~/.orkestrate/extensions/`
12
+ User-level extensions installed globally across all projects.
13
+ 3. **Workspace Extensions**: `<project-cwd>/.orkestrate/extensions/`
14
+ Repository-specific extensions designed for a particular workspace.
15
+
16
+ If multiple extensions with the same ID are discovered, the loader currently prioritizes them based on the loading sequence, allowing workspace extensions to override global ones.
17
+
18
+ ## The Activation Hook
19
+
20
+ During startup, Orkestrate filters the discovered directories for valid entry points (`index.ts`, `index.js`, or a valid `package.json` main entry). Once located, it dynamically imports the module and invokes its `activate` method.
21
+
22
+ ### The Extension Context
23
+
24
+ The `activate` method receives an `ExtensionContext` object. This context acts as the bridge between your extension and the Orkestrate global registry.
25
+
26
+ ```typescript
27
+ export interface ExtensionContext {
28
+ registerAdapter(harness: string, adapter: HarnessAdapter): void;
29
+ }
30
+ ```
31
+
32
+ Through this context, your extension can safely register its capabilities into the runtime before any profiles are launched.
33
+
34
+ ### Registering an adapter
35
+
36
+ The harness string in a profile JSON must match the key passed to
37
+ `registerAdapter`:
38
+
39
+ ```typescript
40
+ activate(ctx) {
41
+ ctx.registerAdapter("opencode", new OpenCodeAdapter());
42
+ }
43
+ ```
44
+
45
+ ## Lifecycle Management & Security
46
+
47
+ ### Current Limitations
48
+ - **Deactivation**: Currently, the system lacks a formal `deactivate()` hook. Extensions should avoid spawning orphaned background processes or leaving long-running listeners attached without explicit cleanup mechanisms provided during launch execution.
49
+ - **Sandboxing**: Extensions are executed via native dynamic imports (`import()`) within the same V8 isolate as the Orkestrate CLI. As such, they inherit the exact same filesystem and network permissions as the host process. Always verify third-party extension code before installation.
@@ -0,0 +1,26 @@
1
+ # Extensions
2
+
3
+ Extensions register runtime capabilities when the CLI starts. Today the main
4
+ contribution type is a **harness adapter**.
5
+
6
+ ## OrkExtension
7
+
8
+ ```typescript
9
+ export interface OrkExtension {
10
+ id: string;
11
+ name: string;
12
+ version: string;
13
+ activate(ctx: ExtensionContext): void | Promise<void>;
14
+ }
15
+ ```
16
+
17
+ ## Discovery paths
18
+
19
+ 1. `<package>/extensions/` — bundled (e.g. `opencode-adapter`)
20
+ 2. `~/.orkestrate/extensions/`
21
+ 3. `<workspace>/.orkestrate/extensions/`
22
+
23
+ ## Docs
24
+
25
+ - [Architecture & lifecycle](./architecture.md) — load order, `ExtensionContext`, security
26
+ - [Harness adapters](./adapters.md) — `HarnessAdapter` contract and OpenCode example
@@ -0,0 +1,85 @@
1
+ # Getting Started
2
+
3
+ Orkestrate is a Bun CLI and OpenTUI workbench for **packs** (OpenCode-first).
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ cd orkestrate
9
+ bun install
10
+ ```
11
+
12
+ ## Run the workbench
13
+
14
+ ```sh
15
+ bun run dev
16
+ ```
17
+
18
+ On first launch with no packs installed, the welcome wizard installs `coding`.
19
+
20
+ ## Check harness status
21
+
22
+ ```sh
23
+ bun run src/cli/index.ts doctor
24
+ ```
25
+
26
+ ## Create a pack
27
+
28
+ ```sh
29
+ bun run src/cli/index.ts pack create my-agent --from coding
30
+ bun run src/cli/index.ts pack validate my-agent
31
+ ```
32
+
33
+ Templates: `coding`, `extension-builder` (use `--from <name>`).
34
+
35
+ ## Install packs
36
+
37
+ Bundled:
38
+
39
+ ```sh
40
+ bun run src/cli/index.ts pack install coding
41
+ bun run src/cli/index.ts pack install extension-builder --global
42
+ ```
43
+
44
+ Registry (GitHub-backed, requires network):
45
+
46
+ ```sh
47
+ bun run src/cli/index.ts registry list
48
+ bun run src/cli/index.ts registry search <query>
49
+ bun run src/cli/index.ts registry install <slug>
50
+ ```
51
+
52
+ In the TUI: `b` to browse bundled + registry, `Enter` to install.
53
+
54
+ ## Launch a pack
55
+
56
+ CLI:
57
+
58
+ ```sh
59
+ bun run src/cli/index.ts run launch coding
60
+ ```
61
+
62
+ TUI: select a pack → `Enter` or `l`.
63
+
64
+ Orkestrate opens a **new terminal** running OpenCode with:
65
+
66
+ - Your real repo as `cwd`
67
+ - Config from the pack harness slice
68
+ - Session data under `.orkestrate/pack-homes/<pack-id>/home/`
69
+
70
+ Your normal OpenCode config is not modified.
71
+
72
+ ## Where files live
73
+
74
+ ```text
75
+ <workspace>/.orkestrate/packs/<id>/ # pack source
76
+ <workspace>/.orkestrate/pack-homes/<id>/ # persistent OpenCode home
77
+ ~/.orkestrate/packs/<id>/ # global install (optional)
78
+ ```
79
+
80
+ Bundled catalog: `orkestrate/packs/`.
81
+
82
+ ## Next
83
+
84
+ - [Pack authoring](pack-authoring.md)
85
+ - [Extension-builder demo](demo-extension-builder.md)