@netnodeag/kraftwerk 0.81.0 → 0.83.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.
Files changed (104) hide show
  1. package/README.md +227 -0
  2. package/dist/cli/boards.d.ts +2 -0
  3. package/dist/cli/boards.js +486 -0
  4. package/dist/cli/init.js +2 -0
  5. package/dist/cli/kraftwerk.js +6 -0
  6. package/dist/cli/presentations.d.ts +2 -0
  7. package/dist/cli/presentations.js +261 -0
  8. package/dist/client/routes.d.ts +32 -0
  9. package/dist/client/routes.js +32 -0
  10. package/dist/config.d.ts +35 -0
  11. package/dist/config.js +33 -2
  12. package/dist/core/attention.d.ts +2 -2
  13. package/dist/core/attention.js +22 -2
  14. package/dist/core/board-wake.d.ts +21 -0
  15. package/dist/core/board-wake.js +221 -0
  16. package/dist/core/boards.d.ts +269 -0
  17. package/dist/core/boards.js +969 -0
  18. package/dist/core/chat/acp.d.ts +1 -1
  19. package/dist/core/chat/acp.js +2 -1
  20. package/dist/core/chat/backend.d.ts +11 -0
  21. package/dist/core/chat/backend.js +9 -1
  22. package/dist/core/chat/context.js +25 -4
  23. package/dist/core/chat/pi.d.ts +1 -1
  24. package/dist/core/chat/pi.js +2 -1
  25. package/dist/core/chat/seats.js +3 -2
  26. package/dist/core/chat/sessions.d.ts +2 -0
  27. package/dist/core/chat/sessions.js +1 -0
  28. package/dist/core/chat/state.js +1 -1
  29. package/dist/core/chat/types.d.ts +11 -1
  30. package/dist/core/files.d.ts +1 -1
  31. package/dist/core/files.js +19 -1
  32. package/dist/core/git.js +5 -1
  33. package/dist/core/notifications.d.ts +1 -1
  34. package/dist/core/presentations/browser.d.ts +43 -0
  35. package/dist/core/presentations/browser.js +53 -0
  36. package/dist/core/presentations/builtin.d.ts +3 -0
  37. package/dist/core/presentations/builtin.js +142 -0
  38. package/dist/core/presentations/chart.d.ts +34 -0
  39. package/dist/core/presentations/chart.js +159 -0
  40. package/dist/core/presentations/deck.d.ts +63 -0
  41. package/dist/core/presentations/deck.js +198 -0
  42. package/dist/core/presentations/export.d.ts +21 -0
  43. package/dist/core/presentations/export.js +75 -0
  44. package/dist/core/presentations/html.d.ts +135 -0
  45. package/dist/core/presentations/html.js +389 -0
  46. package/dist/core/presentations/index.d.ts +252 -0
  47. package/dist/core/presentations/index.js +753 -0
  48. package/dist/core/presentations/layout.d.ts +47 -0
  49. package/dist/core/presentations/layout.js +147 -0
  50. package/dist/core/presentations/markdown.d.ts +49 -0
  51. package/dist/core/presentations/markdown.js +158 -0
  52. package/dist/core/presentations/merge.d.ts +26 -0
  53. package/dist/core/presentations/merge.js +28 -0
  54. package/dist/core/presentations/presence.d.ts +31 -0
  55. package/dist/core/presentations/presence.js +131 -0
  56. package/dist/core/presentations/render.d.ts +33 -0
  57. package/dist/core/presentations/render.js +318 -0
  58. package/dist/core/presentations/slots.d.ts +33 -0
  59. package/dist/core/presentations/slots.js +114 -0
  60. package/dist/core/presentations/template.d.ts +253 -0
  61. package/dist/core/presentations/template.js +141 -0
  62. package/dist/core/presentations/versions.d.ts +30 -0
  63. package/dist/core/presentations/versions.js +75 -0
  64. package/dist/core/refs.d.ts +1 -1
  65. package/dist/core/refs.js +33 -1
  66. package/dist/core/search.d.ts +22 -0
  67. package/dist/core/search.js +25 -0
  68. package/dist/core/settings.d.ts +4 -0
  69. package/dist/core/settings.js +24 -1
  70. package/dist/core/trash.d.ts +1 -1
  71. package/dist/server/api/boards.d.ts +105 -0
  72. package/dist/server/api/boards.js +160 -0
  73. package/dist/server/api/chats.d.ts +2 -0
  74. package/dist/server/api/chats.js +9 -3
  75. package/dist/server/api/index.d.ts +167 -3
  76. package/dist/server/api/index.js +4 -0
  77. package/dist/server/api/presentations.d.ts +66 -0
  78. package/dist/server/api/presentations.js +185 -0
  79. package/dist/server/api/socket.js +24 -1
  80. package/dist/server/api/workspace.d.ts +10 -0
  81. package/dist/server/api/workspace.js +4 -0
  82. package/dist/server/push.js +1 -1
  83. package/dist/server/server.js +3 -0
  84. package/package.json +6 -2
  85. package/schema/kraftwerk.schema.json +57 -0
  86. package/web/dist/assets/{dist-Ba6WSVOB.js → dist-5-ibIscm.js} +1 -1
  87. package/web/dist/assets/{dist-ENZYo2jZ.js → dist-5lgY5B-M.js} +1 -1
  88. package/web/dist/assets/{dist-BiU4F98O.js → dist-BJaPgnhj.js} +1 -1
  89. package/web/dist/assets/{dist-Dy1SvhKC.js → dist-Bar1_NBq.js} +1 -1
  90. package/web/dist/assets/{dist-AhnSw4hy.js → dist-BxCxboU8.js} +1 -1
  91. package/web/dist/assets/dist-CDitSY16.js +1 -0
  92. package/web/dist/assets/{dist-FfKYtQxT.js → dist-CRXT8IL6.js} +1 -1
  93. package/web/dist/assets/{dist-BK0VhAPQ.js → dist-CXRjiHpl.js} +1 -1
  94. package/web/dist/assets/{dist-Dx3aajX1.js → dist-CpnB7MfK.js} +1 -1
  95. package/web/dist/assets/{dist-8IOFzZx-.js → dist-D1VK1YdB.js} +1 -1
  96. package/web/dist/assets/{dist-cewmjxFi.js → dist-D52LvyO8.js} +1 -1
  97. package/web/dist/assets/{editor-CZMrhTTL.css → editor-C0_Snnzk.css} +1 -1
  98. package/web/dist/assets/{editor-CaRa1NMC.js → editor-HCNTXWWs.js} +3 -3
  99. package/web/dist/assets/index-Dnlu16AL.css +2 -0
  100. package/web/dist/assets/index-kwWnQOhD.js +473 -0
  101. package/web/dist/index.html +2 -2
  102. package/web/dist/assets/dist-lgUK2Fjt.js +0 -1
  103. package/web/dist/assets/index-Dpzux3OC.js +0 -231
  104. package/web/dist/assets/index-Dvt-vE1h.css +0 -2
