@north-light/cli 0.3.766 → 0.3.767
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/clients/attach/viewer.js +222 -222
- package/dist/daemon/reconcilers/machine-offline.js +4 -4
- package/package.json +3 -3
- 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,7 +1,7 @@
|
|
|
1
|
-
var _=Object.defineProperty;var d=(o,e)=>_(o,"name",{value:e,configurable:!0});import{openDb as c}from"../../core/canvas/db.js";import{isCloudRole as N}from"../../core/canvas/person.js";import{subscribersOf as p}from"../../core/canvas/tree.js";import{enqueueNodeMail as m}from"../../core/feed/messages.js";import{operationIdContext as O}from"../../core/events/operation-id.js";import{emitEvent as
|
|
1
|
+
var _=Object.defineProperty;var d=(o,e)=>_(o,"name",{value:e,configurable:!0});import{openDb as c}from"../../core/canvas/db.js";import{isCloudRole as N}from"../../core/canvas/person.js";import{subscribersOf as p}from"../../core/canvas/tree.js";import{enqueueNodeMail as m}from"../../core/feed/messages.js";import{operationIdContext as O}from"../../core/events/operation-id.js";import{emitEvent as u}from"../../core/events/emit.js";const w=5*6e4;async function E(o){const e=await c(),a=new Map,t=d((n,s)=>{n!==null&&a.set(n,(a.get(n)??new Set).add(s))},"add"),i="JOIN profiles p ON p.id = n.profile_id WHERE p.environment_id = ?",r=await e.prepare(`SELECT DISTINCT x.node_id FROM executions x JOIN nodes n ON n.node_id = x.node_id ${i}
|
|
2
2
|
AND x.runner = 'machine' AND x.state IN ('launching', 'running')`).all(o);for(const{node_id:n}of r)for(const s of await p(n))t(s.node_id,`its report ${n} runs on it`);const l=await e.prepare(`SELECT DISTINCT m.sender_node_id, d.destination_id FROM deliveries d JOIN messages m ON m.message_id = d.message_id
|
|
3
3
|
JOIN nodes n ON n.node_id = d.destination_id ${i}
|
|
4
|
-
AND d.state IN ('pending', 'handed_off') AND d.canceled_at IS NULL AND m.sender_node_id IS NOT NULL`).all(o);for(const n of l)t(n.sender_node_id,`its message to ${n.destination_id} is waiting for delivery`);const f=await e.prepare(`SELECT c.created_by, c.name FROM crons c JOIN profiles p ON p.id = c.profile
|
|
5
|
-
WHERE p.environment_id = ? AND c.run_state = 'running' AND c.run_execution_id IS NOT NULL AND c.created_by IS NOT NULL`).all(o);for(const n of f)t(n.created_by,`its cron ${n.name} has a run waiting to start on it`);return new Map([...a].map(([n,s])=>[n,[...s]]))}d(
|
|
4
|
+
AND n.status IN ('active', 'idle') AND d.state IN ('pending', 'handed_off') AND d.canceled_at IS NULL AND m.sender_node_id IS NOT NULL`).all(o);for(const n of l)t(n.sender_node_id,`its message to ${n.destination_id} is waiting for delivery`);const f=await e.prepare(`SELECT c.created_by, c.name FROM crons c JOIN profiles p ON p.id = c.profile
|
|
5
|
+
WHERE p.environment_id = ? AND c.run_state = 'running' AND c.run_execution_id IS NOT NULL AND c.created_by IS NOT NULL`).all(o);for(const n of f)t(n.created_by,`its cron ${n.name} has a run waiting to start on it`);return new Map([...a].map(([n,s])=>[n,[...s]]))}d(E,"waitersOn");class T{static{d(this,"MachineOfflineReconciler")}async run(e){if(!N())return;const t=await(await c()).prepare(`SELECT e.object, e.last_seen_at, o.name FROM environments e JOIN objects o ON o.id = e.object
|
|
6
6
|
WHERE e.kind = 'machine' AND e.last_seen_at < ?
|
|
7
|
-
AND NOT EXISTS (SELECT 1 FROM machine_links l WHERE l.environment = e.object AND l.lease_expires_at > ?)`).all(new Date(e-
|
|
7
|
+
AND NOT EXISTS (SELECT 1 FROM machine_links l WHERE l.environment = e.object AND l.lease_expires_at > ?)`).all(new Date(e-w).toISOString(),new Date(e).toISOString());for(const i of t)try{await O.fresh(()=>this.notify(i))}catch(r){u({level:"warn",event:"machine.offline_notice_failed",fields:{environment:i.object},error:r})}}async notify(e){const a=await c();for(const[t,i]of await E(e.object))await a.prepare("SELECT 1 AS live FROM nodes WHERE node_id = ? AND status IN ('active', 'idle')").get(t)!==void 0&&await m(t,{kind:"update",label:"machine offline",urgency:"normal",wake:1,bodyJson:{body:`The Mac ${e.name??e.object} has been offline since ${e.last_seen_at}; ${i.join("; ")}. Nothing was stopped: everything resumes when it reconnects.`},idempotencyKey:`machine-offline:${e.object}:${e.last_seen_at}:${t}`})}}export{w as MACHINE_OFFLINE_NOTICE_MS,T as MachineOfflineReconciler};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.767",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
},
|
|
158
158
|
"license": "UNLICENSED",
|
|
159
159
|
"dependencies": {
|
|
160
|
-
"@north-light/identity": "0.3.
|
|
161
|
-
"@north-light/plugin": "0.3.
|
|
160
|
+
"@north-light/identity": "0.3.767",
|
|
161
|
+
"@north-light/plugin": "0.3.767",
|
|
162
162
|
"@earendil-works/chord": "1.5.2",
|
|
163
163
|
"@earendil-works/pi-agent-core": "1.5.2",
|
|
164
164
|
"@earendil-works/pi-ai": "1.5.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.767",
|
|
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.767",
|
|
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.767",
|
|
31
|
+
"@north-light/identity": "0.3.767"
|
|
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.767",
|
|
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.767",
|
|
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.767",
|
|
32
|
+
"@north-light/plugin": "0.3.767",
|
|
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.767",
|
|
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.767",
|
|
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.767",
|
|
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.767",
|
|
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.767",
|
|
11927
|
+
"@north-light/identity": "0.3.767"
|
|
11928
11928
|
}
|
|
11929
11929
|
},
|
|
11930
11930
|
"packages/crouter-sdk": {
|
|
11931
11931
|
"name": "@north-light/sdk",
|
|
11932
|
-
"version": "0.3.
|
|
11932
|
+
"version": "0.3.767",
|
|
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.767",
|
|
11936
|
+
"@north-light/identity": "0.3.767",
|
|
11937
|
+
"@north-light/plugin": "0.3.767",
|
|
11938
11938
|
"jose": "^6.2.1"
|
|
11939
11939
|
},
|
|
11940
11940
|
"bin": {
|