portable-agent-layer 0.76.1 → 0.78.0
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 +1 -1
- package/assets/skills/consulting-report/tools/generate-pdf.ts +2 -2
- package/assets/statusline.ps1 +8 -1
- package/assets/statusline.sh +8 -1
- package/assets/templates/hooks.codex.json +10 -0
- package/assets/templates/hooks.copilot.json +7 -0
- package/assets/templates/hooks.cursor.json +6 -0
- package/assets/templates/settings.claude.json +11 -0
- package/package.json +1 -1
- package/src/cli/index.ts +5 -0
- package/src/cli/setup-auto-update.ts +46 -0
- package/src/hooks/AutoUpdate.ts +16 -0
- package/src/hooks/LoadContext.ts +7 -0
- package/src/hooks/SessionClose.ts +25 -0
- package/src/hooks/handlers/agenda.ts +1 -1
- package/src/hooks/handlers/update-check.ts +15 -16
- package/src/hooks/lib/auto-update.ts +294 -0
- package/src/hooks/lib/goal-links.ts +2 -2
- package/src/hooks/lib/security.ts +1 -1
- package/src/hooks/lib/settings.ts +2 -0
- package/src/targets/opencode/plugin.ts +6 -0
- package/src/tools/control-room/server.ts +26 -0
- package/src/tools/control-room/ui/dist/assets/{index-BoQjFpzV.js → index-DyhnNmdi.js} +1 -1
- package/src/tools/control-room/ui/dist/index.html +1 -1
- package/src/tools/control-room/ui/lib/write.ts +9 -1
- package/src/tools/control-room/ui/screens/settings.tsx +103 -1
- package/src/tools/control-room/writes.ts +11 -0
|
@@ -127,6 +127,12 @@ const PALPlugin: Plugin = async ({ directory, client }: PluginInput) => {
|
|
|
127
127
|
if (isPalSpawnedInference()) return;
|
|
128
128
|
logDebug("opencode:event", `Event: ${event.type}`);
|
|
129
129
|
|
|
130
|
+
if (event.type === "server.instance.disposed") {
|
|
131
|
+
const { autoUpdateOnClose } =
|
|
132
|
+
await lib<typeof import("../../hooks/lib/auto-update")>("auto-update.ts");
|
|
133
|
+
autoUpdateOnClose();
|
|
134
|
+
}
|
|
135
|
+
|
|
130
136
|
if (event.type === "session.created" || event.type === "session.updated") {
|
|
131
137
|
const { regenerateIfNeeded } =
|
|
132
138
|
await lib<typeof import("../../hooks/lib/claude-md")>("claude-md.ts");
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* `pal cli server start|stop|status` owns the process; this file only serves.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { autoUpdateStatus, spawnAutoUpdate } from "../../hooks/lib/auto-update";
|
|
9
10
|
import { loadMachine } from "../../hooks/lib/machine";
|
|
10
11
|
import { readAllProjects } from "../../hooks/lib/projects";
|
|
11
12
|
import { isServesKind, setServes } from "../../hooks/lib/serves";
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
isQuadrant,
|
|
26
27
|
QUADRANTS,
|
|
27
28
|
readInstallSettings,
|
|
29
|
+
setAutoUpdate,
|
|
28
30
|
setIscStatus,
|
|
29
31
|
setPlacement,
|
|
30
32
|
type WriteOutcome,
|
|
@@ -255,6 +257,26 @@ async function readWrite(request: Request): Promise<Response> {
|
|
|
255
257
|
return json({ marked: markRead(ids as string[]) });
|
|
256
258
|
}
|
|
257
259
|
|
|
260
|
+
async function autoUpdateWrite(request: Request): Promise<Response> {
|
|
261
|
+
const body = await readBody(request);
|
|
262
|
+
if (!body) return json({ error: "expected a JSON body" }, 400);
|
|
263
|
+
const { enabled } = body;
|
|
264
|
+
if (typeof enabled !== "boolean") {
|
|
265
|
+
return json({ error: "enabled must be true or false" }, 400);
|
|
266
|
+
}
|
|
267
|
+
const outcome = setAutoUpdate(enabled);
|
|
268
|
+
return outcome.ok ? json(autoUpdateStatus()) : answer(outcome, {});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The button runs the update the daily gate would have run, bypassing the
|
|
273
|
+
* schedule but not the dirty-tree guard the child applies to itself.
|
|
274
|
+
*/
|
|
275
|
+
function updateNow(): Promise<Response> {
|
|
276
|
+
spawnAutoUpdate();
|
|
277
|
+
return Promise.resolve(json({ started: true }, 202));
|
|
278
|
+
}
|
|
279
|
+
|
|
258
280
|
async function prefsWrite(request: Request): Promise<Response> {
|
|
259
281
|
const body = await readBody(request);
|
|
260
282
|
if (!body) return json({ error: "expected a JSON body" }, 400);
|
|
@@ -270,6 +292,8 @@ const WRITES: Record<string, (request: Request) => Promise<Response>> = {
|
|
|
270
292
|
"/api/snooze": snoozeWrite,
|
|
271
293
|
"/api/attention/read": readWrite,
|
|
272
294
|
"/api/prefs": prefsWrite,
|
|
295
|
+
"/api/update": autoUpdateWrite,
|
|
296
|
+
"/api/update/run": updateNow,
|
|
273
297
|
};
|
|
274
298
|
|
|
275
299
|
export function startControlRoom(port: number = DEFAULT_PORT) {
|
|
@@ -312,6 +336,8 @@ export function startControlRoom(port: number = DEFAULT_PORT) {
|
|
|
312
336
|
return json(readInstallSettings());
|
|
313
337
|
case "/api/prefs":
|
|
314
338
|
return json(readPrefs());
|
|
339
|
+
case "/api/update":
|
|
340
|
+
return json(autoUpdateStatus());
|
|
315
341
|
case "/api/attention":
|
|
316
342
|
return json(attention());
|
|
317
343
|
case "/api/status":
|