@@ -1,6 +1,6 @@
1
1
  import { type ContentBlock, type SessionConfigOption, type SessionNotification } from "@agentclientprotocol/sdk";
2
2
  import { type AcpAgent, type AcpExtensionNotification } from "../../acp.js";
3
- import type { BackendHooks, BackendTuning, ChatBackend, PromptFile } from "./backend.js";
3
+ import { type BackendHooks, type BackendTuning, type ChatBackend, type PromptFile } from "./backend.js";
4
4
  import type { AuthStatus, ChatEvent, ConfigOption, ElicitationField, SessionFailure } from "./types.js";
5
5
  /** The session failure a `session_info_update` carries, if it is one (AIR `sessionFailure` in `_meta`). */
6
6
  export declare function failureOf(meta: unknown): SessionFailure | undefined;
@@ -3,6 +3,7 @@ import { promises as fs } from "node:fs";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { RequestError, } from "@agentclientprotocol/sdk";
5
5
  import { adapterEnv, airMeta, connectAcp, EXT_METHODS, EXT_NOTIFICATIONS, fileChangeReportMeta, openSession, withAdapter, } from "../../acp.js";
6
+ import { identityEnv } from "./backend.js";
6
7
  import { tempEnv } from "../temp.js";
7
8
  import { unattendedMode } from "./permissions.js";
8
9
  /**
@@ -390,7 +391,7 @@ export async function startAcpBackend(agent, cwd, hooks, tuning = {}) {
390
391
  };
391
392
  const { child, conn } = await connectAcp(agent, {
392
393
  cwd,
393
- env: { ...adapterEnv(agent, tuning), ...(tuning.temp ? tempEnv(tuning.temp) : {}) },
394
+ env: { ...adapterEnv(agent, tuning), ...(tuning.temp ? tempEnv(tuning.temp) : {}), ...identityEnv(agent, tuning) },
394
395
  client,
395
396
  clientName: "kraftwerk-inspector",
396
397
  elicitation: true,
@@ -39,6 +39,8 @@ export interface BackendTuning {
39
39
  addDirs?: string[];
40
40
  /** The session's scratch folder (core/temp.ts): handed to the process as TMPDIR and KRAFTWERK_TEMP. */
41
41
  temp?: string;
42
+ /** The agent this seat is (its slug), handed to the process as KRAFTWERK_AGENT, with KRAFTWERK_ACTOR = <slug>/<harness>; absent for a project assistant or Ralv. */
43
+ agent?: string;
42
44
  /**
43
45
  * Nobody is watching this session live (routine runs). The backend selects
44
46
  * the harness's own hands-off permission mode — the harness keeps deciding
@@ -48,6 +50,15 @@ export interface BackendTuning {
48
50
  /** ACP agents: the session id to continue (from ChatMeta.sessions) instead of opening a new one. */
49
51
  resume?: string;
50
52
  }
53
+ /**
54
+ * Who the process is, for the CLI it runs: `kraftwerk tasks pick`, `tasks log`,
55
+ * `journal` and `knowledge put` read KRAFTWERK_AGENT / KRAFTWERK_ACTOR so an
56
+ * agent never has to name itself. A seat that is no agent (a project
57
+ * assistant, Ralv) is the actor `kraftwerk-chat/<harness>` — the name its
58
+ * context already tells it to write with — and has no KRAFTWERK_AGENT, so
59
+ * `tasks pick` still asks who picks.
60
+ */
61
+ export declare const identityEnv: (harness: string, tuning: BackendTuning) => Record<string, string>;
51
62
  /**
52
63
  * How a turn ended. `failure` is the typed session failure the agent
53
64
  * attached to the turn's own outcome (a usage limit, a rate limit, a
@@ -1 +1,9 @@
1
- export {};
1
+ /**
2
+ * Who the process is, for the CLI it runs: `kraftwerk tasks pick`, `tasks log`,
3
+ * `journal` and `knowledge put` read KRAFTWERK_AGENT / KRAFTWERK_ACTOR so an
4
+ * agent never has to name itself. A seat that is no agent (a project
5
+ * assistant, Ralv) is the actor `kraftwerk-chat/<harness>` — the name its
6
+ * context already tells it to write with — and has no KRAFTWERK_AGENT, so
7
+ * `tasks pick` still asks who picks.
8
+ */
9
+ export const identityEnv = (harness, tuning) => tuning.agent ? { KRAFTWERK_AGENT: tuning.agent, KRAFTWERK_ACTOR: `${tuning.agent}/${harness}` } : { KRAFTWERK_ACTOR: `kraftwerk-chat/${harness}` };
@@ -8,6 +8,8 @@ import { listRepos } from "../repos.js";
8
8
  import { listVibeables, vibeableStatus, VIBEABLE_CONFIG_FILE } from "../vibeables.js";
9
9
  import { projectContext } from "../projects.js";
10
10
  import { entitiesContext } from "../entities.js";
11
+ import { boardsContext, taskContext } from "../boards.js";
12
+ import { presentationsContext } from "../presentations/index.js";
11
13
  import { unattendedTimeoutLabel } from "./permissions.js";
12
14
  import { getChannel } from "../channels.js";
13
15
  import { JOURNAL_FILE, journalExcerpt, readJournal } from "../journal.js";
