planr 1.10.0-alpha.8 → 1.10.0-alpha.9

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.
@@ -117,10 +117,10 @@ The frozen product contract lives in `docs/contracts/EVAL_CONTRACT_V1.md` until
117
117
 
118
118
  Planr remains a single crate for V1 because:
119
119
 
120
- - there is one deployable binary and no separate service or reusable library boundary;
120
+ - one crate owns the CLI and its optional companion executables;
121
121
  - the current behavior contract is tighter when CLI, MCP, HTTP, storage, and docs ship together;
122
122
  - module-level ownership gives the needed architecture separation without duplicating Cargo settings or release packaging;
123
- - npm, release, and external consumer tests assume one native binary named `planr`.
123
+ - npm, release, and external consumer tests treat `planr` as the product entry point. They also package provider-specific companion executables when Planr ships them.
124
124
 
125
125
  A Cargo workspace was tried and reverted: it produced anemic crates whose only job was being a layer, plus re-export shims in the binary. A workspace should be introduced only after a concrete deployable, reuse, compilation, or team ownership boundary exists and package/release scripts are updated in the same change.
126
126
 
package/docs/RELEASE.md CHANGED
@@ -202,6 +202,7 @@ cat dist/planr-*/SHA256SUMS
202
202
  The artifact contains:
203
203
 
204
204
  - `planr`
205
+ - `planr-browser-harness-adapter`
205
206
  - `scripts/host-capability-experiment.mjs`
206
207
  - `scripts/host-capability-runtime/v1/schemas/*.schema.json`
207
208
  - `scripts/planr-host-capability-validator`
@@ -228,6 +229,8 @@ npm pack --dry-run
228
229
  The package must include:
229
230
 
230
231
  - `npm/bin/planr.js`
232
+ - `npm/bin/planr-browser-harness-adapter.js`
233
+ - `npm/bin/native-launcher.js`
231
234
  - `scripts/host-capability-experiment.mjs`
232
235
  - `scripts/host-capability-runtime/v1/schemas/*.schema.json`
233
236
  - `scripts/planr-host-capability-validator`
@@ -237,7 +240,7 @@ The package must include:
237
240
  - `README.md`
238
241
  - `LICENSE.md`
239
242
 
240
- `npm/native/` platform binaries exist only in the `npm-publish` CI job; the local dry-run does not include them.
243
+ `npm/native/` platform binaries exist only in the `npm-publish` CI job. The published package includes `planr`, `planr-browser-harness-adapter`, and `planr-host-capability-validator` for each platform. The local dry-run does not include these binaries.
241
244
 
242
245
  ## Install Smoke
243
246
 
@@ -0,0 +1,67 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import fs from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const here = path.dirname(fileURLToPath(import.meta.url));
8
+ const packageRoot = path.resolve(here, "..", "..");
9
+
10
+ function platformTarget() {
11
+ const osName = { darwin: "darwin", linux: "linux" }[os.platform()];
12
+ const arch = { arm64: "arm64", x64: "x86_64" }[os.arch()];
13
+ if (!osName || !arch) return null;
14
+ return `${osName}-${arch}`;
15
+ }
16
+
17
+ function repositoryBuildCandidates(binaryName) {
18
+ if (!fs.existsSync(path.join(packageRoot, "Cargo.toml"))) return [];
19
+ const metadata = spawnSync(
20
+ "cargo",
21
+ ["metadata", "--no-deps", "--format-version", "1"],
22
+ { cwd: packageRoot, encoding: "utf8" },
23
+ );
24
+ if (metadata.status !== 0) return [];
25
+ try {
26
+ const targetDirectory = JSON.parse(metadata.stdout).target_directory;
27
+ if (typeof targetDirectory !== "string" || targetDirectory.length === 0) return [];
28
+ return [
29
+ path.join(targetDirectory, "release", binaryName),
30
+ path.join(targetDirectory, "debug", binaryName),
31
+ ];
32
+ } catch {
33
+ return [];
34
+ }
35
+ }
36
+
37
+ export function runNative({ binaryName, overrideEnvironment, productName }) {
38
+ const target = platformTarget();
39
+ const packagedCandidates = [
40
+ process.env[overrideEnvironment],
41
+ target && path.join(here, "..", "native", target, binaryName),
42
+ ].filter(Boolean);
43
+ const binary = packagedCandidates.find(candidate => fs.existsSync(candidate))
44
+ ?? repositoryBuildCandidates(binaryName).find(candidate => fs.existsSync(candidate));
45
+
46
+ if (!binary) {
47
+ if (!target) {
48
+ console.error(`${productName} has no native binary for ${os.platform()}-${os.arch()}.`);
49
+ console.error("Supported platforms: darwin-arm64, darwin-x86_64, linux-x86_64, linux-arm64.");
50
+ } else {
51
+ console.error(`${productName} native binary was not found.`);
52
+ console.error(`Build it with: cargo build --release --bin ${binaryName}`);
53
+ console.error(`Or set ${overrideEnvironment}=/absolute/path/to/${binaryName}`);
54
+ }
55
+ process.exit(127);
56
+ }
57
+
58
+ const result = spawnSync(binary, process.argv.slice(2), {
59
+ stdio: "inherit",
60
+ env: process.env,
61
+ });
62
+ if (result.error) {
63
+ console.error(result.error.message);
64
+ process.exit(1);
65
+ }
66
+ process.exit(result.status ?? 0);
67
+ }
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { runNative } from "./native-launcher.js";
3
+
4
+ runNative({
5
+ binaryName: "planr-browser-harness-adapter",
6
+ overrideEnvironment: "PLANR_BROWSER_HARNESS_ADAPTER_BIN",
7
+ productName: "Planr Browser Harness adapter",
8
+ });
package/npm/bin/planr.js CHANGED
@@ -1,78 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { spawnSync } from "node:child_process";
3
- import fs from "node:fs";
4
- import os from "node:os";
5
- import path from "node:path";
6
- import { fileURLToPath } from "node:url";
2
+ import { runNative } from "./native-launcher.js";
7
3
 
