@north-light/cli 0.3.665 → 0.3.667

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.
Files changed (76) hide show
  1. package/dist/api/client.d.ts +5 -0
  2. package/dist/api/client.js +3 -3
  3. package/dist/api/contract.d.ts +1 -1
  4. package/dist/api/contract.js +1 -1
  5. package/dist/api/dto/environments.d.ts +25 -0
  6. package/dist/api/dto/environments.js +0 -0
  7. package/dist/api/dto/nodes.d.ts +2 -0
  8. package/dist/api/dto/profiles.d.ts +15 -0
  9. package/dist/api/index.d.ts +1 -0
  10. package/dist/api/index.js +1 -1
  11. package/dist/api/routes.d.ts +1 -0
  12. package/dist/api/routes.js +1 -1
  13. package/dist/builtin-memory/02-turn-lifecycle/00-ending-a-turn.md +3 -1
  14. package/dist/builtin-memory/04-base-worker-exploring.md +2 -2
  15. package/dist/builtin-memory/crouter-concepts/scopes-and-trust.md +1 -1
  16. package/dist/builtin-memory/crouter-sdk/release-notes.md +6 -0
  17. package/dist/builtin-memory/northlight-apps/guides/files-and-documents.md +4 -8
  18. package/dist/clients/attach/chrome/canvas-panels.d.ts +9 -1
  19. package/dist/clients/attach/chrome/canvas-panels.js +1 -1
  20. package/dist/clients/attach/chrome/roster.js +6 -6
  21. package/dist/clients/attach/viewer.js +499 -499
  22. package/dist/commands/node.js +1 -1
  23. package/dist/commands/profile/environment.d.ts +2 -0
  24. package/dist/commands/profile/environment.js +2 -0
  25. package/dist/commands/profile/new.js +1 -1
  26. package/dist/commands/profile.js +1 -1
  27. package/dist/core/canvas/canvas.js +18 -18
  28. package/dist/core/environment-recipe.d.ts +20 -10
  29. package/dist/core/environment-recipe.js +1 -1
  30. package/dist/core/environment-repos.d.ts +7 -0
  31. package/dist/core/environment-repos.js +1 -0
  32. package/dist/core/environments.d.ts +4 -1
  33. package/dist/core/environments.js +1 -1
  34. package/dist/core/profiles/manifest.d.ts +7 -1
  35. package/dist/core/profiles/manifest.js +1 -1
  36. package/dist/core/providers/files.js +1 -1
  37. package/dist/core/runs/operations.js +7 -7
  38. package/dist/core/runtime/runner/blaxel/image-build.d.ts +6 -2
  39. package/dist/core/runtime/runner/blaxel/image-build.js +6 -5
  40. package/dist/core/secrets/blaxel-launch.js +3 -3
  41. package/dist/core/storage/caller-file.d.ts +12 -0
  42. package/dist/core/storage/caller-file.js +1 -0
  43. package/dist/core/storage/client.d.ts +0 -1
  44. package/dist/core/storage/client.js +2 -2
  45. package/dist/core/storage/shares.d.ts +0 -12
  46. package/dist/core/storage/shares.js +1 -1
  47. package/dist/daemon/api/app-listener.js +9 -9
  48. package/dist/daemon/api/environment-of.d.ts +2 -0
  49. package/dist/daemon/api/environment-of.js +3 -3
  50. package/dist/daemon/api/handlers/app-profiles.d.ts +1 -0
  51. package/dist/daemon/api/handlers/app-profiles.js +1 -1
  52. package/dist/daemon/api/handlers/attach.js +1 -1
  53. package/dist/daemon/api/handlers/environments.d.ts +2 -0
  54. package/dist/daemon/api/handlers/environments.js +1 -0
  55. package/dist/daemon/api/handlers/profiles.js +1 -1
  56. package/dist/daemon/api/handlers/transfer.d.ts +0 -6
  57. package/dist/daemon/api/handlers/transfer.js +1 -1
  58. package/dist/daemon/api/map.js +2 -2
  59. package/dist/daemon/api/operations.d.ts +2 -2
  60. package/dist/daemon/api/operations.js +1 -1
  61. package/dist/daemon/api/server.js +1 -1
  62. package/dist/daemon/crtrd.js +11 -11
  63. package/dist/daemon/due-sources.d.ts +1 -1
  64. package/dist/daemon/due-sources.js +1 -1
  65. package/dist/daemon/due.js +6 -6
  66. package/dist/daemon/reconcilers/idle-sandbox.d.ts +18 -0
  67. package/dist/daemon/reconcilers/idle-sandbox.js +7 -0
  68. package/dist/daemon/reconcilers/recipe-image.js +4 -4
  69. package/docs/apps/guides/files-and-documents.md +2 -6
  70. package/docs/concepts/scopes-and-trust.md +1 -1
  71. package/docs/sdk/release-notes.md +6 -0
  72. package/package.json +2 -2
  73. package/packages/crouter-identity/package.json +1 -1
  74. package/runtime.lock.json +13 -13
  75. package/dist/core/storage/download.d.ts +0 -23
  76. package/dist/core/storage/download.js +0 -1
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.665",
3
+ "version": "0.3.667",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/cli",
9
- "version": "0.3.665",
9
+ "version": "0.3.667",
10
10
  "hasInstallScript": true,