@@ -275,8 +277,9 @@ async function baseScopeContext(scope, agent) {
275
277
  (await agentFilesContext(def)) +
276
278
  `The working directory is the project root. Stay within your role; if a request is clearly outside it, ` +
277
279
  `say so and suggest which agent or tool fits better.` +
278
- (scope.routine
279
- ? `\n\nThis session was started automatically by your scheduled routine "${scope.routine}" — ` +
280
+ (scope.task ? `\n\n${await taskContext(scope.task)}` : "") +
281
+ (scope.routine || scope.task
282
+ ? `\n\nThis session was started automatically by ${scope.routine ? `your scheduled routine "${scope.routine}"` : `the board: task ${scope.task} was given to you`} — ` +
280
283
  `nobody may be watching live. Complete the task autonomously. Edits inside the project ` +
281
284
  `need no approval; anything your harness asks about (shell commands, network, files ` +
282
285
  `outside the project) is shown to a human who may look later — say in one line why you ` +
@@ -394,7 +397,7 @@ export async function scopeContext(meta, seat) {
394
397
  const agent = seat.harness;
395
398
  // The repositories block reads every clone from git, so it runs alongside
396
399
  // the rest instead of adding its spawns to the first prompt's latency.
397
- const [base, repos, vibe, skills, channel, project, entities] = await Promise.all([
400
+ const [base, repos, vibe, skills, channel, project, entities, boards, decks] = await Promise.all([
398
401
  baseScopeContext(scope, agent),
399
402
  scope.kind === "agent" || scope.kind === "kraftwerk" ? reposContext() : Promise.resolve(""),
400
403
  meta.vibeable ? vibeableContext(meta.vibeable, meta.cwd) : Promise.resolve(""),
@@ -404,11 +407,29 @@ export async function scopeContext(meta, seat) {
404
407
  meta.scope.kind === "channel" && meta.project ? projectContext(meta.project, `${seat.key}/${agent}`, { member: true }) : Promise.resolve(""),
405
408
  // Who, where and when: the workspace's contacts, places and events, wherever the chat works (a run discusses its own artifacts only).
406
409
  scope.kind === "run" ? Promise.resolve("") : entitiesContext().catch(() => ""),
410
+ // Boards: a project chat sees the project's boards; an agent sees the workspace boards narrowed to its tasks, plus its project's when filed under one.
411
+ scope.kind === "project"
412
+ ? boardsContext(scope.slug, `kraftwerk-chat/${agent}`).catch(() => "")
413
+ : scope.kind === "agent"
414
+ ? Promise.all([boardsContext(undefined, `${scope.slug}/${agent}`, scope.slug), meta.project ? boardsContext(meta.project, `${scope.slug}/${agent}`, scope.slug) : Promise.resolve("")])
415
+ .then((xs) => xs.filter(Boolean).join("\n\n"))
416
+ .catch(() => "")
417
+ : Promise.resolve(""),
418
+ // Presentations: a project chat sees the project's decks; an agent the workspace's, plus its project's when filed under one.
419
+ scope.kind === "project"
420
+ ? presentationsContext(scope.slug).catch(() => "")
421
+ : scope.kind === "agent"
422
+ ? Promise.all([presentationsContext(undefined), meta.project ? presentationsContext(meta.project) : Promise.resolve("")])
423
+ .then((xs) => xs.filter(Boolean).join("\n\n"))
424
+ .catch(() => "")
425
+ : Promise.resolve(""),
407
426
  ]);
408
427
  // Every session has a scratch folder of its own (core/temp.ts), named by its absolute path: a run chat or a
409
428
  // vibeable session works in another folder than the workspace root. The block comes after the files blocks it refers to.
410
429
  const temp = await sessionTemp(meta.id).catch(() => null);
411
- return [base, channel, project, repos, entities, vibe, temp ? tempContext(temp.abs) : "", RENDERING_BLOCK, skillsBlock(skills)].filter(Boolean).join("\n\n");
430
+ // "Work on this" from a task page: the chat is tagged with the task (meta.task) and reads it like the agent's own task session would.
431
+ const task = meta.task && !(scope.kind === "agent" && scope.task === meta.task) ? await taskContext(meta.task).catch(() => "") : "";
432
+ return [base, channel, project, boards, task, decks, repos, entities, vibe, temp ? tempContext(temp.abs) : "", RENDERING_BLOCK, skillsBlock(skills)].filter(Boolean).join("\n\n");
412
433
  }
413
434
  /** The channel block a member agent gets once per process: who is here, how turns work, how to hand over. */
414
435
  async function channelContext(slug, self) {
@@ -1,2 +1,2 @@
1
- import type { BackendHooks, BackendTuning, ChatBackend } from "./backend.js";
1
+ import { type BackendHooks, type BackendTuning, type ChatBackend } from "./backend.js";
2
2
  export declare function startPiBackend(cwd: string, hooks: BackendHooks, tuning?: BackendTuning): ChatBackend;
@@ -1,5 +1,6 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { randomUUID } from "node:crypto";
3
+ import { identityEnv } from "./backend.js";
3
4
  import { workspaceEnv } from "../env.js";
4
5
  import { tempEnv } from "../temp.js";
5
6
  const clip = (raw) => {
@@ -25,7 +26,7 @@ export function startPiBackend(cwd, hooks, tuning = {}) {
25
26
  const proc = spawn("pi", ["-p", "--mode", "json", "--session-id", sessionId, ...tuningArgs], {
26
27
  cwd,
27
28
  stdio: ["pipe", "pipe", "pipe"],
28
- env: { ...workspaceEnv(), ...(tuning.temp ? tempEnv(tuning.temp) : {}) },
29
+ env: { ...workspaceEnv(), ...(tuning.temp ? tempEnv(tuning.temp) : {}), ...identityEnv("pi", tuning) },
29
30
  });
30
31
  child = proc;
31
32
  proc.stdin.write(text);
@@ -23,6 +23,7 @@ async function backendTuning(meta, seat) {
23
23
  const tuning = {};
24
24
  const agentSlug = scope.kind === "agent" ? scope.slug : scope.kind === "channel" ? seat.key : undefined;
25
25
  if (agentSlug) {
26
+ tuning.agent = agentSlug;
26
27
  const def = await getAgent(agentSlug).catch(() => null);
27
28
  if (def?.model)
28
29
  tuning.model = def.model;
@@ -106,7 +107,7 @@ export async function ensureBackend(state, seat) {
106
107
  });
107
108
  if (!state.pendingInfo.has(requestId))
108
109
  await dismissKey(notifyKey);
109
- });
110
+ }).catch(() => { });
110
111
  if (isUnattended(state.meta.scope)) {
111
112
  deadline = setTimeout(() => {
112
113
  const pending = state.pendingPermissions.get(requestId);
@@ -157,7 +158,7 @@ export async function ensureBackend(state, seat) {
157
158
  });
158
159
  if (!state.pendingInfo.has(requestId))
159
160
  await dismissKey(notifyKey);
160
- });
161
+ }).catch(() => { });
161
162
  if (isUnattended(state.meta.scope)) {
162
163
  deadline = setTimeout(() => {
163
164
  const pending = state.pendingElicitations.get(requestId);
@@ -30,6 +30,8 @@ export declare function createChat(opts: {
30
30
  resume?: string;
31
31
  /** The project an agent's chat works in (meta.project); the caller checks that it exists. */
32
32
  project?: string;
33
+ /** The board task the chat works on (meta.task); the caller checks that it exists. */
34
+ task?: string;
33
35
  /** Who starts it; default this machine's person. */
34
36
  author?: ChatPerson;
35
37
  /** A private routine's run: hidden from remote callers (meta.private). */
@@ -55,6 +55,7 @@ export async function createChat(opts) {
55
55
  cwd,
56
56
  scope: opts.scope,
57
57
  ...(opts.project && opts.scope.kind === "agent" ? { project: opts.project } : {}),
58
+ ...(opts.task ? { task: opts.task } : {}),
58
59
  ...(opts.resume && opts.agent !== "pi" ? { sessions: { [MAIN]: opts.resume } } : {}),
59
60
  author,
60
61
  ...(opts.private ? { private: true } : {}),
@@ -29,7 +29,7 @@ export const isBusy = (state) => [...state.seats.values()].some((s) => s.busy);
29
29
  /** The event author for a seat: channel members sign their events, the lone agent of a chat does not. */
30
30
  export const seatAuthor = (seat) => (seat.key === MAIN ? undefined : { kind: "agent", slug: seat.key });
31
31
  /** Routine-fired sessions: nobody is expected to be watching live. */
32
- export const isUnattended = (scope) => scope.kind === "agent" && !!scope.routine;
32
+ export const isUnattended = (scope) => scope.kind === "agent" && (!!scope.routine || !!scope.task);
33
33
  /** Diagnose handle for a failed routine session (only called for unattended agent scopes). */
34
34
  export function routineRef(meta) {
35
35
  const scope = meta.scope;
@@ -16,10 +16,13 @@ export type ChatScope = {
16
16
  } | {
17
17
  kind: "knowledge";
18
18
  bundle?: string;
19
- } | {
19
+ }
20
+ /** `routine`: a scheduled run; `task`: opened for a task (<project>/<board>/<task>) the agent was assigned — both unattended. */
21
+ | {
20
22
  kind: "agent";
21
23
  slug: string;
22
24
  routine?: string;
25
+ task?: string;
23
26
  }
24
27
  /** A project: the chat carries its brief, state, systems of record and links; see projects.ts. */
25
28
  | {
@@ -64,6 +67,13 @@ export interface ChatMeta {
64
67
  * the project and hands every seat the project's context.
65
68
  */
66
69
  project?: string;
70
+ /**
71
+ * The board task this chat works on (<project>/<board>/<task> or
72
+ * <board>/<task>) when the scope is not the agent's task session itself:
73
+ * "work on this" from the task page. The task page lists the chat as one
74
+ * of its sessions, and every seat gets the task block in its context.
75
+ */
76
+ task?: string;
67
77
  /**
68
78
  * The agent's own session id per seat ("main", or the agent slug in a
69
79
  * channel): after a restart or the idle reaper, the next backend resumes
@@ -19,7 +19,7 @@ export declare const PROJECT_FILES_DIR = "files";
19
19
  export declare const LOCAL_OVER_BYTES: number;
20
20
  /** Upload cap: a guard against a runaway request, not a policy. */
21
21
  export declare const MAX_UPLOAD_BYTES: number;
22
- /** "workspace" or "project:<slug>". */
22
+ /** "workspace", "project:<slug>" or "task:<board>/<task>" / "task:<project>/<board>/<task>" (a task's folder). */
23
23
  export type FilesScope = string;
24
24
  export interface FileEntry {
25
25
  name: string;
@@ -3,6 +3,7 @@ import path from "node:path";
3
3
  import { pipeline } from "node:stream/promises";
4
4
  import { resolveWorkspace } from "../config.js";
5
5
  import { workspaceRoot } from "./context.js";
6
+ import { findTask, noteTaskFile, TASK_FILE, TASK_LOG } from "./boards.js";
6
7
  import { listProjects, openProjects, safeProjectSlug } from "./projects.js";
7
8
  import { moveToTrash } from "./trash.js";
8
9
  /**
@@ -66,6 +67,13 @@ export async function scopeRoot(scope) {
66
67
  const abs = path.join(workspace, WORKSPACE_FILES_DIR);
67
68
  return { abs, rel: WORKSPACE_FILES_DIR, label: "Workspace", workspace };
68
69
  }
70
+ const task = /^task:(.+)$/.exec(scope);
71
+ if (task) {
72
+ const t = await findTask(task[1]);
73
+ if (!t)
74
+ throw new Error(`no task "${task[1]}"`);
75
+ return { abs: t.path, rel: path.relative(workspace, t.path).split(path.sep).join("/"), label: `${t.number} ${t.title}`, workspace };
76
+ }
69
77
  const m = /^project:(.+)$/.exec(scope);
70
78
  if (!m)
71
79
  throw new Error(`invalid files scope "${scope}"`);
@@ -153,9 +161,13 @@ export async function listFiles(scope, rel = "") {
153
161
  const local = new Set(await readIgnore(root.abs));
154
162
  const kids = st ? await fs.readdir(dir, { withFileTypes: true }) : [];
155
163
  const entries = [];
164
+ const taskScope = scope.startsWith("task:");
156
165
  for (const k of kids) {
157
166
  if (k.name.startsWith("."))
158
167
  continue;
168
+ // A task's own markdown and log are the task, not its files.
169
+ if (taskScope && dir === root.abs && (k.name === TASK_FILE || k.name === TASK_LOG))
170
+ continue;
159
171
  const abs = path.join(dir, k.name);
160
172
  const s = await fs.stat(abs).catch(() => null);
161
173
  if (!s)
@@ -228,6 +240,8 @@ export async function saveUpload(scope, dirRel, name, body) {
228
240
  const p = toPosix(path.relative(root.abs, abs));
229
241
  if (size > LOCAL_OVER_BYTES)
230
242
  await markLocal(root.abs, p, true);
243
+ if (scope.startsWith("task:"))
244
+ await noteTaskFile(scope.slice(5), "added", p).catch(() => { });
231
245
  return { name: final, path: p, type: "file", size, modifiedAt: new Date().toISOString(), mime: mimeOf(final), ...(size > LOCAL_OVER_BYTES ? { local: true } : {}) };
232
246
  }
233
247
  export async function makeFolder(scope, rel) {
@@ -271,10 +285,14 @@ export async function deleteFile(scope, rel) {
271
285
  if (!st)
272
286
  throw new Error(`no file "${rel}"`);
273
287
  const p = toPosix(path.relative(root.abs, abs));
274
- const owner = scope === "workspace" ? "workspace" : `projects/${scope.slice("project:".length)}`;
288
+ if (scope.startsWith("task:") && (p === TASK_FILE || p === TASK_LOG))
289
+ throw new Error("the task's own files cannot be removed");
290
+ const owner = scope === "workspace" ? "workspace" : scope.startsWith("task:") ? `tasks/${scope.slice(5)}` : `projects/${scope.slice("project:".length)}`;
275
291
  await moveToTrash("files", `${owner}/${p}`, abs);
276
292
  if (st.isFile() && st.size > LOCAL_OVER_BYTES)
277
293
  await markLocal(root.abs, p, false);
294
+ if (scope.startsWith("task:"))
295
+ await noteTaskFile(scope.slice(5), "removed", p).catch(() => { });
278
296
  }
279
297
  /* ---------- context for agents ---------- */
280
298
  /** "files/ (23 files; recent: designs/home-v3.png 2026-10-05, …)" — where the files are, not every file. */
package/dist/core/git.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { realpathSync } from "node:fs";
3
3
  import path from "node:path";
4
- import { ENTITY_KINDS, entitiesRootFor, projectsRootFor, reposRootFor, resolveWorkspace, vibeablesRootFor, isSafeGitName } from "../config.js";
4
+ import { boardsRootFor, presentationsRootFor, ENTITY_KINDS, entitiesRootFor, projectsRootFor, reposRootFor, resolveWorkspace, vibeablesRootFor, isSafeGitName } from "../config.js";
5
5
  import { ENV_FILE } from "../runner/docker.js";
6
6
  import { getOutputDir, workspaceRoot } from "./context.js";
7
7
  import { perWorkspace, workspaceOpen } from "./workspace.js";
@@ -241,6 +241,10 @@ function scopeFor({ project, repoRoot }) {
241
241
  projectsRootFor(project),
242
242
  // Contacts, places and events: who, where and when — the workspace's records.
243
243
  ...ENTITY_KINDS.map((kind) => entitiesRootFor(project, kind)),
244
+ // Workspace boards: tasks, logs and their files (project boards sit inside the projects root).
245
+ boardsRootFor(project),
246
+ // Workspace presentations: decks, their assets and templates (project decks sit inside the projects root).
247
+ presentationsRootFor(project),
244
248
  // Workspace files: shared material, versioned (files over 25 MB ignore themselves, see files.ts).
245
249
  path.resolve(project.root, "kraftwerk-data/files"),
246
250
  project.configPath,
@@ -10,7 +10,7 @@ import type { ChatMeta } from "./chat/types.js";
10
10
  * Approval items carry a `key` so the same request is never listed twice
11
11
  * and disappears again the moment someone answers (dismissKey).
12
12
  */
13
- export type NotificationKind = "approval" | "routine_done" | "routine_failed" | "run_done" | "run_failed";
13
+ export type NotificationKind = "approval" | "routine_done" | "routine_failed" | "run_done" | "run_failed" | "task_woken" | "task_wake_failed";
14
14
  /**
15
15
  * What a "diagnose" on a failure item should look at: a workflow run (chat
16
16
  * in the run folder) or a routine (its agent, and the session that failed
@@ -0,0 +1,43 @@
1
+ /**
2
+ * A headless browser for the exports that need the HTML drawn: slide PNGs
3
+ * (what an agent looks at), the PDF, and the HTML pieces of a PowerPoint
4
+ * file. playwright-core drives it — its own downloaded Chromium when the
5
+ * machine has one (`npx playwright install chromium`), else the installed
6
+ * Google Chrome. Without either, callers fall back to the PowerPoint
7
+ * model's raster (core/presentations/export.ts) and say so.
8
+ */
9
+ type Page = {
10
+ setViewportSize(s: {
11
+ width: number;
12
+ height: number;
13
+ }): Promise<void>;
14
+ goto(url: string, o?: {
15
+ waitUntil?: "load" | "networkidle";
16
+ }): Promise<unknown>;
17
+ emulateMedia(o: {
18
+ media: "print" | "screen";
19
+ }): Promise<void>;
20
+ locator(sel: string): {
21
+ nth(i: number): {
22
+ screenshot(o?: {
23
+ type?: "png";
24
+ omitBackground?: boolean;
25
+ }): Promise<Buffer>;
26
+ };
27
+ count(): Promise<number>;
28
+ };
29
+ pdf(o: Record<string, unknown>): Promise<Buffer>;
30
+ evaluate<T>(fn: () => T | Promise<T>): Promise<T>;
31
+ };
32
+ /** Why the last launch failed (for the fallback's warning). */
33
+ export declare const browserProblem: () => string;
34
+ /**
35
+ * Open a standalone deck HTML (from html.ts) in print layout — every slide
36
+ * stacked at its stage size, no scaling — and hand the page over. Null
37
+ * when no browser can be started.
38
+ */
39
+ export declare function withDeckPage<T>(html: string, size: {
40
+ width: number;
41
+ height: number;
42
+ }, fn: (page: Page) => Promise<T>): Promise<T | null>;
43
+ export {};
@@ -0,0 +1,53 @@
1
+ import { promises as fs } from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import { pathToFileURL } from "node:url";
5
+ let reason = "";
6
+ /** Why the last launch failed (for the fallback's warning). */
7
+ export const browserProblem = () => reason;
8
+ async function launch() {
9
+ let pw;
10
+ try {
11
+ pw = (await import("playwright-core"));
12
+ }
13
+ catch {
14
+ reason = "playwright-core is not installed";
15
+ return null;
16
+ }
17
+ const errors = [];
18
+ for (const opts of [{}, { channel: "chrome" }, { channel: "msedge" }]) {
19
+ try {
20
+ return await pw.chromium.launch({ headless: true, ...opts });
21
+ }
22
+ catch (err) {
23
+ errors.push(err.message.split("\n")[0]);
24
+ }
25
+ }
26
+ reason = `no browser to render with (run \`npx playwright install chromium\` or install Google Chrome): ${errors[0] ?? ""}`;
27
+ return null;
28
+ }
29
+ /**
30
+ * Open a standalone deck HTML (from html.ts) in print layout — every slide
31
+ * stacked at its stage size, no scaling — and hand the page over. Null
32
+ * when no browser can be started.
33
+ */
34
+ export async function withDeckPage(html, size, fn) {
35
+ const browser = await launch();
36
+ if (!browser)
37
+ return null;
38
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), "kraftwerk-deck-"));
39
+ const file = path.join(dir, "deck.html");
40
+ try {
41
+ await fs.writeFile(file, html);
42
+ const page = await browser.newPage();
43
+ await page.setViewportSize(size);
44
+ await page.emulateMedia({ media: "print" });
45
+ await page.goto(pathToFileURL(file).href, { waitUntil: "load" });
46
+ await page.evaluate(() => document.fonts.ready.then(() => true));
47
+ return await fn(page);
48
+ }
49
+ finally {
50
+ await browser.close().catch(() => { });
51
+ await fs.rm(dir, { recursive: true, force: true }).catch(() => { });
52
+ }
53
+ }
@@ -0,0 +1,3 @@
1
+ import type { Template } from "./template.js";
2
+ export declare const DEFAULT_CSS = "/* kraftwerk default theme: the slides' look. Scoped to the slide; every class here can be used in a slot's HTML. */\n.eyebrow { text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; }\n.statement { letter-spacing: -0.02em; line-height: 1.15; }\n.muted { color: var(--c-muted); }\n.accent { color: var(--c-accent); }\n.small { font-size: 0.8em; }\n\n.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0.9em; }\n.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 0.5em; padding: 0.9em 1em; }\n.card h3 { font-size: 1em; margin: 0 0 0.3em; }\n.card p { color: var(--c-muted); font-size: 0.82em; line-height: 1.35; }\n.card .num { display: block; font-size: 1.6em; font-weight: 700; color: var(--c-accent); line-height: 1; margin-bottom: 0.35em; letter-spacing: -0.02em; }\n\n.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1.2em; }\n.kpi { border-top: 3px solid var(--c-accent); padding-top: 0.5em; }\n.kpi strong { display: block; font-family: var(--font-heading); font-size: 2.4em; line-height: 1; letter-spacing: -0.03em; }\n.kpi span { display: block; margin-top: 0.35em; color: var(--c-muted); font-size: 0.8em; }\n\n.flow { display: flex; align-items: stretch; gap: 0.6em; }\n.flow .arrow { align-self: center; color: var(--c-muted); font-size: 1.3em; }\n.box { flex: 1; border-radius: 0.5em; padding: 0.8em 0.9em; font-weight: 600; display: flex; flex-direction: column; justify-content: center; font-size: 0.9em; }\n.box small { display: block; font-weight: 400; color: var(--c-muted); font-size: 0.8em; margin-top: 0.25em; }\n.box.ghost { border: 1px dashed #c3c2b7; color: var(--c-muted); }\n.box.solid { border: 1px solid var(--c-line); background: var(--c-surface); }\n.box.accent { border: 1px solid var(--c-accent); background: color-mix(in srgb, var(--c-accent) 10%, transparent); }\n\n.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1.6em; }\n.cols h3 { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-accent); margin-bottom: 0.4em; }\n.cols p { font-size: 0.9em; }\n\n.timeline { list-style: none; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.8em; border-top: 2px solid var(--c-line); }\n.timeline li { position: relative; padding-top: 0.9em; margin: 0; }\n.timeline li::before { content: \"\"; position: absolute; top: -0.42em; left: 0; width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--c-accent); }\n.timeline b { display: block; color: var(--c-accent); }\n.timeline span { display: block; font-size: 0.82em; color: var(--c-muted); margin-top: 0.2em; }\n\n.callout { border-left: 4px solid var(--c-accent); background: color-mix(in srgb, var(--c-accent) 8%, transparent); padding: 0.7em 1em; border-radius: 0 0.4em 0.4em 0; }\n.pill { display: inline-block; border: 1px solid var(--c-line); border-radius: 999px; padding: 0.15em 0.65em; font-size: 0.75em; color: var(--c-muted); }\n.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2em; }\n.compare > div { border-radius: 0.5em; padding: 0.9em 1em; background: var(--c-surface); border: 1px solid var(--c-line); }\n.compare > div:last-child { border-color: var(--c-accent); }\n.compare h3 { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5em; }\n\n/* The slide number, bottom right, on every slide but the title and section slides. */\n&[data-nn]:not(.layout-title):not(.layout-section)::after { content: attr(data-nn); position: absolute; right: 72px; bottom: 30px; font-size: 18px; color: var(--c-muted); font-variant-numeric: tabular-nums; }\n";
3
+ export declare const DEFAULT_TEMPLATE: Template;
@@ -0,0 +1,142 @@
1
+ /**
2
+ * The built-in template: a calm, light look (warm page, ink, one accent,
3
+ * hairlines) with ten layouts on a 16:9 canvas, the theme CSS that styles
4
+ * the HTML slides, and snippets for the editor's insert menu. Workspace
5
+ * templates copy its shape (`kraftwerk presentations templates init`).
6
+ */
7
+ const slot = (kind, x, y, w, h, more = {}) => ({ kind, x, y, w, h, ...more });
8
+ /** The head of a content slide: the title, a small label at the right, a hairline under both. */
9
+ const head = () => ({
10
+ slots: {
11
+ title: slot("text", 0.44, 0.28, 7.3, 0.8, { size: 24, bold: true, font: "heading", color: "text", valign: "bottom", placeholder: "Title" }),
12
+ eyebrow: slot("text", 7.74, 0.28, 1.82, 0.8, { size: 9, color: "muted", align: "right", valign: "bottom", class: "eyebrow", placeholder: "Label" }),
13
+ },
14
+ shapes: [{ kind: "rect", x: 0.54, y: 1.12, w: 8.92, h: 0.012, fill: "line" }],
15
+ });
16
+ const withHead = (description, slots, extra = {}) => {
17
+ const h = head();
18
+ return { description, shapes: h.shapes, slots: { ...h.slots, ...slots }, ...extra };
19
+ };
20
+ export const DEFAULT_CSS = `/* kraftwerk default theme: the slides' look. Scoped to the slide; every class here can be used in a slot's HTML. */
21
+ .eyebrow { text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; }
22
+ .statement { letter-spacing: -0.02em; line-height: 1.15; }
23
+ .muted { color: var(--c-muted); }
24
+ .accent { color: var(--c-accent); }
25
+ .small { font-size: 0.8em; }
26
+
27
+ .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0.9em; }
28
+ .card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 0.5em; padding: 0.9em 1em; }
29
+ .card h3 { font-size: 1em; margin: 0 0 0.3em; }
30
+ .card p { color: var(--c-muted); font-size: 0.82em; line-height: 1.35; }
31
+ .card .num { display: block; font-size: 1.6em; font-weight: 700; color: var(--c-accent); line-height: 1; margin-bottom: 0.35em; letter-spacing: -0.02em; }
32
+
33
+ .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1.2em; }
34
+ .kpi { border-top: 3px solid var(--c-accent); padding-top: 0.5em; }
35
+ .kpi strong { display: block; font-family: var(--font-heading); font-size: 2.4em; line-height: 1; letter-spacing: -0.03em; }
36
+ .kpi span { display: block; margin-top: 0.35em; color: var(--c-muted); font-size: 0.8em; }
37
+
38
+ .flow { display: flex; align-items: stretch; gap: 0.6em; }
39
+ .flow .arrow { align-self: center; color: var(--c-muted); font-size: 1.3em; }
40
+ .box { flex: 1; border-radius: 0.5em; padding: 0.8em 0.9em; font-weight: 600; display: flex; flex-direction: column; justify-content: center; font-size: 0.9em; }
41
+ .box small { display: block; font-weight: 400; color: var(--c-muted); font-size: 0.8em; margin-top: 0.25em; }
42
+ .box.ghost { border: 1px dashed #c3c2b7; color: var(--c-muted); }
43
+ .box.solid { border: 1px solid var(--c-line); background: var(--c-surface); }
44
+ .box.accent { border: 1px solid var(--c-accent); background: color-mix(in srgb, var(--c-accent) 10%, transparent); }
45
+
46
+ .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1.6em; }
47
+ .cols h3 { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-accent); margin-bottom: 0.4em; }
48
+ .cols p { font-size: 0.9em; }
49
+
50
+ .timeline { list-style: none; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.8em; border-top: 2px solid var(--c-line); }
51
+ .timeline li { position: relative; padding-top: 0.9em; margin: 0; }
52
+ .timeline li::before { content: ""; position: absolute; top: -0.42em; left: 0; width: 0.7em; height: 0.7em; border-radius: 50%; background: var(--c-accent); }
53
+ .timeline b { display: block; color: var(--c-accent); }
54
+ .timeline span { display: block; font-size: 0.82em; color: var(--c-muted); margin-top: 0.2em; }
55
+
56
+ .callout { border-left: 4px solid var(--c-accent); background: color-mix(in srgb, var(--c-accent) 8%, transparent); padding: 0.7em 1em; border-radius: 0 0.4em 0.4em 0; }
57
+ .pill { display: inline-block; border: 1px solid var(--c-line); border-radius: 999px; padding: 0.15em 0.65em; font-size: 0.75em; color: var(--c-muted); }
58
+ .compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2em; }
59
+ .compare > div { border-radius: 0.5em; padding: 0.9em 1em; background: var(--c-surface); border: 1px solid var(--c-line); }
60
+ .compare > div:last-child { border-color: var(--c-accent); }
61
+ .compare h3 { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5em; }
62
+
63
+ /* The slide number, bottom right, on every slide but the title and section slides. */
64
+ &[data-nn]:not(.layout-title):not(.layout-section)::after { content: attr(data-nn); position: absolute; right: 72px; bottom: 30px; font-size: 18px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
65
+ `;
66
+ export const DEFAULT_TEMPLATE = {
67
+ slug: "default",
68
+ name: "Default",
69
+ builtin: true,
70
+ size: "16:9",
71
+ fonts: { heading: "Helvetica Neue", body: "Helvetica Neue" },
72
+ colors: { background: "#F9F9F7", surface: "#FFFFFF", text: "#161310", muted: "#6F6D67", accent: "#0284C7", onAccent: "#FFFFFF", line: "#E1E0D9" },
73
+ default: "content",
74
+ cssText: DEFAULT_CSS,
75
+ layouts: {
76
+ title: {
77
+ description: "Opening slide: a big title with a line above and a footer",
78
+ shapes: [{ kind: "rect", x: 0.54, y: 4.72, w: 8.92, h: 0.012, fill: "line" }],
79
+ slots: {
80
+ kicker: slot("text", 0.44, 1.45, 9.12, 0.5, { size: 13, color: "muted", placeholder: "What this is about" }),
81
+ title: slot("text", 0.44, 1.95, 9.12, 1.75, { size: 50, bold: true, font: "heading", color: "text", valign: "top", required: true, class: "statement", placeholder: "Title" }),
82
+ subtitle: slot("text", 0.44, 3.7, 9.12, 0.6, { size: 16, color: "muted", placeholder: "Subtitle" }),
83
+ foot: slot("text", 0.44, 4.8, 9.12, 0.5, { size: 10, color: "muted", placeholder: "Who · where · when" }),
84
+ },
85
+ },
86
+ section: {
87
+ description: "Divider between parts, on dark",
88
+ background: "text",
89
+ shapes: [{ kind: "rect", x: 0.54, y: 2.1, w: 0.9, h: 0.05, fill: "accent" }],
90
+ slots: {
91
+ eyebrow: slot("text", 0.44, 1.6, 9.12, 0.45, { size: 11, color: "accent", class: "eyebrow", placeholder: "Part 1" }),
92
+ title: slot("text", 0.44, 2.3, 9.12, 1.4, { size: 40, bold: true, font: "heading", color: "background", valign: "top", required: true, class: "statement", placeholder: "Section title" }),
93
+ },
94
+ },
95
+ content: withHead("Title and a body of text, lists or HTML", {
96
+ body: slot("markdown", 0.44, 1.32, 9.12, 3.95, { size: 15, color: "text", required: true, placeholder: "The slide's text, lists or a table" }),
97
+ }),
98
+ statement: {
99
+ description: "One sentence that carries the slide",
100
+ shapes: [],
101
+ slots: {
102
+ eyebrow: slot("text", 0.44, 1.2, 9.12, 0.45, { size: 11, color: "accent", class: "eyebrow", placeholder: "In one sentence" }),
103
+ title: slot("text", 0.44, 1.7, 8.4, 2.6, { size: 34, bold: true, font: "heading", color: "text", valign: "top", required: true, class: "statement", placeholder: "The statement" }),
104
+ note: slot("markdown", 0.44, 4.4, 9.12, 0.85, { size: 13, color: "muted", placeholder: "Why it matters" }),
105
+ },
106
+ },
107
+ "two-column": withHead("Title with a left and a right column", {
108
+ left: slot("markdown", 0.44, 1.32, 4.46, 3.95, { size: 14, color: "text", required: true }),
109
+ right: slot("markdown", 5.1, 1.32, 4.46, 3.95, { size: 14, color: "text", required: true }),
110
+ }),
111
+ image: withHead("Title, text on the left, a picture on the right", {
112
+ body: slot("markdown", 0.44, 1.32, 4.1, 3.95, { size: 14, color: "text" }),
113
+ image: slot("image", 4.74, 1.32, 4.82, 3.95, { required: true, placeholder: "![caption](assets/picture.png)" }),
114
+ }),
115
+ chart: withHead("Title, a chart, a caption below it", {
116
+ chart: slot("chart", 0.44, 1.32, 9.12, 3.45, { size: 11, required: true, placeholder: "```chart\nkind: column\ncategories: [Q1, Q2]\nseries:\n - name: Revenue\n values: [120, 180]\n```" }),
117
+ caption: slot("text", 0.44, 4.82, 9.12, 0.45, { size: 10, color: "muted", placeholder: "Source or takeaway" }),
118
+ }),
119
+ table: withHead("Title and a table", {
120
+ table: slot("table", 0.44, 1.32, 9.12, 3.95, { size: 13, color: "text", required: true, placeholder: "| Item | Value |\n|---|---|\n| Pages | 120 |" }),
121
+ }),
122
+ quote: {
123
+ description: "A quotation and who said it",
124
+ background: "surface",
125
+ shapes: [{ kind: "rect", x: 0.7, y: 1.45, w: 0.06, h: 2.4, fill: "accent" }],
126
+ slots: {
127
+ quote: slot("text", 1.0, 1.4, 8.2, 2.1, { size: 28, italic: true, font: "heading", color: "text", valign: "middle", required: true, class: "statement", placeholder: "The quote" }),
128
+ attribution: slot("text", 1.0, 3.55, 8.2, 0.5, { size: 13, color: "muted", placeholder: "Who said it" }),
129
+ },
130
+ },
131
+ blank: { description: "The whole canvas as one body (HTML welcome)", shapes: [], slots: { body: slot("markdown", 0.44, 0.35, 9.12, 4.95, { size: 15, color: "text", required: true }) } },
132
+ },
133
+ snippets: [
134
+ { name: "Cards", description: "Three cards with a number, a heading and a line", kind: "html", w: 9.12, h: 2.2, content: '<div class="cards">\n <div class="card"><span class="num">01</span><h3>First</h3><p>What it is and why it matters.</p></div>\n <div class="card"><span class="num">02</span><h3>Second</h3><p>What it is and why it matters.</p></div>\n <div class="card"><span class="num">03</span><h3>Third</h3><p>What it is and why it matters.</p></div>\n</div>' },
135
+ { name: "Key figures", description: "Big numbers with a label", kind: "html", w: 9.12, h: 1.6, content: '<div class="kpis">\n <div class="kpi"><strong>120</strong><span>pages migrated</span></div>\n <div class="kpi"><strong>5 min</strong><span>to publish a text</span></div>\n <div class="kpi"><strong>−60%</strong><span>time per text</span></div>\n</div>' },
136
+ { name: "Flow", description: "Boxes from left to right with arrows", kind: "html", w: 9.12, h: 1.6, content: '<div class="flow">\n <div class="box ghost">Sources<small>CSV, Excel</small></div>\n <div class="arrow">→</div>\n <div class="box accent">We build this<small>import, checks, API</small></div>\n <div class="arrow">→</div>\n <div class="box solid">Channels<small>web, newsletter, social</small></div>\n</div>' },
137
+ { name: "Timeline", description: "Points on a line, left to right", kind: "html", w: 9.12, h: 1.4, content: '<ol class="timeline">\n <li><b>December</b><span>Website</span></li>\n <li><b>January</b><span>Newsletter, LinkedIn</span></li>\n <li><b>February</b><span>Review with the same texts</span></li>\n</ol>' },
138
+ { name: "Before / after", description: "Two boxes side by side", kind: "html", w: 9.12, h: 2.2, content: '<div class="compare">\n <div><h3>Today</h3><p>Every text is copied by hand into four tools.</p></div>\n <div><h3>With the change</h3><p>Written once, published everywhere.</p></div>\n</div>' },
139
+ { name: "Columns", description: "Three columns with a small heading", kind: "html", w: 9.12, h: 2, content: '<div class="cols">\n <div><h3>For</h3><p>Who it serves.</p></div>\n <div><h3>Not now</h3><p>What stays out.</p></div>\n <div><h3>Next</h3><p>What follows.</p></div>\n</div>' },
140
+ { name: "Callout", description: "A highlighted note", kind: "html", w: 6, h: 1, content: '<div class="callout"><strong>Note:</strong> the one thing to remember.</div>' },
141
+ ],
142
+ };
@@ -0,0 +1,34 @@
1
+ /** Series colors, shared by the HTML chart and the PPTX one so both look alike: the template's accent, then fixed extras. */
2
+ export declare const chartPalette: (accent?: string) => string[];
3
+ /**
4
+ * Charts as SVG for the HTML slides: column, bar, line, area, pie and
5
+ * doughnut from the same `chart` block the PowerPoint export turns into a
6
+ * native chart. Pure — the web editor bundles it.
7
+ */
8
+ export declare const CHART_KINDS: readonly ["column", "bar", "line", "pie", "doughnut", "area"];
9
+ export type ChartKind = (typeof CHART_KINDS)[number];
10
+ export interface ChartData {
11
+ kind: ChartKind;
12
+ title?: string;
13
+ categories: string[];
14
+ series: {
15
+ name: string;
16
+ values: number[];
17
+ }[];
18
+ }
19
+ /** A chart block's YAML (fenced or bare) read and checked; throws with what is wrong. */
20
+ export declare function parseChart(source: string): ChartData;
21
+ /** The chart as an SVG string sized w × h (the slot's box in px), in the theme's palette and text colors. */
22
+ export declare function chartSvg(c: ChartData, w: number, h: number, look: {
23
+ palette: string[];
24
+ text: string;
25
+ muted: string;
26
+ line: string;
27
+ fontSize: number;
28
+ }): string;
29
+ /**
30
+ * A chart written back as its block: what the editor's data grid saves.
31
+ * Compact and in the order people read it (kind, title, categories,
32
+ * series); `fenced` keeps the ```chart fence the slot had.
33
+ */
34
+ export declare function chartSource(c: ChartData, fenced: boolean): string;