8
- const here = path.dirname(fileURLToPath(import.meta.url));
9
- const packageRoot = path.resolve(here, "..", "..");
10
-
11
- function platformTarget() {
12
- const osName = { darwin: "darwin", linux: "linux" }[os.platform()];
13
- const arch = { arm64: "arm64", x64: "x86_64" }[os.arch()];
14
- if (!osName || !arch) {
15
- return null;
16
- }
17
- return `${osName}-${arch}`;
18
- }
19
-
20
- const target = platformTarget();
21
- const packagedCandidates = [
22
- process.env.PLANR_NATIVE_BIN,
23
- // Published package: per-platform binaries bundled at release time.
24
- target && path.join(here, "..", "native", target, "planr"),
25
- ].filter(Boolean);
26
-
27
- function repositoryBuildCandidates() {
28
- if (!fs.existsSync(path.join(packageRoot, "Cargo.toml"))) {
29
- return [];
30
- }
31
- const metadata = spawnSync(
32
- "cargo",
33
- ["metadata", "--no-deps", "--format-version", "1"],
34
- { cwd: packageRoot, encoding: "utf8" },
35
- );
36
- if (metadata.status !== 0) {
37
- return [];
38
- }
39
- try {
40
- const targetDirectory = JSON.parse(metadata.stdout).target_directory;
41
- if (typeof targetDirectory !== "string" || targetDirectory.length === 0) {
42
- return [];
43
- }
44
- return [
45
- path.join(targetDirectory, "release", "planr"),
46
- path.join(targetDirectory, "debug", "planr"),
47
- ];
48
- } catch {
49
- return [];
50
- }
51
- }
52
-
53
- const binary = packagedCandidates.find(candidate => fs.existsSync(candidate))
54
- ?? repositoryBuildCandidates().find(candidate => fs.existsSync(candidate));
55
-
56
- if (!binary) {
57
- if (!target) {
58
- console.error(`Planr has no native binary for ${os.platform()}-${os.arch()}.`);
59
- console.error("Supported platforms: darwin-arm64, darwin-x86_64, linux-x86_64, linux-arm64.");
60
- } else {
61
- console.error("Planr native binary was not found.");
62
- console.error("Build it with: cargo build --release");
63
- console.error("Or set PLANR_NATIVE_BIN=/absolute/path/to/planr");
64
- }
65
- process.exit(127);
66
- }
67
-
68
- const result = spawnSync(binary, process.argv.slice(2), {
69
- stdio: "inherit",
70
- env: process.env,
4
+ runNative({
5
+ binaryName: "planr",
6
+ overrideEnvironment: "PLANR_NATIVE_BIN",
7
+ productName: "Planr",
71
8
  });
72
-
73
- if (result.error) {
74
- console.error(result.error.message);
75
- process.exit(1);
76
- }
77
-
78
- process.exit(result.status ?? 0);
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "planr",
3
- "version": "1.10.0-alpha.8",
3
+ "version": "1.10.0-alpha.9",
4
4
  "description": "Local-first planning and execution coordination for coding agents.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,10 +9,11 @@
9
9
  },
10
10
  "type": "module",
11
11
  "bin": {
12
- "planr": "npm/bin/planr.js"
12
+ "planr": "npm/bin/planr.js",
13
+ "planr-browser-harness-adapter": "npm/bin/planr-browser-harness-adapter.js"
13
14
  },
14
15
  "files": [
15
- "npm/bin/planr.js",
16
+ "npm/bin",
16
17
  "npm/native",
17
18
  "scripts/host-capability-experiment.mjs",
18
19
  "scripts/host-capability-runtime",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "planr",
3
3
  "description": "Skill-driven planning and execution loop for coding agents: one planr entry point, an autonomous planr-loop, and evidence-backed task graph skills powered by the planr CLI.",
4
- "version": "1.10.0-alpha.8",
4
+ "version": "1.10.0-alpha.9",
5
5
  "author": {
6
6
  "name": "instructa"
7
7
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "planr",
3
- "version": "1.10.0-alpha.8",
3
+ "version": "1.10.0-alpha.9",
4
4
  "description": "Skill-driven planning and execution loop for coding agents: one $planr entry point, an autonomous $planr-loop, and evidence-backed task graph skills powered by the planr CLI.",
5
5
  "author": {
6
6
  "name": "instructa",