@north-light/cli 0.3.563 → 0.3.564
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.
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { type BlobStore } from './index.js';
|
|
2
|
+
/** Move the objects of the directory store's former place (`<layout root>/blobs`) to `root`, one object at a time. Safe when
|
|
3
|
+
* several processes run it at once and when an older build is still writing to `former`: an object is published at its new key
|
|
4
|
+
* with a hard link (which refuses to replace an existing object) and its old name is removed only after that, so an interrupted
|
|
5
|
+
* or raced move leaves every object readable in one place or the other. Entries it did not move (an object whose key already
|
|
6
|
+
* exists at `root`, or one written after the listing) stay in `former` and are picked up by the next call. A `former` that is
|
|
7
|
+
* a symbolic link is followed, so the objects behind it move too. When the objects are on another filesystem (`link` fails with
|
|
8
|
+
* EXDEV) each is copied to a temporary file, fsynced and linked in. Does nothing once `former` is gone. */
|
|
9
|
+
export declare function adoptBlobDirectory(former: string, root: string, link?: (from: string, to: string) => void): void;
|
|
2
10
|
/** Objects as files under `root`: written to a temp file, fsynced, renamed into place, and the directory fsynced. */
|
|
3
11
|
export declare function createDirectoryBlobStore(root: string): BlobStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var g=Object.defineProperty;var y=(i,n)=>g(i,"name",{value:n,configurable:!0});import{randomUUID as O}from"node:crypto";import{closeSync as m,existsSync as k,fsyncSync as S,linkSync as b,lstatSync as U,mkdirSync as B,openSync as E,readFileSync as D,readSync as W,readdirSync as $,realpathSync as M,renameSync as P,rmSync as a,rmdirSync as v,statSync as x,writeSync as F}from"node:fs";import{dirname as w,join as d,resolve as X}from"node:path";import{assertBlobKey as Y}from"./index.js";import{blobFault as j}from"./fault.js";function I(i){const n=E(i,"r");try{S(n)}finally{m(n)}}y(I,"syncDir");function J(i,n,f=b){let t;try{t=M(i)}catch(r){if(r.code==="ENOENT")return;throw r}if(t===X(n))return;const e=new Set,o=y((r,c)=>{let u;try{u=$(r,{withFileTypes:!0})}catch(s){if(s.code==="ENOENT")return;throw s}for(const s of u){if(s.name.endsWith(".tmp"))continue;const l=d(r,s.name),N=d(c,s.name);if(s.isDirectory()){o(l,N);try{v(l)}catch(p){if(!["ENOTEMPTY","ENOENT"].includes(p.code??""))throw p}continue}const h=d(n,N);B(w(h),{recursive:!0,mode:448}),e.add(w(h));try{f(l,h)}catch(p){const T=p.code;if(T==="EEXIST"){K(l,h)&&a(l,{force:!0});continue}if(T==="ENOENT"||!L(l,h))continue}a(l,{force:!0})}},"adopt");o(t,"");for(const r of e)I(r);try{v(t)}catch(r){if(!["ENOTEMPTY","ENOENT"].includes(r.code??""))throw r}U(i,{throwIfNoEntry:!1})?.isSymbolicLink()&&!k(i)&&a(i,{force:!0})}y(J,"adoptBlobDirectory");function K(i,n){try{const f=x(i),t=x(n);return f.ino===t.ino&&f.dev===t.dev}catch{return!1}}y(K,"sameFile");function L(i,n){const f=`${n}.${O()}.tmp`;try{const t=E(f,"wx",384);try{let e;try{e=D(i)}catch(r){if(r.code==="ENOENT")return!1;throw r}let o=0;for(;o<e.length;)o+=F(t,e,o);S(t)}finally{m(t)}try{b(f,n)}catch(e){if(e.code==="EEXIST")return!1;throw e}return!0}finally{a(f,{force:!0})}}y(L,"copyInto");function Q(i){const n=y(t=>(Y(t),d(i,...t.split("/"))),"pathOf");function f(t,e,o){let r;try{r=$(t,{withFileTypes:!0})}catch(c){if(c.code==="ENOENT")return;throw c}for(const c of r){if(c.name.endsWith(".tmp"))continue;const u=e===""?c.name:`${e}/${c.name}`;c.isDirectory()?f(d(t,c.name),u,o):o.push(u)}}return y(f,"walk"),{async put(t,e){j("put");const o=n(t);B(w(o),{recursive:!0,mode:448});const r=`${o}.${O()}.tmp`,c=E(r,"wx",384);try{const u=typeof e=="string"?Buffer.from(e,"utf8"):Buffer.from(e);let s=0;for(;s<u.length;)s+=F(c,u,s);S(c)}catch(u){throw m(c),a(r,{force:!0}),u}m(c),P(r,o),I(w(o))},async get(t,e){try{if(!e)return D(n(t));const o=E(n(t),"r");try{const r=Buffer.allocUnsafe(e.length),c=W(o,r,0,e.length,e.start);return r.subarray(0,c)}finally{m(o)}}catch(o){if(o.code==="ENOENT")return null;throw o}},async list(t){const e=[];return f(i,"",e),e.filter(o=>o.startsWith(t)).sort((o,r)=>Buffer.compare(Buffer.from(o),Buffer.from(r)))},async delete(t){a(n(t),{force:!0})}}}y(Q,"createDirectoryBlobStore");export{J as adoptBlobDirectory,Q as createDirectoryBlobStore};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The one blob-store interface: conversation objects, run-event chunks, job output, attachments and releases are
|
|
2
2
|
* objects under slash-separated keys (`conversations/<node>/<session>/<seq>.jsonl`). Implementations: a directory
|
|
3
|
-
* (a Mac, `~/.crouter/blobs/`) and R2 (the cloud). A key never starts with `/` and has no `.` or `..` segment. */
|
|
3
|
+
* (a Mac, `~/.crouter/runtime/blobs/`) and R2 (the cloud). A key never starts with `/` and has no `.` or `..` segment. */
|
|
4
4
|
export interface BlobStore {
|
|
5
5
|
/** Write `data` at `key`, replacing any object there. Resolves once the object is durable. */
|
|
6
6
|
put(key: string, data: Buffer | Uint8Array | string): Promise<void>;
|
package/dist/core/blobs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var l=Object.defineProperty;var r=(t,o)=>l(t,"name",{value:o,configurable:!0});function _(t){if(t===""||t.startsWith("/")||t.endsWith("/")||t.split("/").some(o=>o===""||o==="."||o===".."))throw new Error(`invalid blob key: ${JSON.stringify(t)}`)}r(_,"assertBlobKey");let e;async function a(){if(e)return e;const t=process.env.CRTR_R2_BUCKET;if(t){const o=r(s=>{const i=process.env[s];if(!i)throw new Error(`${s} is required when CRTR_R2_BUCKET is set`);return i},"need"),{createR2BlobStore:n}=await import("./r2.js");e=n({bucket:t,endpoint:o("CRTR_R2_ENDPOINT"),accessKeyId:o("CRTR_R2_ACCESS_KEY_ID"),secretAccessKey:o("CRTR_R2_SECRET_ACCESS_KEY")})}else{const[{join:o},{layoutRoot:n,runtimeRoot:s},{adoptBlobDirectory:i,createDirectoryBlobStore:R}]=await Promise.all([import("node:path"),import("../layout.js"),import("./directory.js")]),c=o(s(),"blobs");i(o(n(),"blobs"),c),e=R(c)}return e}r(a,"blobStore");function p(){e=void 0}r(p,"resetBlobStore");export{_ as assertBlobKey,a as blobStore,p as resetBlobStore};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.564",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
},
|
|
145
145
|
"license": "UNLICENSED",
|
|
146
146
|
"dependencies": {
|
|
147
|
-
"@north-light/identity": "0.3.
|
|
147
|
+
"@north-light/identity": "0.3.564",
|
|
148
148
|
"@earendil-works/pi-agent-core": "1.1.0",
|
|
149
149
|
"@earendil-works/pi-ai": "1.1.0",
|
|
150
150
|
"@earendil-works/pi-coding-agent": "1.1.0",
|
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.564",
|
|
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.564",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"workspaces": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@milkdown/preset-gfm": "^7.22.3",
|
|
25
25
|
"@milkdown/prose": "^7.22.3",
|
|
26
26
|
"@milkdown/utils": "^7.22.3",
|
|
27
|
-
"@north-light/identity": "0.3.
|
|
27
|
+
"@north-light/identity": "0.3.564",
|
|
28
28
|
"cron-parser": "^5.6.0",
|
|
29
29
|
"esbuild": "^0.27.7",
|
|
30
30
|
"jose": "^6.2.12",
|
|
@@ -12455,17 +12455,17 @@
|
|
|
12455
12455
|
},
|
|
12456
12456
|
"packages/crouter-api": {
|
|
12457
12457
|
"name": "@north-light/api",
|
|
12458
|
-
"version": "0.3.
|
|
12458
|
+
"version": "0.3.564",
|
|
12459
12459
|
"license": "UNLICENSED"
|
|
12460
12460
|
},
|
|
12461
12461
|
"packages/crouter-env-docker": {
|
|
12462
12462
|
"name": "@north-light/env-docker",
|
|
12463
|
-
"version": "0.3.
|
|
12463
|
+
"version": "0.3.564",
|
|
12464
12464
|
"license": "UNLICENSED"
|
|
12465
12465
|
},
|
|
12466
12466
|
"packages/crouter-identity": {
|
|
12467
12467
|
"name": "@north-light/identity",
|
|
12468
|
-
"version": "0.3.
|
|
12468
|
+
"version": "0.3.564",
|
|
12469
12469
|
"license": "UNLICENSED",
|
|
12470
12470
|
"dependencies": {
|
|
12471
12471
|
"jose": "^6.2.1"
|
|
@@ -12473,21 +12473,21 @@
|
|
|
12473
12473
|
},
|
|
12474
12474
|
"packages/crouter-plugin": {
|
|
12475
12475
|
"name": "@north-light/plugin",
|
|
12476
|
-
"version": "0.3.
|
|
12476
|
+
"version": "0.3.564",
|
|
12477
12477
|
"license": "UNLICENSED",
|
|
12478
12478
|
"dependencies": {
|
|
12479
|
-
"@north-light/api": "0.3.
|
|
12480
|
-
"@north-light/identity": "0.3.
|
|
12479
|
+
"@north-light/api": "0.3.564",
|
|
12480
|
+
"@north-light/identity": "0.3.564"
|
|
12481
12481
|
}
|
|
12482
12482
|
},
|
|
12483
12483
|
"packages/crouter-sdk": {
|
|
12484
12484
|
"name": "@north-light/sdk",
|
|
12485
|
-
"version": "0.3.
|
|
12485
|
+
"version": "0.3.564",
|
|
12486
12486
|
"license": "UNLICENSED",
|
|
12487
12487
|
"dependencies": {
|
|
12488
|
-
"@north-light/api": "0.3.
|
|
12489
|
-
"@north-light/identity": "0.3.
|
|
12490
|
-
"@north-light/plugin": "0.3.
|
|
12488
|
+
"@north-light/api": "0.3.564",
|
|
12489
|
+
"@north-light/identity": "0.3.564",
|
|
12490
|
+
"@north-light/plugin": "0.3.564",
|
|
12491
12491
|
"jose": "^6.2.1"
|
|
12492
12492
|
},
|
|
12493
12493
|
"bin": {
|