11
11
  "license": "UNLICENSED",
12
12
  "workspaces": [
@@ -28,7 +28,7 @@
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.665",
31
+ "@north-light/identity": "0.3.667",
32
32
  "cron-parser": "^5.6.0",
33
33
  "esbuild": "0.28.2",
34
34
  "jose": "^6.2.12",
@@ -10666,17 +10666,17 @@
10666
10666
  },
10667
10667
  "packages/crouter-api": {
10668
10668
  "name": "@north-light/api",
10669
- "version": "0.3.665",
10669
+ "version": "0.3.667",
10670
10670
  "license": "UNLICENSED"
10671
10671
  },
10672
10672
  "packages/crouter-env-docker": {
10673
10673
  "name": "@north-light/env-docker",
10674
- "version": "0.3.665",
10674
+ "version": "0.3.667",
10675
10675
  "license": "UNLICENSED"
10676
10676
  },
10677
10677
  "packages/crouter-identity": {
10678
10678
  "name": "@north-light/identity",
10679
- "version": "0.3.665",
10679
+ "version": "0.3.667",
10680
10680
  "license": "UNLICENSED",
10681
10681
  "dependencies": {
10682
10682
  "jose": "^6.2.1"
@@ -10684,21 +10684,21 @@
10684
10684
  },
10685
10685
  "packages/crouter-plugin": {
10686
10686
  "name": "@north-light/plugin",
10687
- "version": "0.3.665",
10687
+ "version": "0.3.667",
10688
10688
  "license": "UNLICENSED",
10689
10689
  "dependencies": {
10690
- "@north-light/api": "0.3.665",
10691
- "@north-light/identity": "0.3.665"
10690
+ "@north-light/api": "0.3.667",
10691
+ "@north-light/identity": "0.3.667"
10692
10692
  }
10693
10693
  },
10694
10694
  "packages/crouter-sdk": {
10695
10695
  "name": "@north-light/sdk",
10696
- "version": "0.3.665",
10696
+ "version": "0.3.667",
10697
10697
  "license": "UNLICENSED",
10698
10698
  "dependencies": {
10699
- "@north-light/api": "0.3.665",
10700
- "@north-light/identity": "0.3.665",
10701
- "@north-light/plugin": "0.3.665",
10699
+ "@north-light/api": "0.3.667",
10700
+ "@north-light/identity": "0.3.667",
10701
+ "@north-light/plugin": "0.3.667",
10702
10702
  "jose": "^6.2.1"
10703
10703
  },
10704
10704
  "bin": {
@@ -1,23 +0,0 @@
1
- import type { IncomingMessage, ServerResponse } from 'node:http';
2
- import { type FileCaller } from '../spaces/permissions.js';
3
- /** An open regular file the caller may read. The caller closes `fd`. */
4
- export interface CallerFile {
5
- fd: number;
6
- path: string;
7
- size: number;
8
- }
9
- /** Open `raw` for `caller` (`null` = the person) beneath the root its
10
- * permission names: absent or withheld → `not_found`; unpermitted →
11
- * `scope_missing`; a symlink on the way → `invalid_request` `param: path`; not
12
- * a regular file → `not_found`. */
13
- export declare function openCallerFile(caller: FileCaller | null, raw: string | null | undefined): CallerFile;
14
- /** A single `bytes=` range of a `size`-byte file: `null` = serve all; throws a
15
- * 416 for a malformed or unsatisfiable range. Several ranges are served whole. */
16
- export declare function parseRange(header: string | undefined, size: number): {
17
- start: number;
18
- end: number;
19
- } | null;
20
- /** `file.download`: the file's raw bytes. Errors before the head is sent throw
21
- * (the listener answers the JSON envelope; a 416 carries `Content-Range`); an
22
- * error once bytes flow destroys the socket so no JSON is ever appended. */
23
- export declare function serveDownload(req: IncomingMessage, res: ServerResponse, caller: FileCaller, raw: string | null): Promise<void>;
@@ -1 +0,0 @@
1
- var b=Object.defineProperty;var c=(a,e)=>b(a,"name",{value:e,configurable:!0});import{closeSync as u,constants as p,createReadStream as C,fstatSync as R,realpathSync as y}from"node:fs";import{isAbsolute as N,join as w,relative as l,resolve as S,sep as h}from"node:path";import{pipeline as $}from"node:stream/promises";import{appsRoot as E,runtimeRoot as x,userRoot as O}from"../layout.js";import{RunError as d}from"../runs/operations.js";import{isBeneathRefusal as _,openBeneath as v}from"../spaces/open-beneath.js";import{fileRoot as I}from"../spaces/permissions.js";import{contentTypeFor as A}from"./media-types.js";function m(a,e){const r=l(a,e);return r===""||r!==".."&&!r.startsWith(`..${h}`)&&!r.startsWith(h)}c(m,"contains");function L(a){const e=c(n=>process.platform==="darwin"?n.toLowerCase():n,"fold"),r=e(a),o=e(E());if(m(e(x()),r)||m(e(w(O(),"memory")),r))return!0;if(!m(o,r))return!1;const t=l(o,r).split(h)[1];return t==="memory"||t==="profiles"||t==="conversations"}c(L,"withheld");function T(a,e){if(typeof e!="string"||!e)throw new d(400,"invalid_request","path is required","path");if(!N(e)||e.includes("\0"))throw new d(400,"invalid_request","path must be absolute","path");const r=S(e),o=c(()=>new d(404,"not_found",`no such file: ${r}`),"notFound");if(L(r))throw o();const t=I(a,r,"read");if("hidden"in t)throw o();if(!("root"in t))throw new d(403,"scope_missing",t.missing?`missing scope ${t.missing}`:`no permission names ${r}`,void 0,void 0,t.missing??void 0);const n=c(()=>new d(400,"invalid_request",`${r} meets a symlink, leaves its permitted root, or is not a regular file`,"path"),"symlink");let f;try{f=v(t.root,r,p.O_RDONLY|p.O_NONBLOCK)}catch(s){if(_(s))throw n();const i=s.code;throw i==="ENOENT"||i==="ENOTDIR"||i==="EISDIR"||i==="ENXIO"||i==="EACCES"||i==="EPERM"?o():s}try{if(process.platform!=="linux"){let i;try{i=y(r)}catch{throw o()}if(i!==w(y(t.root),l(t.root,r)))throw n()}const s=R(f);if(!s.isFile())throw o();return{fd:f,path:r,size:s.size}}catch(s){throw u(f),s}}c(T,"openCallerFile");function D(a,e){if(a===void 0)return null;const r=c(()=>new d(416,"range_not_satisfiable","range not satisfiable","range",{size:e}),"refuse"),o=/^bytes=(.+)$/i.exec(a.trim());if(!o)throw r();if(o[1].includes(","))return null;const t=/^\s*(\d*)\s*-\s*(\d*)\s*$/.exec(o[1]);if(!t||t[1]===""&&t[2]==="")throw r();let n,f;if(t[1]===""){const s=Number(t[2]);if(!Number.isSafeInteger(s)||s===0||e===0)throw r();n=Math.max(0,e-s),f=e-1}else if(n=Number(t[1]),f=t[2]===""?e-1:Math.min(Number(t[2]),e-1),!Number.isSafeInteger(n)||!Number.isSafeInteger(f)||n>=e||t[2]!==""&&Number(t[2])<n)throw r();return{start:n,end:f}}c(D,"parseRange");async function j(a,e,r,o){const t=T(r,o);let n;try{const i=a.headers.range;try{n=D(Array.isArray(i)?i[0]:i,t.size)}catch(g){throw e.setHeader("Content-Range",`bytes */${t.size}`),g}}catch(i){throw u(t.fd),i}const f={"Content-Type":A(t.path),"X-Content-Type-Options":"nosniff","Content-Security-Policy":"sandbox; default-src 'none'","Accept-Ranges":"bytes","Cache-Control":"no-store"};if(a.destroyed||e.destroyed){u(t.fd);return}if(n?e.writeHead(206,{...f,"Content-Length":String(n.end-n.start+1),"Content-Range":`bytes ${n.start}-${n.end}/${t.size}`}):e.writeHead(200,{...f,"Content-Length":String(t.size)}),t.size===0||n&&n.end<n.start){u(t.fd),e.end();return}const s=C("",{fd:t.fd,autoClose:!0,...n?{start:n.start,end:n.end}:{start:0}});try{await $(s,e)}catch{s.destroy(),e.destroy()}}c(j,"serveDownload");export{T as openCallerFile,D as parseRange,j as serveDownload};