@north-light/cli 0.3.723 → 0.3.724
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/commands/profile/environment.js +2 -2
- package/package.json +3 -3
- package/packages/crouter-api/dist/commands/profile/environment.js +3 -2
- package/packages/crouter-api/package.json +1 -1
- package/packages/crouter-identity/package.json +1 -1
- package/packages/crouter-plugin/package.json +3 -3
- package/runtime.lock.json +14 -14
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
`)}:{},...i!==void 0?{memory_mb:i*1024}:{},...
|
|
1
|
+
var y=Object.defineProperty;var t=(e,r)=>y(e,"name",{value:r,configurable:!0});import{readFileSync as w}from"node:fs";import{resolve as b}from"node:path";import{defineLeaf as a,defineBranch as v}from"../../core/command.js";import{usage as m}from"../../core/errors.js";import{cliClient as d}from"../api-client.js";import{STARTER_SETUP_SCRIPT as k}from"../../core/environment-starter-script.js";import{resolveProfileViaDaemon as u}from"./daemon-profiles.js";const h={kind:"flag",name:"profile",type:"string",required:!0,constraint:"Profile id or manifest name; a close-enough name resolves to the nearest profile, reported on stderr."},f=[{name:"profile_id",type:"string",required:!0,constraint:"Stable profile id."},{name:"repositories",type:"string[]",required:!0,constraint:"`owner/name` in checkout order; the first is where nodes start (`/work/<name>`)."},{name:"setup_script",type:"string",required:!1,constraint:"The script the image build runs; null when none."},{name:"pi_packages",type:"string",required:!1,constraint:"pi package sources, one per line; null when none."},{name:"memory_mb",type:"number",required:!0,constraint:"Memory of new sandboxes: 2048, 4096 or 8192."},{name:"allow_pull_request_write",type:"boolean",required:!0,constraint:"Whether sandboxes may open and merge pull requests: their GitHub credential carries pull_requests write besides contents write. On by default."},{name:"recipe_revision",type:"number",required:!0,constraint:"Raised by one each time the recipe changes."},{name:"image_revision",type:"number",required:!1,constraint:"The recipe revision the current image was built from; the image is ready when it equals recipe_revision. Null before the first build."},{name:"image_error",type:"string",required:!1,constraint:"Why the last image build failed; null when it did not."}];function g(e){const{environment_id:r,...n}=e;return n}t(g,"output");const q=a({name:"show",description:"show a cloud profile's recipe, memory and image state",whenToUse:"checking what a dev profile builds and runs in, or whether the image for its latest recipe is ready (`image_revision` equals `recipe_revision`).",help:{name:"profile environment show",summary:"a cloud profile's environment: repositories, setup script, pi packages, memory and image build state",params:[h],output:[...f],outputKind:"object",effects:["Read-only. Refuses a profile that does not run in a cloud environment."]},run:t(async e=>{const{id:r}=await u(e.profile);return g(await d().getProfileEnvironment(r))},"run")}),_=a({name:"starter",description:"print a commented starter setup script to copy and fill in",whenToUse:"writing the first setup script for a cloud profile, or looking up what the image build already does and where secrets go.",help:{name:"profile environment starter",summary:"print a commented starter setup script with example sections",params:[],output:[],outputKind:"object",effects:["Prints the script as-is to stdout: redirect it to a file (`> setup.sh`), edit it, pass it to `profile environment set --setup-script-file`. Read-only; changes no profile and builds no image."]},run:t(async()=>{process.stdout.write(k)},"run")}),x=a({name:"set",description:"change a cloud profile's repositories, setup script, pi packages, memory or pull request merging",whenToUse:"a dev profile needs other repositories, a setup script for its image, pi packages, or more memory. A flag left out keeps its value. For a first setup script, start from `crtr profile environment starter`.",help:{name:"profile environment set",summary:"change a cloud profile's environment recipe or memory",params:[h,{kind:"flag",name:"repo",type:"string",required:!1,repeatable:!0,constraint:"GitHub repository `owner/name` (repeat per repository); replaces the whole list. The GitHub App must be installed on each."},{kind:"flag",name:"setup-script-file",type:"path",required:!1,constraint:"File holding the setup script. The image build runs it once as root in `/work` on Alpine (apk), after checking out the repositories into `/work/<name>` and downloading every pnpm-lock.yaml repository's packages into a shared pnpm store; output lands in `/work/.crtr/setup.log`, and a non-zero exit stops sandboxes from starting. `crtr profile environment starter` prints a commented template."},{kind:"flag",name:"pi-package",type:"string",required:!1,repeatable:!0,constraint:"pi package source (repeat per package); replaces the whole list."},{kind:"flag",name:"allow-pull-request-write",type:"bool",required:!1,constraint:"On by default: sandboxes may open and merge pull requests (their GitHub credential carries pull_requests write). `--no-allow-pull-request-write` drops to contents write only, so sandboxes can push branches but not open pull requests. Takes effect on the next credential a sandbox fetches; builds no image."},{kind:"flag",name:"memory",type:"int",required:!1,constraint:"Sandbox memory in GB: 2, 4 or 8. Reaches sandboxes created after the change; a running sandbox keeps its memory."}],output:[...f],outputKind:"object",effects:["A changed recipe raises `recipe_revision`, and the daemon builds a new image for it; check `profile environment show`. A recipe identical to the stored one changes nothing.","Secrets never go in the setup script, because it is baked into the image: store them with `crtr profile env set <profile> --name <NAME>` and every sandbox gets them as environment variables."]},run:t(async(e,r)=>{const{id:n}=await u(e.profile),o=e.repo,p=e.setupScriptFile,s=e.piPackage,i=e.memory,l=r?.providedParams.has("allowPullRequestWrite")===!0?e.allowPullRequestWrite:void 0;if(i!==void 0&&![2,4,8].includes(i))throw m("`--memory` is 2, 4 or 8 (GB).");const c={...o!==void 0&&o.length>0?{repositories:o}:{},...p!==void 0?{setup_script:w(b(p),"utf8")}:{},...s!==void 0&&s.length>0?{pi_packages:s.join(`
|
|
2
|
+
`)}:{},...i!==void 0?{memory_mb:i*1024}:{},...l!==void 0?{allow_pull_request_write:l}:{}};if(Object.keys(c).length===0)throw m("pass at least one of `--repo`, `--setup-script-file`, `--pi-package`, `--memory`, `--allow-pull-request-write`.");return g(await d().setProfileEnvironment(n,c))},"run")}),F=v({name:"environment",description:"a cloud profile's recipe (repositories, setup script, pi packages) and sandbox memory",whenToUse:"viewing or changing what a cloud dev profile's sandboxes are built from and how much memory they get.",help:{name:"profile environment",summary:"a cloud profile's environment recipe and memory",model:"A cloud profile runs its nodes in Blaxel sandboxes. Its environment holds the recipe the sandbox image is built from: repositories, a setup script and pi packages. Changing the recipe makes the daemon build a new image, and new sandboxes use it. Memory applies to new sandboxes only. The build always checks out the repositories into `/work/<name>`, installs git, gh, Node and pnpm, and downloads each pnpm repository's packages into a shared store; the setup script adds the rest (`starter` prints a template). API keys and other secrets live in `crtr profile env`, never in the recipe."},children:[q,_,x]});export{F as environmentBranch};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.724",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -158,8 +158,8 @@
|
|
|
158
158
|
},
|
|
159
159
|
"license": "UNLICENSED",
|
|
160
160
|
"dependencies": {
|
|
161
|
-
"@north-light/identity": "0.3.
|
|
162
|
-
"@north-light/plugin": "0.3.
|
|
161
|
+
"@north-light/identity": "0.3.724",
|
|
162
|
+
"@north-light/plugin": "0.3.724",
|
|
163
163
|
"@earendil-works/chord": "1.5.2",
|
|
164
164
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
165
165
|
"@earendil-works/pi-ai": "1.5.2",
|
|
@@ -76,13 +76,14 @@ const setLeaf = defineLeaf({
|
|
|
76
76
|
'Secrets never go in the setup script, because it is baked into the image: store them with `crtr profile env set <profile> --name <NAME>` and every sandbox gets them as environment variables.',
|
|
77
77
|
],
|
|
78
78
|
},
|
|
79
|
-
run: async (input) => {
|
|
79
|
+
run: async (input, context) => {
|
|
80
80
|
const { id } = await resolveProfileViaDaemon(input['profile']);
|
|
81
81
|
const repos = input['repo'];
|
|
82
82
|
const file = input['setupScriptFile'];
|
|
83
83
|
const packages = input['piPackage'];
|
|
84
84
|
const memory = input['memory'];
|
|
85
|
-
|
|
85
|
+
// A bool flag parses to false when absent, so only an explicitly passed flag may change the stored value.
|
|
86
|
+
const allowPrWrite = context?.providedParams.has('allowPullRequestWrite') === true ? input['allowPullRequestWrite'] : undefined;
|
|
86
87
|
if (memory !== undefined && ![2, 4, 8].includes(memory))
|
|
87
88
|
throw usage('`--memory` is 2, 4 or 8 (GB).');
|
|
88
89
|
const req = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.724",
|
|
4
4
|
"description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/api/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.724",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"postpack": "node ../../scripts/pack-minify.mjs postpack packages/crouter-plugin"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@north-light/api": "0.3.
|
|
31
|
-
"@north-light/identity": "0.3.
|
|
30
|
+
"@north-light/api": "0.3.724",
|
|
31
|
+
"@north-light/identity": "0.3.724"
|
|
32
32
|
},
|
|
33
33
|
"license": "UNLICENSED",
|
|
34
34
|
"publishConfig": {
|
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.724",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/cli",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.724",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"workspaces": [
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@milkdown/preset-gfm": "^7.22.3",
|
|
29
29
|
"@milkdown/prose": "^7.22.3",
|
|
30
30
|
"@milkdown/utils": "^7.22.3",
|
|
31
|
-
"@north-light/identity": "0.3.
|
|
32
|
-
"@north-light/plugin": "0.3.
|
|
31
|
+
"@north-light/identity": "0.3.724",
|
|
32
|
+
"@north-light/plugin": "0.3.724",
|
|
33
33
|
"cron-parser": "^5.6.0",
|
|
34
34
|
"esbuild": "0.28.2",
|
|
35
35
|
"jose": "^6.2.12",
|
|
@@ -11902,17 +11902,17 @@
|
|
|
11902
11902
|
},
|
|
11903
11903
|
"packages/crouter-api": {
|
|
11904
11904
|
"name": "@north-light/api",
|
|
11905
|
-
"version": "0.3.
|
|
11905
|
+
"version": "0.3.724",
|
|
11906
11906
|
"license": "UNLICENSED"
|
|
11907
11907
|
},
|
|
11908
11908
|
"packages/crouter-env-docker": {
|
|
11909
11909
|
"name": "@north-light/env-docker",
|
|
11910
|
-
"version": "0.3.
|
|
11910
|
+
"version": "0.3.724",
|
|
11911
11911
|
"license": "UNLICENSED"
|
|
11912
11912
|
},
|
|
11913
11913
|
"packages/crouter-identity": {
|
|
11914
11914
|
"name": "@north-light/identity",
|
|
11915
|
-
"version": "0.3.
|
|
11915
|
+
"version": "0.3.724",
|
|
11916
11916
|
"license": "UNLICENSED",
|
|
11917
11917
|
"dependencies": {
|
|
11918
11918
|
"jose": "^6.2.1"
|
|
@@ -11920,21 +11920,21 @@
|
|
|
11920
11920
|
},
|
|
11921
11921
|
"packages/crouter-plugin": {
|
|
11922
11922
|
"name": "@north-light/plugin",
|
|
11923
|
-
"version": "0.3.
|
|
11923
|
+
"version": "0.3.724",
|
|
11924
11924
|
"license": "UNLICENSED",
|
|
11925
11925
|
"dependencies": {
|
|
11926
|
-
"@north-light/api": "0.3.
|
|
11927
|
-
"@north-light/identity": "0.3.
|
|
11926
|
+
"@north-light/api": "0.3.724",
|
|
11927
|
+
"@north-light/identity": "0.3.724"
|
|
11928
11928
|
}
|
|
11929
11929
|
},
|
|
11930
11930
|
"packages/crouter-sdk": {
|
|
11931
11931
|
"name": "@north-light/sdk",
|
|
11932
|
-
"version": "0.3.
|
|
11932
|
+
"version": "0.3.724",
|
|
11933
11933
|
"license": "UNLICENSED",
|
|
11934
11934
|
"dependencies": {
|
|
11935
|
-
"@north-light/api": "0.3.
|
|
11936
|
-
"@north-light/identity": "0.3.
|
|
11937
|
-
"@north-light/plugin": "0.3.
|
|
11935
|
+
"@north-light/api": "0.3.724",
|
|
11936
|
+
"@north-light/identity": "0.3.724",
|
|
11937
|
+
"@north-light/plugin": "0.3.724",
|
|
11938
11938
|
"jose": "^6.2.1"
|
|
11939
11939
|
},
|
|
11940
11940
|
"bin": {
|