@pushpalsdev/cli 1.0.79 → 1.0.80
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/dist/pushpals-cli.js +66 -3
- package/package.json +1 -1
- package/runtime/prompts/remotebuddy/autonomy_ideation_system_prompt.md +5 -3
- package/runtime/prompts/workerpals/openai_codex_default_system_prompt.md +1 -0
- package/runtime/prompts/workerpals/openai_codex_runtime_policy_appendix.md +1 -0
- package/runtime/prompts/workerpals/openai_codex_task_execute_system_prompt.md +1 -0
- package/runtime/sandbox/.pushpals-remotebuddy-fallback.js +536 -18
- package/runtime/sandbox/apps/workerpals/src/execute_job.ts +282 -33
- package/runtime/sandbox/apps/workerpals/src/workerpals_main.ts +113 -2
- package/runtime/sandbox/packages/shared/src/client_preflight.ts +2 -0
- package/runtime/sandbox/packages/shared/src/config.ts +1 -6
- package/runtime/sandbox/packages/shared/src/index.ts +19 -0
- package/runtime/sandbox/packages/shared/src/tooling.ts +422 -0
- package/runtime/sandbox/packages/shared/src/vision.ts +12 -0
- package/runtime/sandbox/prompts/workerpals/openai_codex_default_system_prompt.md +1 -0
- package/runtime/sandbox/prompts/workerpals/openai_codex_runtime_policy_appendix.md +1 -0
- package/runtime/sandbox/prompts/workerpals/openai_codex_task_execute_system_prompt.md +1 -0
- package/runtime/vision.example.md +125 -122
package/dist/pushpals-cli.js
CHANGED
|
@@ -14,7 +14,16 @@ import {
|
|
|
14
14
|
rmSync as rmSync2,
|
|
15
15
|
writeFileSync
|
|
16
16
|
} from "fs";
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
basename,
|
|
19
|
+
delimiter,
|
|
20
|
+
dirname,
|
|
21
|
+
extname,
|
|
22
|
+
join as join2,
|
|
23
|
+
relative as relative2,
|
|
24
|
+
resolve as resolve4,
|
|
25
|
+
win32 as pathWin32
|
|
26
|
+
} from "path";
|
|
18
27
|
import { createInterface } from "readline";
|
|
19
28
|
|
|
20
29
|
// ../shared/src/localbuddy_runtime.ts
|
|
@@ -793,7 +802,7 @@ function loadPushPalsConfig(options = {}) {
|
|
|
793
802
|
const canonical = coerceAutonomyComponentConfigKey(rawKey);
|
|
794
803
|
if (!canonical)
|
|
795
804
|
continue;
|
|
796
|
-
const parsed =
|
|
805
|
+
const parsed = rawValue;
|
|
797
806
|
remoteAutonomyDispatchByComponent[canonical] = Number.isFinite(parsed) ? Math.max(0, Math.floor(parsed)) : 0;
|
|
798
807
|
}
|
|
799
808
|
const workerNode = getObject(merged, "workerpals");
|
|
@@ -1384,6 +1393,7 @@ function evaluateClientRuntimePreflight(options) {
|
|
|
1384
1393
|
issues.push({
|
|
1385
1394
|
code: "missing_vision_doc",
|
|
1386
1395
|
message: "Missing required autonomy vision file: vision.md " + "(required when remotebuddy.autonomy.enabled=true).",
|
|
1396
|
+
detail: "Run `pushpals --create_vision_md` to create a starter vision.md, then edit it for this repo.",
|
|
1387
1397
|
copyCommands: existsSync3(visionTemplatePath) ? buildCopyCommands(projectRoot, visionTemplatePath, visionPath) : undefined
|
|
1388
1398
|
});
|
|
1389
1399
|
return {
|
|
@@ -1778,6 +1788,7 @@ function printUsage() {
|
|
|
1778
1788
|
console.log(" --runtime-only Start the local runtime and wait for shutdown without opening the interactive chat");
|
|
1779
1789
|
console.log(" --status-once Print active endpoints once and exit");
|
|
1780
1790
|
console.log(" --clear Remove repo-local PushPals state and exit");
|
|
1791
|
+
console.log(" --create_vision_md Create a starter vision.md in the current repo and exit");
|
|
1781
1792
|
console.log(" -h, --help Show this help");
|
|
1782
1793
|
console.log("");
|
|
1783
1794
|
console.log("Chat commands:");
|
|
@@ -1797,7 +1808,8 @@ function parseArgs(argv) {
|
|
|
1797
1808
|
noStream: false,
|
|
1798
1809
|
runtimeOnly: false,
|
|
1799
1810
|
statusOnce: false,
|
|
1800
|
-
clear: false
|
|
1811
|
+
clear: false,
|
|
1812
|
+
createVisionMd: false
|
|
1801
1813
|
};
|
|
1802
1814
|
for (let i = 0;i < argv.length; i++) {
|
|
1803
1815
|
const arg = argv[i];
|
|
@@ -1825,6 +1837,10 @@ function parseArgs(argv) {
|
|
|
1825
1837
|
options.clear = true;
|
|
1826
1838
|
continue;
|
|
1827
1839
|
}
|
|
1840
|
+
if (arg === "--create_vision_md" || arg === "--create-vision-md") {
|
|
1841
|
+
options.createVisionMd = true;
|
|
1842
|
+
continue;
|
|
1843
|
+
}
|
|
1828
1844
|
if (arg === "--server-url") {
|
|
1829
1845
|
options.serverUrl = argv[++i];
|
|
1830
1846
|
continue;
|
|
@@ -2471,6 +2487,46 @@ function emitCliRuntimePreflight(result) {
|
|
|
2471
2487
|
for (const line of lines)
|
|
2472
2488
|
console.error(line);
|
|
2473
2489
|
}
|
|
2490
|
+
function displayPath(fromRoot, pathValue) {
|
|
2491
|
+
const rel = relative2(fromRoot, pathValue);
|
|
2492
|
+
if (!rel || rel === "")
|
|
2493
|
+
return ".";
|
|
2494
|
+
if (rel.startsWith(".."))
|
|
2495
|
+
return pathValue;
|
|
2496
|
+
return rel.replace(/\\/g, "/");
|
|
2497
|
+
}
|
|
2498
|
+
function resolveVisionTemplatePathForCreate(opts) {
|
|
2499
|
+
const candidates = [
|
|
2500
|
+
join2(opts.runtimeRoot, "vision.example.md"),
|
|
2501
|
+
join2(opts.repoRoot, "vision.example.md"),
|
|
2502
|
+
resolve4(import.meta.dir, "..", "runtime", "vision.example.md"),
|
|
2503
|
+
resolve4(import.meta.dir, "..", "packages", "cli", "runtime", "vision.example.md"),
|
|
2504
|
+
resolve4(import.meta.dir, "..", "vision.example.md")
|
|
2505
|
+
];
|
|
2506
|
+
for (const candidate of candidates) {
|
|
2507
|
+
if (existsSync5(candidate))
|
|
2508
|
+
return candidate;
|
|
2509
|
+
}
|
|
2510
|
+
return null;
|
|
2511
|
+
}
|
|
2512
|
+
function createVisionMdFromTemplate(opts) {
|
|
2513
|
+
const visionPath = join2(opts.repoRoot, "vision.md");
|
|
2514
|
+
if (existsSync5(visionPath)) {
|
|
2515
|
+
console.log(`[pushpals] vision.md already exists at ${displayPath(opts.repoRoot, visionPath)}; leaving it unchanged.`);
|
|
2516
|
+
return 0;
|
|
2517
|
+
}
|
|
2518
|
+
const templatePath = resolveVisionTemplatePathForCreate(opts);
|
|
2519
|
+
if (!templatePath) {
|
|
2520
|
+
console.error("[pushpals] Could not create vision.md: bundled vision.example.md template was not found.");
|
|
2521
|
+
return 1;
|
|
2522
|
+
}
|
|
2523
|
+
const template = readFileSync4(templatePath, "utf8");
|
|
2524
|
+
writeFileSync(visionPath, template, "utf8");
|
|
2525
|
+
console.log(`[pushpals] Created ${displayPath(opts.repoRoot, visionPath)} from ${displayPath(opts.repoRoot, templatePath)}.`);
|
|
2526
|
+
console.log("[pushpals] Edit vision.md with this repo's users, priorities, guardrails, and validation path.");
|
|
2527
|
+
console.log("[pushpals] Then run `pushpals` again.");
|
|
2528
|
+
return 0;
|
|
2529
|
+
}
|
|
2474
2530
|
function runtimeBinaryFilename(serviceName, platformKey) {
|
|
2475
2531
|
const serviceToken = serviceName === "source_control_manager" ? "source-control-manager" : serviceName;
|
|
2476
2532
|
const extension = platformKey.startsWith("windows-") ? ".exe" : "";
|
|
@@ -5003,6 +5059,13 @@ async function main() {
|
|
|
5003
5059
|
});
|
|
5004
5060
|
const config = preparedRuntime.runtimePreflight.config;
|
|
5005
5061
|
const statePath = resolveCliStatePath(repoRoot);
|
|
5062
|
+
if (parsed.createVisionMd) {
|
|
5063
|
+
const exitCode = createVisionMdFromTemplate({
|
|
5064
|
+
repoRoot,
|
|
5065
|
+
runtimeRoot: preparedRuntime.runtimeRoot
|
|
5066
|
+
});
|
|
5067
|
+
process.exit(exitCode);
|
|
5068
|
+
}
|
|
5006
5069
|
if (parsed.clear) {
|
|
5007
5070
|
const serverUrl2 = normalizeLoopbackUrl(parsed.serverUrl ?? process.env.PUSHPALS_SERVER_URL, config.server.url);
|
|
5008
5071
|
const exitCode = await clearPushpalsState({
|
package/package.json
CHANGED
|
@@ -37,17 +37,19 @@ Constraints:
|
|
|
37
37
|
|
|
38
38
|
- You will receive `vision.markdown`; use it as inspiration and prioritize candidates that clearly advance that vision.
|
|
39
39
|
- You will also receive `vision.sections`; if numbered sections are present, cite at least one section number in `vision_section_refs`.
|
|
40
|
-
- You will also receive `vision.key_items`; prioritize alignment with `priorities` + `objectives`, respect `guardrails` + `constraints`, and
|
|
40
|
+
- You will also receive `vision.key_items`; prioritize alignment with `priorities` + `objectives`, respect `guardrails` + `constraints`, avoid `non_goals`, and reflect `testing_criteria` in expected validation when present.
|
|
41
|
+
- You will also receive `engine_inspiration.compiled_repo_objectives`: generic categories compiled from the repo's own headings and priority/order signals. Prefer these repo-native objectives first, preserving their wording in titles/problems instead of inventing product-specific categories.
|
|
41
42
|
- You will also receive `snapshot.state_traits`; use these strengths/weaknesses/opportunities/risks to characterize repo health and choose high-leverage objectives.
|
|
42
43
|
- You will also receive `engine_inspiration` with:
|
|
43
44
|
- `compiled_objectives`: weighted priorities derived from `vision.md`
|
|
45
|
+
- `compiled_repo_objectives`: repo-native headings categorized into reusable orchestration categories
|
|
44
46
|
- `opportunity_gaps`: quantified delivery/merge/activation/governance/workforce gaps
|
|
45
47
|
- `building_blocks`: candidate algorithms for improving the autonomous workforce itself
|
|
46
48
|
- `source_patterns`: normalized external repo/doc inspirations with source attribution
|
|
47
49
|
- `commit_history_hints`: motifs extracted from local commit history
|
|
48
50
|
- You may also receive `snapshot.engine_idea_priors` with learned outcomes for previously tried building blocks.
|
|
49
51
|
- Prefer high-sample/high-success `snapshot.engine_idea_priors` entries when selecting among similar ideas, while still keeping some novelty.
|
|
50
|
-
- Prefer candidates that
|
|
52
|
+
- Prefer candidates that advance high-weight `engine_inspiration.compiled_repo_objectives`. Use `engine_inspiration.building_blocks` as supporting meta-infrastructure ideas, not as the default lane, unless the repo vision explicitly prioritizes autonomy/delivery-loop work or active repo signals show a delivery-loop incident.
|
|
51
53
|
- Treat `engine_inspiration.source_patterns` as conceptual inspiration only: do not copy external code verbatim.
|
|
52
54
|
- When possible, include `engine_trial` metadata that points to the building block the candidate is implementing.
|
|
53
55
|
- `vision_alignment_reason` must be concrete and explain how the candidate advances the cited sections.
|
|
@@ -58,4 +60,4 @@ Constraints:
|
|
|
58
60
|
- do not invent evidence ids.
|
|
59
61
|
- If all signals are low/noisy, it is valid to return zero candidates.
|
|
60
62
|
- Treat a low `sig_queue_health` value as maintenance-window evidence for safe proactive work, not only incident response.
|
|
61
|
-
- `expected_validation` commands
|
|
63
|
+
- `expected_validation` commands should use repo-native commands from `vision.key_items.testing_criteria` or local package scripts. Do not rewrite explicit testing criteria to another package manager.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
You are PushPals WorkerPal running via the OpenAI Codex CLI backend.
|
|
2
2
|
Codex CLI is required infrastructure in this environment.
|
|
3
|
+
Do not self-check PushPals infrastructure by running `codex --version` or `codex login status` inside the task workspace; the WorkerPals executor has already launched you through Codex.
|
|
3
4
|
Do not modify tests or product code to bypass, stub, or avoid Codex CLI usage due to assumed environment limits.
|
|
4
5
|
If Codex CLI auth/execution is unavailable, fail loudly with a clear error and stop; do not apply non-Codex workarounds.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Runtime policy guardrails (mandatory):
|
|
2
2
|
|
|
3
3
|
- Codex CLI is required infrastructure in this environment.
|
|
4
|
+
- Do not self-check PushPals infrastructure by running `codex --version` or `codex login status` inside the task workspace; the WorkerPals executor has already launched you through Codex.
|
|
4
5
|
- Never bypass Codex usage by changing tests/code expectations.
|
|
5
6
|
- If Codex CLI auth/execution is unavailable, hard-fail and stop.
|
|
6
7
|
- Do not apply fallback/workaround execution paths when Codex is unavailable.
|
|
@@ -3,6 +3,7 @@ You are PushPals WorkerPal running via the OpenAI Codex CLI backend.
|
|
|
3
3
|
Non-negotiable runtime invariants:
|
|
4
4
|
|
|
5
5
|
- Codex CLI is required infrastructure in this environment.
|
|
6
|
+
- Do not self-check PushPals infrastructure by running `codex --version` or `codex login status` inside the task workspace; the WorkerPals executor has already launched you through Codex.
|
|
6
7
|
- Do not modify tests or production code to bypass, stub, or remove Codex CLI usage due to assumed environment limitations.
|
|
7
8
|
- Do not "adapt around" missing Codex access by rewriting coverage or behavior expectations.
|
|
8
9
|
- If Codex CLI authentication/execution is unavailable, fail loudly with a clear error and stop.
|