@loka1/pi-orchestra 0.0.0-stage → 0.6.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.
- package/CHANGELOG.md +313 -0
- package/LICENSE +21 -0
- package/README.md +662 -2
- package/assets/preview.html +226 -0
- package/assets/preview.png +0 -0
- package/config/orchestra.json.example +35 -0
- package/config/templates/review-squad.md +11 -0
- package/extensions/lib/agents.ts +110 -0
- package/extensions/lib/chat.ts +171 -0
- package/extensions/lib/commands.ts +118 -0
- package/extensions/lib/config.ts +236 -0
- package/extensions/lib/format.ts +663 -0
- package/extensions/lib/git.ts +99 -0
- package/extensions/lib/log.ts +233 -0
- package/extensions/lib/mail.ts +115 -0
- package/extensions/lib/metrics.ts +365 -0
- package/extensions/lib/providers.ts +355 -0
- package/extensions/lib/redact.ts +57 -0
- package/extensions/lib/retry.ts +61 -0
- package/extensions/lib/state.ts +694 -0
- package/extensions/lib/templates.ts +153 -0
- package/extensions/lib/types.ts +171 -0
- package/extensions/lib/worker.ts +450 -0
- package/extensions/orchestra.ts +3043 -0
- package/extensions/ui/browse.ts +497 -0
- package/extensions/ui/join.ts +289 -0
- package/package.json +56 -4
- package/skills/orchestra/SKILL.md +86 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/orchestra` argument completion.
|
|
3
|
+
*
|
|
4
|
+
* Lives here rather than in the extension so the command table is one list that
|
|
5
|
+
* the help text, the completer and the tests all read.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { AutocompleteItem } from "@earendil-works/pi-tui";
|
|
9
|
+
import { fit } from "./format.ts";
|
|
10
|
+
import { shortId } from "./format.ts";
|
|
11
|
+
import type { OrchestraState } from "./types.ts";
|
|
12
|
+
|
|
13
|
+
export interface OrchestraCommand {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
/** What the argument is, so the completer knows what to suggest. */
|
|
17
|
+
takes: "none" | "dispatch" | "task" | "run" | "either" | "template" | "free";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ORCHESTRA_COMMANDS: OrchestraCommand[] = [
|
|
21
|
+
{ name: "browse", description: "Interactive list of tasks, workers and runs", takes: "free" },
|
|
22
|
+
{ name: "join", description: "Open a worker's conversation and type into it", takes: "dispatch" },
|
|
23
|
+
{ name: "chat", description: "The same conversation as text", takes: "dispatch" },
|
|
24
|
+
{ name: "open", description: "Detail of one task, worker or run", takes: "either" },
|
|
25
|
+
{ name: "status", description: "Run summary, tasks and workers", takes: "none" },
|
|
26
|
+
{ name: "tasks", description: "Task table for the active run", takes: "none" },
|
|
27
|
+
{ name: "workers", description: "Worker table for the active run", takes: "none" },
|
|
28
|
+
{ name: "read", description: "Worker transcript (tail)", takes: "dispatch" },
|
|
29
|
+
{ name: "watch", description: "Pin a worker's transcript into the widget", takes: "dispatch" },
|
|
30
|
+
{ name: "unwatch", description: "Unpin the transcript", takes: "none" },
|
|
31
|
+
{ name: "hide", description: "Hide the widget and status line in this project", takes: "none" },
|
|
32
|
+
{ name: "show", description: "Bring the widget back (or force it with always/off)", takes: "free" },
|
|
33
|
+
{ name: "stop", description: "Stop a worker", takes: "dispatch" },
|
|
34
|
+
{ name: "retry", description: "Repair dispatch seeded with the failure", takes: "dispatch" },
|
|
35
|
+
{ name: "resume", description: "Continue a worker in its own session", takes: "dispatch" },
|
|
36
|
+
{ name: "diff", description: "git diff since that worker started", takes: "dispatch" },
|
|
37
|
+
{ name: "find", description: "Filter tasks, workers and runs", takes: "free" },
|
|
38
|
+
{ name: "grep", description: "Search every worker transcript", takes: "free" },
|
|
39
|
+
{ name: "runs", description: "List runs, newest first", takes: "none" },
|
|
40
|
+
{ name: "use", description: "Make a run the active one", takes: "run" },
|
|
41
|
+
{ name: "templates", description: "List run templates", takes: "none" },
|
|
42
|
+
{ name: "template", description: "Start a run from a template", takes: "template" },
|
|
43
|
+
{ name: "broadcast", description: "Message every live worker", takes: "free" },
|
|
44
|
+
{ name: "metrics", description: "Cost and turns for the active run", takes: "none" },
|
|
45
|
+
{ name: "report", description: "Write exports/<runId>.md", takes: "none" },
|
|
46
|
+
{ name: "export", description: "Export the run as JSONL or JSON", takes: "free" },
|
|
47
|
+
{ name: "budget", description: "Lift a pause and set the run budget", takes: "free" },
|
|
48
|
+
{ name: "prune", description: "Delete old runs, logs and archives", takes: "free" },
|
|
49
|
+
{ name: "reset", description: "Archive and clear this project's runs, tasks and workers", takes: "none" },
|
|
50
|
+
{ name: "archive", description: "Archive finished runs", takes: "free" },
|
|
51
|
+
{ name: "questions", description: "Pending gates", takes: "none" },
|
|
52
|
+
{ name: "config", description: "Show the resolved configuration", takes: "none" },
|
|
53
|
+
{ name: "back", description: "Return to the coordinator session", takes: "none" },
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
export interface CompletionContext {
|
|
58
|
+
state?: OrchestraState;
|
|
59
|
+
templates?: Array<{ name: string; tasks: number }>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Tab-completion for `/orchestra …`: commands, then live ids for the argument. */
|
|
63
|
+
export function completeOrchestraArgument(prefix: string, context: CompletionContext = {}): AutocompleteItem[] | null {
|
|
64
|
+
const match = /^(\S*)(?:\s+(.*))?$/.exec(prefix);
|
|
65
|
+
const head = match?.[1] ?? "";
|
|
66
|
+
const rest = match?.[2];
|
|
67
|
+
|
|
68
|
+
if (rest === undefined) {
|
|
69
|
+
const items = ORCHESTRA_COMMANDS.filter((command) => command.name.startsWith(head)).map((command) => ({
|
|
70
|
+
value: command.name,
|
|
71
|
+
label: command.name,
|
|
72
|
+
description: command.description,
|
|
73
|
+
}));
|
|
74
|
+
return items.length > 0 ? items : null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const command = ORCHESTRA_COMMANDS.find((entry) => entry.name === head);
|
|
78
|
+
if (!command || command.takes === "none" || command.takes === "free") return null;
|
|
79
|
+
const state = context.state;
|
|
80
|
+
if (!state && command.takes !== "template") return null;
|
|
81
|
+
|
|
82
|
+
const partial = rest.trim().toLowerCase();
|
|
83
|
+
const items: AutocompleteItem[] = [];
|
|
84
|
+
const add = (id: string, label: string, description: string) => {
|
|
85
|
+
// Match the id, the status/model part of the label and the title, so both
|
|
86
|
+
// "dispatch_9c4e" and "port" find the same row.
|
|
87
|
+
const haystack = `${id} ${label} ${description}`.toLowerCase();
|
|
88
|
+
if (partial && !haystack.includes(partial)) return;
|
|
89
|
+
items.push({ value: id, label, description });
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
if (state && (command.takes === "dispatch" || command.takes === "either")) {
|
|
93
|
+
for (const dispatch of Object.values(state.dispatches)) {
|
|
94
|
+
const task = dispatch.taskId ? state.tasks[dispatch.taskId] : undefined;
|
|
95
|
+
add(
|
|
96
|
+
dispatch.id,
|
|
97
|
+
`${shortId(dispatch.id)} ${dispatch.agent} ${dispatch.status}`,
|
|
98
|
+
task?.title ?? fit(dispatch.spec.split("\n")[0] ?? "", 60),
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (state && (command.takes === "task" || command.takes === "either")) {
|
|
103
|
+
for (const task of Object.values(state.tasks)) {
|
|
104
|
+
add(task.id, `${shortId(task.id)} ${task.status}`, task.title);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (state && command.takes === "run") {
|
|
108
|
+
for (const run of Object.values(state.runs)) {
|
|
109
|
+
add(run.id, `${shortId(run.id)} ${run.status}`, run.name ?? run.goal ?? "");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (command.takes === "template") {
|
|
113
|
+
for (const template of context.templates ?? []) {
|
|
114
|
+
add(template.name, template.name, `${template.tasks} task(s)`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return items.length > 0 ? items : null;
|
|
118
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration loading.
|
|
3
|
+
*
|
|
4
|
+
* Merge order (later wins):
|
|
5
|
+
* 1. built-in defaults
|
|
6
|
+
* 2. ~/.pi/agent/orchestra.json (global)
|
|
7
|
+
* 3. <project>/.pi/orchestra.json (project-local)
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
11
|
+
import { homedir } from "node:os";
|
|
12
|
+
import { join, resolve } from "node:path";
|
|
13
|
+
import type { WidgetMode } from "./types.ts";
|
|
14
|
+
|
|
15
|
+
export type SessionMode = "no-session" | "session";
|
|
16
|
+
|
|
17
|
+
export interface AgentOverride {
|
|
18
|
+
model?: string;
|
|
19
|
+
/** Provider that serves `model`, when the bare id is ambiguous. */
|
|
20
|
+
provider?: string;
|
|
21
|
+
thinking?: string;
|
|
22
|
+
tools?: string[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface OrchestraConfig {
|
|
26
|
+
/** Maximum number of concurrently running workers. */
|
|
27
|
+
maxConcurrency: number;
|
|
28
|
+
/** Agent used when a dispatch does not name one. */
|
|
29
|
+
defaultAgent: string;
|
|
30
|
+
/** Let workers inherit the coordinator's model/thinking when the agent has none. */
|
|
31
|
+
inheritModel: boolean;
|
|
32
|
+
/** Hard limit for one worker before it is stopped (0 = no limit). */
|
|
33
|
+
timeoutMs: number;
|
|
34
|
+
/**
|
|
35
|
+
* How `timeoutMs` is measured: "total" from spawn (default), or "idle" — the
|
|
36
|
+
* timer restarts on every worker event, so only silence that long stops it.
|
|
37
|
+
*/
|
|
38
|
+
timeoutMode: "total" | "idle";
|
|
39
|
+
/** Keep a settled worker's process alive so the user can keep chatting with it. */
|
|
40
|
+
keepOpen: boolean;
|
|
41
|
+
/** Wake the coordinator when a worker settles. */
|
|
42
|
+
notifyOnSettle: boolean;
|
|
43
|
+
/** Override the pi executable used to spawn workers. */
|
|
44
|
+
workerCommand?: string;
|
|
45
|
+
/** Where state, logs and mail live. Defaults to <cwd>/.pi/orchestra. */
|
|
46
|
+
stateDir?: string;
|
|
47
|
+
/** Give workers a persistent session so they can be resumed with `pi --resume`. */
|
|
48
|
+
sessionMode: SessionMode;
|
|
49
|
+
/**
|
|
50
|
+
* Start workers with `--no-extensions` plus this extension only. Keeps workers free of
|
|
51
|
+
* MCP servers, interactive gates and other extensions the coordinator has loaded.
|
|
52
|
+
*/
|
|
53
|
+
workerIsolation: boolean;
|
|
54
|
+
/** Default cost ceiling per worker in USD (0 = off). */
|
|
55
|
+
budgetUsdPerWorker: number;
|
|
56
|
+
/** Cost ceiling for a whole run in USD; once reached, no new workers start (0 = off). */
|
|
57
|
+
budgetUsdPerRun: number;
|
|
58
|
+
/**
|
|
59
|
+
* What to do when a ceiling is reached: "stop" kills the workers, "ask" only
|
|
60
|
+
* pauses the run and waits for `orchestra action=budget usd=<n>`.
|
|
61
|
+
*/
|
|
62
|
+
budgetAction: "stop" | "ask";
|
|
63
|
+
/** Wall-clock ceiling per worker: wrap up, then stop (0 = off, `timeoutMs` still applies). */
|
|
64
|
+
budgetMsPerWorker: number;
|
|
65
|
+
/** Extra attempts after a failed worker (0 = off). */
|
|
66
|
+
retries: number;
|
|
67
|
+
/** Delay before the first retry; doubles per attempt, capped at 5 minutes. */
|
|
68
|
+
retryBackoffMs: number;
|
|
69
|
+
/** Grace before a worker that exceeded `budgetMsPerWorker` is stopped. */
|
|
70
|
+
budgetGraceMs: number;
|
|
71
|
+
/** Silence (no events) before a worker is flagged as stalled; 0 = off. */
|
|
72
|
+
stallMs: number;
|
|
73
|
+
/** What to do about a stalled worker. */
|
|
74
|
+
stallAction: "notify" | "abort";
|
|
75
|
+
/** Maximum rows in the always-on widget (hint row excluded). */
|
|
76
|
+
widgetMaxLines: number;
|
|
77
|
+
/** Show settled/done rows in the widget instead of collapsing them into a counter. */
|
|
78
|
+
widgetShowSettled: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* How much of the UI is mounted: `auto` (default) shows the widget only while
|
|
81
|
+
* work is live, `always` keeps it whenever there is a run, `off` removes both the
|
|
82
|
+
* widget and the status line. `/orchestra hide|show` overrides this per project.
|
|
83
|
+
*/
|
|
84
|
+
widget: WidgetMode;
|
|
85
|
+
/**
|
|
86
|
+
* A run whose work is finished stops being the current run once nothing in it has
|
|
87
|
+
* moved for this many hours (0 = never). The run itself is kept — `/orchestra runs`
|
|
88
|
+
* and `/orchestra use <run>` still reach it.
|
|
89
|
+
*/
|
|
90
|
+
staleRunHours: number;
|
|
91
|
+
/**
|
|
92
|
+
* Extra extension files (or `npm:`/`git:` package specs) an isolated worker
|
|
93
|
+
* should load — typically a provider package. Discovered automatically when
|
|
94
|
+
* possible; this list is for the rest.
|
|
95
|
+
*/
|
|
96
|
+
providerExtensions: string[];
|
|
97
|
+
/** Per-agent overrides applied on top of the agent markdown frontmatter. */
|
|
98
|
+
agents: Record<string, AgentOverride>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const DEFAULT_CONFIG: OrchestraConfig = {
|
|
102
|
+
maxConcurrency: 4,
|
|
103
|
+
defaultAgent: "worker",
|
|
104
|
+
inheritModel: true,
|
|
105
|
+
timeoutMs: 15 * 60 * 1000,
|
|
106
|
+
timeoutMode: "total",
|
|
107
|
+
keepOpen: false,
|
|
108
|
+
notifyOnSettle: true,
|
|
109
|
+
sessionMode: "no-session",
|
|
110
|
+
workerIsolation: true,
|
|
111
|
+
budgetUsdPerWorker: 0,
|
|
112
|
+
budgetUsdPerRun: 0,
|
|
113
|
+
budgetMsPerWorker: 0,
|
|
114
|
+
budgetGraceMs: 60_000,
|
|
115
|
+
stallMs: 600_000,
|
|
116
|
+
stallAction: "notify",
|
|
117
|
+
budgetAction: "stop",
|
|
118
|
+
retries: 0,
|
|
119
|
+
retryBackoffMs: 2000,
|
|
120
|
+
widgetMaxLines: 8,
|
|
121
|
+
widgetShowSettled: false,
|
|
122
|
+
widget: "auto",
|
|
123
|
+
staleRunHours: 12,
|
|
124
|
+
providerExtensions: [],
|
|
125
|
+
agents: {},
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export interface ConfigSource {
|
|
129
|
+
path: string;
|
|
130
|
+
scope: "global" | "project";
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function readJson(path: string): Record<string, unknown> | undefined {
|
|
134
|
+
try {
|
|
135
|
+
if (!existsSync(path)) return undefined;
|
|
136
|
+
const raw = readFileSync(path, "utf8");
|
|
137
|
+
const parsed = JSON.parse(raw);
|
|
138
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return undefined;
|
|
139
|
+
return parsed as Record<string, unknown>;
|
|
140
|
+
} catch {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function coerce(base: OrchestraConfig, patch: Record<string, unknown>): OrchestraConfig {
|
|
146
|
+
const next: OrchestraConfig = { ...base, agents: { ...base.agents } };
|
|
147
|
+
|
|
148
|
+
if (typeof patch.maxConcurrency === "number" && patch.maxConcurrency > 0) {
|
|
149
|
+
next.maxConcurrency = Math.floor(patch.maxConcurrency);
|
|
150
|
+
}
|
|
151
|
+
if (typeof patch.defaultAgent === "string" && patch.defaultAgent.trim()) next.defaultAgent = patch.defaultAgent.trim();
|
|
152
|
+
if (typeof patch.inheritModel === "boolean") next.inheritModel = patch.inheritModel;
|
|
153
|
+
if (typeof patch.timeoutMs === "number" && patch.timeoutMs >= 0) next.timeoutMs = patch.timeoutMs;
|
|
154
|
+
if (patch.timeoutMode === "total" || patch.timeoutMode === "idle") next.timeoutMode = patch.timeoutMode;
|
|
155
|
+
if (typeof patch.keepOpen === "boolean") next.keepOpen = patch.keepOpen;
|
|
156
|
+
if (typeof patch.notifyOnSettle === "boolean") next.notifyOnSettle = patch.notifyOnSettle;
|
|
157
|
+
if (typeof patch.workerCommand === "string" && patch.workerCommand.trim()) {
|
|
158
|
+
next.workerCommand = patch.workerCommand.trim();
|
|
159
|
+
}
|
|
160
|
+
if (typeof patch.stateDir === "string" && patch.stateDir.trim()) next.stateDir = patch.stateDir.trim();
|
|
161
|
+
if (patch.sessionMode === "no-session" || patch.sessionMode === "session") next.sessionMode = patch.sessionMode;
|
|
162
|
+
if (typeof patch.workerIsolation === "boolean") next.workerIsolation = patch.workerIsolation;
|
|
163
|
+
if (typeof patch.budgetUsdPerWorker === "number" && patch.budgetUsdPerWorker >= 0) {
|
|
164
|
+
next.budgetUsdPerWorker = patch.budgetUsdPerWorker;
|
|
165
|
+
}
|
|
166
|
+
if (typeof patch.budgetUsdPerRun === "number" && patch.budgetUsdPerRun >= 0) {
|
|
167
|
+
next.budgetUsdPerRun = patch.budgetUsdPerRun;
|
|
168
|
+
}
|
|
169
|
+
if (typeof patch.budgetMsPerWorker === "number" && patch.budgetMsPerWorker >= 0) {
|
|
170
|
+
next.budgetMsPerWorker = patch.budgetMsPerWorker;
|
|
171
|
+
}
|
|
172
|
+
if (typeof patch.budgetGraceMs === "number" && patch.budgetGraceMs >= 0) {
|
|
173
|
+
next.budgetGraceMs = patch.budgetGraceMs;
|
|
174
|
+
}
|
|
175
|
+
if (typeof patch.stallMs === "number" && patch.stallMs >= 0) next.stallMs = patch.stallMs;
|
|
176
|
+
if (patch.stallAction === "notify" || patch.stallAction === "abort") next.stallAction = patch.stallAction;
|
|
177
|
+
if (patch.budgetAction === "stop" || patch.budgetAction === "ask") next.budgetAction = patch.budgetAction;
|
|
178
|
+
if (typeof patch.retries === "number" && patch.retries >= 0) next.retries = Math.floor(patch.retries);
|
|
179
|
+
if (typeof patch.retryBackoffMs === "number" && patch.retryBackoffMs >= 0) next.retryBackoffMs = Math.floor(patch.retryBackoffMs);
|
|
180
|
+
if (typeof patch.widgetMaxLines === "number" && patch.widgetMaxLines > 0) {
|
|
181
|
+
next.widgetMaxLines = Math.floor(patch.widgetMaxLines);
|
|
182
|
+
}
|
|
183
|
+
if (typeof patch.widgetShowSettled === "boolean") next.widgetShowSettled = patch.widgetShowSettled;
|
|
184
|
+
if (patch.widget === "auto" || patch.widget === "always" || patch.widget === "off") next.widget = patch.widget;
|
|
185
|
+
if (typeof patch.staleRunHours === "number" && patch.staleRunHours >= 0) next.staleRunHours = patch.staleRunHours;
|
|
186
|
+
if (Array.isArray(patch.providerExtensions)) {
|
|
187
|
+
next.providerExtensions = patch.providerExtensions.filter((entry): entry is string => typeof entry === "string");
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (patch.agents && typeof patch.agents === "object" && !Array.isArray(patch.agents)) {
|
|
191
|
+
for (const [name, value] of Object.entries(patch.agents as Record<string, unknown>)) {
|
|
192
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) continue;
|
|
193
|
+
const entry = value as Record<string, unknown>;
|
|
194
|
+
const override: AgentOverride = { ...(next.agents[name] ?? {}) };
|
|
195
|
+
if (typeof entry.model === "string") override.model = entry.model;
|
|
196
|
+
if (typeof entry.thinking === "string") override.thinking = entry.thinking;
|
|
197
|
+
if (typeof entry.tools === "string") {
|
|
198
|
+
override.tools = entry.tools
|
|
199
|
+
.split(",")
|
|
200
|
+
.map((tool) => tool.trim())
|
|
201
|
+
.filter(Boolean);
|
|
202
|
+
} else if (Array.isArray(entry.tools)) {
|
|
203
|
+
override.tools = entry.tools.filter((tool): tool is string => typeof tool === "string");
|
|
204
|
+
}
|
|
205
|
+
next.agents[name] = override;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return next;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function configPaths(cwd: string): ConfigSource[] {
|
|
213
|
+
return [
|
|
214
|
+
{ path: join(homedir(), ".pi", "agent", "orchestra.json"), scope: "global" },
|
|
215
|
+
{ path: join(resolve(cwd), ".pi", "orchestra.json"), scope: "project" },
|
|
216
|
+
];
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export function loadConfig(cwd: string): { config: OrchestraConfig; sources: string[] } {
|
|
220
|
+
let config = DEFAULT_CONFIG;
|
|
221
|
+
const sources: string[] = [];
|
|
222
|
+
|
|
223
|
+
for (const source of configPaths(cwd)) {
|
|
224
|
+
const patch = readJson(source.path);
|
|
225
|
+
if (!patch) continue;
|
|
226
|
+
config = coerce(config, patch);
|
|
227
|
+
sources.push(source.path);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return { config, sources };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function resolveStateDir(cwd: string, config: OrchestraConfig): string {
|
|
234
|
+
const dir = config.stateDir ? resolve(cwd, config.stateDir) : join(resolve(cwd), ".pi", "orchestra");
|
|
235
|
+
return dir;
|
|
236
|
+
}
|