propr-cli 0.8.3
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/README.md +549 -0
- package/dist/api/agentTank.js +27 -0
- package/dist/api/agents.js +201 -0
- package/dist/api/client.js +284 -0
- package/dist/api/errors.js +145 -0
- package/dist/api/implement.js +147 -0
- package/dist/api/index.js +26 -0
- package/dist/api/logs.js +59 -0
- package/dist/api/plans.js +160 -0
- package/dist/api/relay.js +73 -0
- package/dist/api/repos.js +243 -0
- package/dist/api/settings.js +219 -0
- package/dist/api/system.js +53 -0
- package/dist/api/tasks.js +140 -0
- package/dist/api/todos.js +77 -0
- package/dist/api/types.js +6 -0
- package/dist/assets/.env.example +183 -0
- package/dist/assets/env.example.txt +198 -0
- package/dist/commands/agentCommands.js +405 -0
- package/dist/commands/checkCommands.js +384 -0
- package/dist/commands/implementCommands.js +178 -0
- package/dist/commands/index.js +22 -0
- package/dist/commands/initCommands.js +167 -0
- package/dist/commands/initStack.js +193 -0
- package/dist/commands/logCommands.js +170 -0
- package/dist/commands/planCommands.js +552 -0
- package/dist/commands/relayCommands.js +149 -0
- package/dist/commands/repoCommands.js +526 -0
- package/dist/commands/settingCommands.js +237 -0
- package/dist/commands/stackCommands.js +86 -0
- package/dist/commands/startCommand.js +36 -0
- package/dist/commands/systemCommands.js +221 -0
- package/dist/commands/tankCommands.js +55 -0
- package/dist/commands/taskCommands.js +554 -0
- package/dist/commands/todoCommands.js +620 -0
- package/dist/commands/uiDocsCommands.js +69 -0
- package/dist/config/ConfigManager.js +360 -0
- package/dist/config/index.js +8 -0
- package/dist/config/types.js +16 -0
- package/dist/index.js +276 -0
- package/dist/orchestrator/format.js +31 -0
- package/dist/orchestrator/index.js +102 -0
- package/dist/orchestrator/manifest.json +16 -0
- package/dist/orchestrator/orchestrator.mjs +798 -0
- package/dist/orchestrator/types.js +10 -0
- package/dist/tui/StartApp.js +175 -0
- package/dist/tui/app.js +9 -0
- package/dist/tui/render.js +87 -0
- package/dist/utils/envFile.js +65 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/io.js +186 -0
- package/dist/utils/parseState.js +14 -0
- package/dist/utils/resolveProject.js +50 -0
- package/dist/vendor/shared/demoMode.js +6 -0
- package/dist/vendor/shared/events.js +30 -0
- package/dist/vendor/shared/githubAuthMode.js +35 -0
- package/dist/vendor/shared/index.js +15 -0
- package/dist/vendor/shared/labelUtils.js +32 -0
- package/dist/vendor/shared/modelDefinitions.js +146 -0
- package/dist/vendor/shared/reviewPrompt.js +18 -0
- package/dist/vendor/shared/usageTypes.js +13 -0
- package/dist/vendor/shared/userWhitelist.js +30 -0
- package/dist/vendor/shared/validateRelayUrl.js +21 -0
- package/package.json +31 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrator loader.
|
|
3
|
+
*
|
|
4
|
+
* The orchestration core lives in a dependency-free `.mjs` shared with the
|
|
5
|
+
* production launcher image (docker/launcher/orchestrator.mjs). At CLI build
|
|
6
|
+
* time it is copied next to the compiled output (see scripts/copy-assets.mjs);
|
|
7
|
+
* here we resolve and dynamically import it, typed via ./types.ts.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync } from "node:fs";
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
+
import { dirname, join, resolve } from "node:path";
|
|
12
|
+
let cached;
|
|
13
|
+
let cachedPath;
|
|
14
|
+
/**
|
|
15
|
+
* Candidate locations for orchestrator.mjs, in priority order:
|
|
16
|
+
* 1. Repo-checkout fallback first in src/tsx dev mode.
|
|
17
|
+
* 2. Bundled next to this module in dist.
|
|
18
|
+
*/
|
|
19
|
+
function resolveOrchestratorPath() {
|
|
20
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
const bundled = join(here, "orchestrator.mjs");
|
|
22
|
+
const repoCheckout = () => {
|
|
23
|
+
// Walk up looking for docker/launcher/orchestrator.mjs (dev / source tree).
|
|
24
|
+
let dir = here;
|
|
25
|
+
for (let i = 0; i < 8; i += 1) {
|
|
26
|
+
const candidate = join(dir, "docker", "launcher", "orchestrator.mjs");
|
|
27
|
+
if (existsSync(candidate))
|
|
28
|
+
return candidate;
|
|
29
|
+
const parent = dirname(dir);
|
|
30
|
+
if (parent === dir)
|
|
31
|
+
break;
|
|
32
|
+
dir = parent;
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
const devCheckout = here.includes(`${join("src", "orchestrator")}`);
|
|
37
|
+
if (devCheckout) {
|
|
38
|
+
const checkoutPath = repoCheckout();
|
|
39
|
+
if (checkoutPath)
|
|
40
|
+
return checkoutPath;
|
|
41
|
+
}
|
|
42
|
+
if (existsSync(bundled))
|
|
43
|
+
return bundled;
|
|
44
|
+
const checkoutPath = repoCheckout();
|
|
45
|
+
if (checkoutPath)
|
|
46
|
+
return checkoutPath;
|
|
47
|
+
throw new Error("Could not locate orchestrator.mjs. Run `npm run build` in packages/cli to bundle it, " +
|
|
48
|
+
"or run from a ProPR source checkout.");
|
|
49
|
+
}
|
|
50
|
+
/** Resolve the bundled manifest.json path (sits next to orchestrator.mjs). */
|
|
51
|
+
function resolveManifestPath(orchestratorPath) {
|
|
52
|
+
const manifest = join(dirname(orchestratorPath), "manifest.json");
|
|
53
|
+
return existsSync(manifest) ? manifest : undefined;
|
|
54
|
+
}
|
|
55
|
+
/** Loads (and caches) the orchestrator module. */
|
|
56
|
+
export async function loadOrchestrator() {
|
|
57
|
+
if (cached)
|
|
58
|
+
return cached;
|
|
59
|
+
cachedPath = resolveOrchestratorPath();
|
|
60
|
+
cached = (await import(pathToFileURL(cachedPath).href));
|
|
61
|
+
return cached;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Determine the stack root directory (where .env, data/, logs/, repos/ live).
|
|
65
|
+
* Precedence: explicit flag → PROPR_ROOT env → saved config stackRoot → cwd.
|
|
66
|
+
*/
|
|
67
|
+
export function resolveStackRoot(configManager, flagRoot) {
|
|
68
|
+
if (flagRoot)
|
|
69
|
+
return resolve(flagRoot);
|
|
70
|
+
if (process.env.PROPR_ROOT)
|
|
71
|
+
return resolve(process.env.PROPR_ROOT);
|
|
72
|
+
const saved = configManager?.getStackRoot();
|
|
73
|
+
if (saved)
|
|
74
|
+
return resolve(saved);
|
|
75
|
+
return process.cwd();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Convenience: load the orchestrator and resolve a host config for the given
|
|
79
|
+
* (or resolved) stack root. When a ConfigManager is provided, persisted CLI
|
|
80
|
+
* settings (docsEnabled) are forwarded as overrides so `propr start` honors
|
|
81
|
+
* `propr docs on`. Note: uiEnabled is read directly from ConfigManager at
|
|
82
|
+
* call sites (e.g. render.ts) and passed to startStack(); it is not part of
|
|
83
|
+
* the resolved config because resolveConfig does not consume it.
|
|
84
|
+
*/
|
|
85
|
+
export async function getHostConfig(opts) {
|
|
86
|
+
const orch = await loadOrchestrator();
|
|
87
|
+
const rootDir = resolveStackRoot(opts.configManager, opts.root);
|
|
88
|
+
const orchPath = cachedPath ?? resolveOrchestratorPath();
|
|
89
|
+
const manifestPath = resolveManifestPath(orchPath);
|
|
90
|
+
if (!manifestPath) {
|
|
91
|
+
throw new Error(`Could not locate manifest.json (expected next to ${orchPath}). Run \`npm run build\` in packages/cli to bundle it.`);
|
|
92
|
+
}
|
|
93
|
+
const cliOverrides = {};
|
|
94
|
+
if (opts.configManager) {
|
|
95
|
+
const docsExplicit = opts.configManager.get("docsEnabled");
|
|
96
|
+
if (docsExplicit !== undefined) {
|
|
97
|
+
cliOverrides.docsEnabled = docsExplicit;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const cfg = orch.resolveHostConfig({ rootDir, env: process.env, manifestPath, cliOverrides });
|
|
101
|
+
return { orch, cfg, rootDir };
|
|
102
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.8.3",
|
|
3
|
+
"git_sha": "ce5f5d5f",
|
|
4
|
+
"registry": "propr",
|
|
5
|
+
"images": {
|
|
6
|
+
"app": "propr/app:0.8.2",
|
|
7
|
+
"ui": "propr/ui:0.8.2",
|
|
8
|
+
"docs": "propr/docs:0.8.2",
|
|
9
|
+
"agent-claude": "propr/agent-claude:0.8.2",
|
|
10
|
+
"agent-codex": "propr/agent-codex:0.8.2",
|
|
11
|
+
"agent-antigravity": "propr/agent-antigravity:0.8.2",
|
|
12
|
+
"agent-opencode": "propr/agent-opencode:0.8.2",
|
|
13
|
+
"agent-vibe": "propr/agent-vibe:0.8.2",
|
|
14
|
+
"redis": "redis:7-alpine"
|
|
15
|
+
}
|
|
16
|
+
}
|