@farthershore/cli 0.33.0 → 0.33.1
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 +12 -7
- package/dist/index.js +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Create and operate [FartherShore](https://farthershore.com) software businesses
|
|
4
4
|
from the terminal.
|
|
5
5
|
|
|
6
|
-
**Status: `0.33.
|
|
6
|
+
**Status: `0.33.1`.** Pre-1.0 — the command surface is stable but may still
|
|
7
7
|
change between minor versions. Pin an exact version in CI.
|
|
8
8
|
|
|
9
9
|
FartherShore lets you define a software business as code, then sells, meters,
|
|
@@ -21,19 +21,19 @@ the explicitly agent-operable subset of the CLI surface.
|
|
|
21
21
|
## Install
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npm install -g @farthershore/cli@0.33.
|
|
24
|
+
npm install -g @farthershore/cli@0.33.1
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Or run it directly with npx:
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npx -p @farthershore/cli@0.33.
|
|
30
|
+
npx -p @farthershore/cli@0.33.1 farthershore --help
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
The package also ships an MCP stdio server for agents:
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
npx -p @farthershore/cli@0.33.
|
|
36
|
+
npx -p @farthershore/cli@0.33.1 farthershore-mcp
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
## Authentication
|
|
@@ -682,15 +682,20 @@ Use `--all-plans` to clear plan scoping.
|
|
|
682
682
|
Install or refresh the platform-verified skills bundle together. The platform
|
|
683
683
|
pins this immutable release, and CI plus a daily repository check compare it to
|
|
684
684
|
GitHub's latest stable release so the guidance cannot silently drift.
|
|
685
|
-
This command requires `@farthershore/cli` 0.33.
|
|
685
|
+
This command requires `@farthershore/cli` 0.33.1 or newer.
|
|
686
686
|
|
|
687
687
|
```bash
|
|
688
|
+
set -euo pipefail
|
|
689
|
+
CLI_VERSION=$(farthershore --version)
|
|
690
|
+
printf '%s' "$CLI_VERSION" | node -e 'let v=""; process.stdin.on("data", c => v += c).on("end", () => { const m = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:\+[0-9A-Za-z.-]+)?$/.exec(v.trim()); if (!m || !(+m[1] > 0 || +m[2] > 33 || (+m[2] === 33 && +m[3] >= 1))) { console.error("Stop: CLI 0.33.1 or newer is required; ask the human to upgrade."); process.exitCode = 1; } })'
|
|
688
691
|
farthershore skills install --help
|
|
689
|
-
# If the command is unavailable, upgrade to the required CLI release:
|
|
690
|
-
npm install -g @farthershore/cli@0.33.0
|
|
691
692
|
farthershore skills install
|
|
692
693
|
```
|
|
693
694
|
|
|
695
|
+
If either prerequisite fails, stop and ask the human to run
|
|
696
|
+
`npm install -g @farthershore/cli@0.33.1`, then repeat the checks.
|
|
697
|
+
Do not install or upgrade global tooling autonomously.
|
|
698
|
+
|
|
694
699
|
The Farther Shore CLI downloads the exact installer archive and verifies this
|
|
695
700
|
SHA-512 before it extracts or executes any installer code.
|
|
696
701
|
|
package/dist/index.js
CHANGED
|
@@ -145,7 +145,7 @@ Examples:
|
|
|
145
145
|
farthershore validate --business weather-api # + server validate (full PR verdict)
|
|
146
146
|
farthershore validate --local-only --format json
|
|
147
147
|
`).action(async i=>{let n=i.entry??"business",s=n,a=r.runLocalManifestBuild??Bg,c=r.readManifestEnvelope??Fg,u=await SL(jg(xL(),"fs-validate-")),l=jg(u,"build-a.json"),d=jg(u,"build-b.json");try{let g=await a({entry:n,out:l});TL(g),g.exitCode!==0&&xS(g,s);let b=await wS(c,l,s),p=await a({entry:n,out:d});p.exitCode!==0&&xS(p,s);let k=await wS(c,d,s),D=b.irHash??null;(!D||D!==(k.irHash??null))&&RL(b.irHash??null,k.irHash??null,s);let m=null,f=null;if(i.localOnly)f="skipped (--local-only)";else if(!i.business)f="skipped (pass --business <id-or-name> for the full server verdict: diff + economic change)";else{let y=t(),w=await K(y,i.business);m=await y.compileManifest(w,b.ir,{env:i.env}),m.success||OL(m)}F({success:!0,entry:s,irHash:D,deterministic:!0,validate:m?{success:m.success,economicChange:m.economicChange??!1,warnings:m.warnings,lifecyclePlan:m.lifecyclePlan??null,environment:m.environment??null,specHash:m.specHash??null}:null,validateSkipped:f,nextActions:AL(m,f)},m?"Validate passed \u2014 manifest compiles and validates cleanly":"Validate passed \u2014 manifest builds deterministically"),m?.economicChange&&He("This change is economic (plan/pricing) \u2014 it will defer to a release on push."),f&&!i.localOnly&&He(f)}finally{await wL(u,{recursive:!0,force:!0}).catch(()=>{})}})}function TL(e){ge()!=="json"&&(e.stdout&&process.stdout.write(e.stdout),e.stderr&&process.stderr.write(e.stderr))}async function wS(e,t,r){try{return ec(await e(t),t)}catch(i){let n=i instanceof Error?i.message:"Manifest IR output could not be read";throw new h(n,0,{code:"MANIFEST_IR_READ_FAILED",details:{success:!1,phase:"read_manifest_ir",entry:r,errors:[{message:n}],nextActions:["Run farthershore build to see the full build output"]}})}}function xS(e,t){throw new h(`Manifest build failed with exit code ${e.exitCode||1}`,0,{code:"MANIFEST_BUILD_FAILED",details:{success:!1,phase:"local_build",entry:t,command:e.command,args:e.args,exitCode:e.exitCode,signal:e.signal,stdout:e.stdout,stderr:e.stderr,nextActions:[...Mg(e.stderr,e.command),"Fix your business/ program and run farthershore validate again"]}})}function RL(e,t,r){throw new h("Manifest build is nondeterministic \u2014 two builds produced different irHash",0,{code:"MANIFEST_NONDETERMINISTIC",details:{success:!1,phase:"determinism",entry:r,irHash:e,irHash2:t,nextActions:["Remove nondeterminism from your business/ program (e.g. Date.now(), Math.random(), unordered iteration)"]}})}function OL(e){throw new h(`Manifest validation failed with ${e.errors.length} error(s)`,422,{code:"MANIFEST_VALIDATION_FAILED",details:{success:!1,phase:"server_validate",irHash:e.irHash??null,errors:e.errors,warnings:e.warnings,economicChange:e.economicChange??!1,nextActions:["Fix the reported errors in your business/ program and run farthershore validate again"]}})}function AL(e,t){return e?["Manifest compiles and validates \u2014 commit and push; the GitHub check will run the same validation"]:t&&t.includes("--business")?["Pass --business <id-or-name> to also run the server validate (semantic diff + economic-change verdict)"]:["Commit and push business/ changes"]}function Mg(e,t){let r=e??"";return/ENOENT/.test(r)&&/manifest-build/.test(r+t)?["business/ dependencies are not installed \u2014 this is NOT a problem with your program","Run `npm install` inside the business/ directory, then re-run the command"]:[]}var NL="business",PL="business-build.json",RS="./business/node_modules/.bin/farthershore-manifest-build",DL="./node_modules/.bin/farthershore-manifest-build";function UL(e=OS){return e(RS)?RS:DL}async function Bg(e,t=CL,r=OS){let i=UL(r),n=["--entry",e.entry,"--out",e.out],s=t(i,n,{stdio:["ignore","pipe","pipe"]}),a="",c="",u=!1;return s.stdout?.setEncoding("utf8"),s.stderr?.setEncoding("utf8"),s.stdout?.on("data",l=>{a+=l}),s.stderr?.on("data",l=>{c+=l}),new Promise(l=>{let d=(g,b)=>{u||(u=!0,l({command:i,args:n,exitCode:g,signal:b,stdout:a,stderr:c}))};s.on("error",g=>{c+=`${g.message}
|
|
148
|
-
`,d(1,null)}),s.on("close",(g,b)=>{d(g??(b?1:0),b)})})}async function Fg(e){let t=await $L(e,"utf8"),r=JSON.parse(t);if(!CS(r)||!("ir"in r))throw new Error(`${e} is not a Manifest IR envelope with an ir field`);return ec(r,e)}function ec(e,t="Manifest build output"){if(!CS(e)||!("ir"in e))throw new Error(`${t} is not a Manifest IR envelope with an ir field`);let r=Gf.safeParse(e.ir);if(!r.success)throw new Error(`${t} contains invalid Manifest IR: ${r.error.issues[0]?.message??"schema validation failed"}`);if(!/^3\.0\.(0|[1-9]\d*)
|
|
148
|
+
`,d(1,null)}),s.on("close",(g,b)=>{d(g??(b?1:0),b)})})}async function Fg(e){let t=await $L(e,"utf8"),r=JSON.parse(t);if(!CS(r)||!("ir"in r))throw new Error(`${e} is not a Manifest IR envelope with an ir field`);return ec(r,e)}function ec(e,t="Manifest build output"){if(!CS(e)||!("ir"in e))throw new Error(`${t} is not a Manifest IR envelope with an ir field`);let r=Gf.safeParse(e.ir);if(!r.success)throw new Error(`${t} contains invalid Manifest IR: ${r.error.issues[0]?.message??"schema validation failed"}`);if(!/^3\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\+[0-9A-Za-z.-]+)?$/.test(r.data.sdkVersion))throw new Error(`${t} was emitted by unsupported @farthershore/business ${r.data.sdkVersion}; this CLI requires released 3.x`);if(typeof e.irHash!="string")throw new Error(`${t} is missing its canonical irHash`);let i=qf(e.ir);if(e.irHash!==i)throw new Error(`${t} irHash does not identify the supplied Manifest IR bytes`);return{ir:e.ir,irHash:i}}function AS(e,t,r={}){e.command("build").description("Build the business/ program into a Manifest IR envelope").option("--entry <path>","Business-as-code folder or file to compile (default: business/)").option("--out <path>","Output path for the build output (default: business-build.json)").addHelpText("after",`
|
|
149
149
|
Examples:
|
|
150
150
|
farthershore build
|
|
151
151
|
farthershore build --entry business/ --out business-build.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farthershore/cli",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"description": "FartherShore CLI — create and operate software businesses",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"author": "Farther Shore",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
+
"@farthershore/cloudflared-darwin-arm64": "0.0.0",
|
|
32
33
|
"@farthershore/cloudflared-darwin-x64": "0.0.0",
|
|
33
|
-
"@farthershore/cloudflared-linux-arm64": "0.0.0",
|
|
34
34
|
"@farthershore/cloudflared-linux-x64": "0.0.0",
|
|
35
|
-
"@farthershore/cloudflared-
|
|
35
|
+
"@farthershore/cloudflared-linux-arm64": "0.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"typescript-eslint": "^8.66.0",
|
|
49
49
|
"vitest": "^4.1.10",
|
|
50
50
|
"zod": "^4.4.3",
|
|
51
|
-
"@farthershore/authz": "0.1.0",
|
|
52
51
|
"@farthershore/business": "3.2.0",
|
|
53
|
-
"@farthershore/
|
|
54
|
-
"@farthershore/contracts": "0.62.0"
|
|
52
|
+
"@farthershore/authz": "0.1.0",
|
|
53
|
+
"@farthershore/contracts": "0.62.0",
|
|
54
|
+
"@farthershore/farthershore-js": "0.28.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"dev": "tsx src/index.ts",
|