@pi-unipi/kanboard 3.0.0-alpha.3 → 3.0.0-alpha.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/kanboard",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.4",
4
4
  "description": "Kanboard v3 — deferred-work board: CLI/daemon bridge, task runner and skill",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@pi-unipi/core": "3.0.0-alpha.3"
34
+ "@pi-unipi/core": "3.0.0-alpha.4"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@earendil-works/pi-coding-agent": "^0.87.1",
@@ -48,10 +48,10 @@
48
48
  "themes": []
49
49
  },
50
50
  "optionalDependencies": {
51
- "@pi-unipi/kanboard-linux-x64": "3.0.0-alpha.3",
52
- "@pi-unipi/kanboard-linux-arm64": "3.0.0-alpha.3",
53
- "@pi-unipi/kanboard-darwin-x64": "3.0.0-alpha.3",
54
- "@pi-unipi/kanboard-darwin-arm64": "3.0.0-alpha.3",
55
- "@pi-unipi/kanboard-win32-x64": "3.0.0-alpha.3"
51
+ "@pi-unipi/kanboard-linux-x64": "3.0.0-alpha.4",
52
+ "@pi-unipi/kanboard-linux-arm64": "3.0.0-alpha.4",
53
+ "@pi-unipi/kanboard-darwin-x64": "3.0.0-alpha.4",
54
+ "@pi-unipi/kanboard-darwin-arm64": "3.0.0-alpha.4",
55
+ "@pi-unipi/kanboard-win32-x64": "3.0.0-alpha.4"
56
56
  }
57
57
  }
package/src/runner.ts CHANGED
@@ -11,7 +11,7 @@ import { appendProgress } from "@pi-unipi/core";
11
11
  import { boardProgressData } from "./progress.js";
12
12
  import { hostname as osHostname } from "node:os";
13
13
  import type { ExtensionAPI, ExtensionContext, SessionEntry } from "@earendil-works/pi-coding-agent";
14
- import { callCommandRunner, readJudgeJevSettings, askJev, UNIPI_EVENTS } from "@pi-unipi/core";
14
+ import { callCommandRunner, resolveDecisionModel, askJev, registerCompactionContext, UNIPI_EVENTS } from "@pi-unipi/core";
15
15
 
16
16
  import { KanboardCliError, type KanboardCli } from "./bin.js";
17
17
  import {
@@ -260,7 +260,7 @@ export function createRunner(deps: RunnerDeps): Runner {
260
260
  }
261
261
  let jevAnswer: string | null = null;
262
262
  if (strategy === undefined) {
263
- const settings = readJudgeJevSettings(cwd);
263
+ const settings = resolveDecisionModel(cwd, "kanboard");
264
264
  const answers = await askJev({ ...strategyQuestion(task), settings, env: process.env });
265
265
  jevAnswer = answers?.strategy?.choice ?? null;
266
266
  strategy = jevAnswer !== null && jevAnswer in STRATEGY_CRITERIA ? (jevAnswer as Strategy) : "none";
@@ -705,6 +705,14 @@ ${body}`.trim() },
705
705
  return false;
706
706
  }
707
707
 
708
+ // Compaction summaries lead with the task in flight, so the agent keeps its
709
+ // task id and rules even when the original task prompt is summarized away.
710
+ registerCompactionContext("kanboard", () =>
711
+ state.phase === "running" && state.task
712
+ ? kanboardCompactionBrief(state.task, state.mode, cli.binary.path, project(), deps.settings().blocking)
713
+ : null,
714
+ );
715
+
708
716
  return {
709
717
  async work(ctx: ExtensionContext): Promise<void> {
710
718
  if (state.phase !== "idle") {
@@ -913,6 +921,27 @@ export function createDebugLog(env: NodeJS.ProcessEnv = process.env): (line: str
913
921
  };
914
922
  }
915
923
 
924
+ /** Active-work text for compaction summaries (see core registerCompactionContext). */
925
+ export function kanboardCompactionBrief(
926
+ task: KanboardTask,
927
+ mode: string | null,
928
+ binary: string,
929
+ project: string,
930
+ blocking: string,
931
+ ): string {
932
+ const body = (task.body ?? "").replace(/\s+/g, " ").trim();
933
+ const cli = `${binary} --actor agent --project ${project}`;
934
+ return [
935
+ `Kanboard task ${task.id} "${task.title}" is in progress${mode && mode !== "none" ? ` (strategy: ${mode})` : ""} — work only on this task.`,
936
+ body ? `Task: ${body.length > 600 ? `${body.slice(0, 599)}…` : body}` : "",
937
+ `Board CLI: ${cli} <command> (e.g. \`show ${task.id}\` for the full task, \`note ${task.id} "<text>"\`).`,
938
+ blocking === "ask"
939
+ ? `If you need the user: \`${cli} move ${task.id} blocked --comment "<what you need>"\`, then stop.`
940
+ : `Work autonomously; block (\`move ${task.id} blocked --comment "…"\`) only when you truly cannot continue.`,
941
+ "Do not move the task to in_review or done — the runner does that when your turn ends.",
942
+ ].filter(Boolean).join("\n");
943
+ }
944
+
916
945
  export function registerPlanEventListener(pi: ExtensionAPI, runner: Runner): void {
917
946
  pi.events.on(UNIPI_EVENTS.PLAN_MODE_CHANGED, (payload: unknown) => runner.onPlanModeChanged(payload));
918
947
  }
package/src/settings.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @pi-unipi/kanboard — settings (hub section "Kanboard").
3
3
  */
4
4
 
5
- import { getSettings, registerCommandRunner, registerSettings, setSettings } from "@pi-unipi/core";
5
+ import { getSettings, registerCommandRunner, registerSettings, setSettings, decisionModelSection, DEFAULT_DECISION_OVERRIDE } from "@pi-unipi/core";
6
6
 
7
7
  export type ChainGate = "in_review" | "done";
8
8
 
@@ -69,7 +69,7 @@ export function registerKanboardSettings(): void {
69
69
  registerSettings({
70
70
  namespace: KANBOARD_NAMESPACE,
71
71
  label: "Kanboard",
72
- defaults: DEFAULT_SETTINGS as unknown as Record<string, unknown>,
72
+ defaults: { ...DEFAULT_SETTINGS, decisionModel: DEFAULT_DECISION_OVERRIDE } as unknown as Record<string, unknown>,
73
73
  schema: [
74
74
  {
75
75
  title: "Kanboard",
@@ -160,6 +160,7 @@ export function registerKanboardSettings(): void {
160
160
  { key: "rotateToken", type: "action", label: "Rotate access token", description: "Drop the persistent token; a fresh one mints on the next daemon start", command: ACTION_ROTATE_TOKEN },
161
161
  ],
162
162
  },
163
+ decisionModelSection({ title: "Strategy — Decision model" }),
163
164
  ],
164
165
  });
165
166
  }