@netnodeag/kraftwerk 0.95.0 → 0.97.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 (83) hide show
  1. package/README.md +47 -7
  2. package/dist/acp.d.ts +31 -3
  3. package/dist/acp.js +63 -2
  4. package/dist/cli/boards.js +6 -5
  5. package/dist/cli/create-brief.js +2 -2
  6. package/dist/cli/daemon-login.d.ts +1 -1
  7. package/dist/cli/daemon-login.js +1 -1
  8. package/dist/cli/doctor.js +6 -3
  9. package/dist/cli/init.js +2 -0
  10. package/dist/cli/knowledge.js +9 -6
  11. package/dist/cli/presentations.js +8 -4
  12. package/dist/cli/projects.js +3 -3
  13. package/dist/client/index.d.ts +2 -0
  14. package/dist/client/index.js +3 -0
  15. package/dist/client/routes.d.ts +2 -0
  16. package/dist/client/routes.js +2 -0
  17. package/dist/config.d.ts +34 -0
  18. package/dist/config.js +28 -1
  19. package/dist/core/agents.js +1 -1
  20. package/dist/core/board-wake.d.ts +1 -1
  21. package/dist/core/boards.d.ts +1 -1
  22. package/dist/core/boards.js +10 -6
  23. package/dist/core/chat/acp.d.ts +6 -0
  24. package/dist/core/chat/acp.js +33 -7
  25. package/dist/core/chat/permissions.d.ts +2 -2
  26. package/dist/core/chat/permissions.js +4 -1
  27. package/dist/core/chat/pi.d.ts +12 -0
  28. package/dist/core/chat/pi.js +56 -5
  29. package/dist/core/chat/sessions.d.ts +13 -5
  30. package/dist/core/chat/sessions.js +34 -9
  31. package/dist/core/chat/types.d.ts +3 -1
  32. package/dist/core/cloud.d.ts +45 -0
  33. package/dist/core/cloud.js +35 -0
  34. package/dist/core/knowledge.d.ts +0 -7
  35. package/dist/core/knowledge.js +6 -6
  36. package/dist/core/person.d.ts +41 -0
  37. package/dist/core/person.js +47 -0
  38. package/dist/core/projects.d.ts +1 -1
  39. package/dist/core/projects.js +3 -2
  40. package/dist/harness.d.ts +3 -2
  41. package/dist/harnesses/acp.js +3 -1
  42. package/dist/harnesses/registry.js +2 -1
  43. package/dist/server/api/agents.js +2 -2
  44. package/dist/server/api/boards.js +1 -1
  45. package/dist/server/api/chats.d.ts +4 -1
  46. package/dist/server/api/chats.js +30 -12
  47. package/dist/server/api/cloud.d.ts +8 -0
  48. package/dist/server/api/index.d.ts +25 -3
  49. package/dist/server/api/presentations.js +2 -2
  50. package/dist/server/api/projects.d.ts +1 -1
  51. package/dist/server/api/projects.js +1 -1
  52. package/dist/server/api/router.js +5 -2
  53. package/dist/server/api/workspace.d.ts +14 -1
  54. package/dist/server/api/workspace.js +21 -1
  55. package/dist/server/cloud.d.ts +3 -0
  56. package/dist/server/cloud.js +20 -4
  57. package/dist/server/person.d.ts +9 -0
  58. package/dist/server/person.js +14 -0
  59. package/dist/server/server.js +60 -4
  60. package/dist/server/trust.d.ts +5 -1
  61. package/dist/server/users.d.ts +55 -0
  62. package/dist/server/users.js +258 -0
  63. package/package.json +1 -1
  64. package/schema/kraftwerk.schema.json +8 -0
  65. package/schema/workflow.schema.json +4 -3
  66. package/web/dist/assets/{dist--oB2_FQJ.js → dist-BD4ooe-Y.js} +1 -1
  67. package/web/dist/assets/{dist-WA1PTY07.js → dist-BduOHHOY.js} +1 -1
  68. package/web/dist/assets/{dist-CRqkyR9b.js → dist-BoajTxbz.js} +1 -1
  69. package/web/dist/assets/{dist-FlDPUw_l.js → dist-DGLb7wE6.js} +1 -1
  70. package/web/dist/assets/{dist-SHAE_oEQ.js → dist-DJACzcZZ.js} +1 -1
  71. package/web/dist/assets/{dist-SL9iU_p4.js → dist-DY6QplYX.js} +1 -1
  72. package/web/dist/assets/{dist-Tdda9sK7.js → dist-D_uWSMLk.js} +1 -1
  73. package/web/dist/assets/{dist-Ys1tb91R.js → dist-P7JCq9c3.js} +1 -1
  74. package/web/dist/assets/dist-ajNgHt2Q.js +1 -0
  75. package/web/dist/assets/{dist-BlxwNXF3.js → dist-lcPkaK4d.js} +1 -1
  76. package/web/dist/assets/{dist-DB33yOhN.js → dist-oRcLByHn.js} +1 -1
  77. package/web/dist/assets/{editor-Clx4xAh9.js → editor-hTceN7Iz.js} +3 -3
  78. package/web/dist/assets/index-BGgQaaA9.css +2 -0
  79. package/web/dist/assets/index-BOkjCxut.js +488 -0
  80. package/web/dist/index.html +2 -2
  81. package/web/dist/assets/dist-C3zyJ_nA.js +0 -1
  82. package/web/dist/assets/index-BJml45iw.js +0 -488
  83. package/web/dist/assets/index-CWopPK15.css +0 -2
package/README.md CHANGED
@@ -486,7 +486,7 @@ For a client of your own, `@netnodeag/kraftwerk/client` takes the token:
486
486
 
487
487
  The repo root ships [`deploy-starter/`](../deploy-starter/). Copy it into your
488
488
  consumer repo as `deploy/` and it builds a small image, this package from npm
489
- plus the claude, codex and pi CLIs, that serves `kraftwerk ui` for that repo
489
+ plus the claude, codex, pi and agy CLIs, that serves `kraftwerk ui` for that repo
490
490
  bind-mounted at `/work`. `compose.yml` is localhost-only, reachable over an
491
491
  SSH tunnel. `compose.traefik.yml` layers traefik routing and mandatory
492
492
  basic-auth on top. Treat that auth as load-bearing. In a container the UI
@@ -535,6 +535,36 @@ names no origin — and `cloud.interval` is ignored: the cloud sets the
535
535
  cadence.) `/api/meta` and `/api/cloud` report the machine's state and claim
536
536
  code; `kraftwerk doctor` prints what happens to the workspace.
537
537
 
538
+ ### Who works here: users
539
+
540
+ Everything a person does — a task created, a log line, a knowledge page
541
+ verified, a chat message — is signed with who did it. `users:` in
542
+ kraftwerk.yml says who that is:
543
+
544
+ ```yaml
545
+ users:
546
+ mode: local # default: whoever sits at this machine, as human:<handle> (~/.kraftwerk/identity.json)
547
+ mode: cloud # people sign in with their kraftwerk cloud account
548
+ ```
549
+
550
+ With `mode: cloud` this machine's browser signs in before the UI opens: the
551
+ UI sends it to the cloud, the account confirms, and the cloud hands a
552
+ one-time code back that the daemon redeems with the machine's own secret.
553
+ Only accounts on the workspace (its owners and members, an org's people)
554
+ get in. From then on their actions are signed `human:<their handle>`, and
555
+ chats keep the account's uuid — the same person on every machine and clone.
556
+ The cloud is asked again every 15 minutes, so removing someone there signs
557
+ them out here; the person menu in the top bar signs out by hand. The
558
+ machine's own shell (the CLI, scripts on this machine) needs no sign-in: it
559
+ acts as the account that claimed the machine (`~/.kraftwerk/account.json`).
560
+ Paired devices and remote members keep their own credentials. `cloud` needs
561
+ the daemon connected to the cloud and the workspace's `id:`. `GET /api/me`
562
+ says who the caller is.
563
+
564
+ An API caller cannot name another person: a `human:…` actor in a request
565
+ body is replaced by whoever asks. Agents and processes still name
566
+ themselves (`lisa/claude`, `process:sync`).
567
+
538
568
  ## Projects
539
569
 
540
570
  Turn on `projects:` in `kraftwerk.yml` (or the checkbox in settings) and
@@ -569,7 +599,7 @@ record** and the **links**:
569
599
  title: Relaunch netnode.ch
570
600
  status: active
571
601
  goal: Ship the new site on NodeHive by 2026-11-30
572
- harness: claude # claude | codex | pi — every chat in the project runs on it
602
+ harness: claude # claude | codex | pi | antigravity — every chat in the project runs on it
573
603
  model: sonnet # optional, like an agent's
574
604
  effort: high # optional: low | medium | high | xhigh | max
575
605
  records:
@@ -1027,7 +1057,7 @@ agents/max/
1027
1057
  name: Max
1028
1058
  emoji: 🛠️
1029
1059
  description: Runs and explains this project's workflows
1030
- harness: claude # claude | codex | pi (which chat backend runs it)
1060
+ harness: claude # claude | codex | pi | antigravity (which chat backend runs it)
1031
1061
  model: sonnet # optional; harness default when omitted
1032
1062
  effort: medium # optional: low | medium | high | xhigh | max
1033
1063
  workflows: [tagline, website-check]
@@ -1395,7 +1425,7 @@ agents:
1395
1425
  export const desloper = defineAgent({
1396
1426
  id: "desloper",
1397
1427
  name: "Lektorat",
1398
- harness: "codex", // WHERE it runs: claude (default) | codex | pi
1428
+ harness: "codex", // WHERE it runs: claude (default) | codex | pi | antigravity
1399
1429
  model: "gpt-5.6-sol", // WHAT thinks, in the harness's naming
1400
1430
  effort: "high", // optional: low | medium | high | xhigh | max
1401
1431
  tools: ["Read", "Write", "Edit"], // governance: capability boundary
@@ -1450,19 +1480,29 @@ Prerequisites per harness:
1450
1480
  - **pi** needs `npm install -g @earendil-works/pi-coding-agent`. Anthropic
1451
1481
  models reuse the Claude subscription OAuth, other vendors need their key in
1452
1482
  the env (check with `pi auth check --provider deepseek`).
1483
+ - **antigravity** needs Google's Antigravity CLI (`agy`) on the PATH and
1484
+ logged in (`agy acp --login`). It has no headless CLI mode kraftwerk
1485
+ drives: its CLI *is* an ACP server (`agy acp`), so `runs-on: antigravity`
1486
+ always runs over the agent protocol, whatever `protocol` says. `model`
1487
+ picks one of the models `agy models` lists; `effort` becomes its
1488
+ thinking level (low / medium / high; xhigh and max are high) where the
1489
+ model has one. MCP servers reach it the protocol's way (session
1490
+ `mcpServers`). Chats on it cannot be forked.
1453
1491
 
1454
1492
  ### Agent protocol
1455
1493
 
1456
1494
  Phases can also run over the [Agent Client Protocol](https://agentclientprotocol.com)
1457
1495
  — the same adapters the inspector's chats use (`claude-agent-acp`,
1458
- `codex-acp`), bundled with kraftwerk, so nothing needs to be on the PATH.
1496
+ `codex-acp`), bundled with kraftwerk, so nothing needs to be on the PATH —
1497
+ except for antigravity, whose own CLI is the adapter (`agy acp`).
1459
1498
  Set `protocol: acp` at the top of a workflow (every agent) or on one agent;
1460
1499
  `runs-on` still picks the harness (pi has no adapter). The adapter process
1461
1500
  stays alive for the whole run, so phases on one harness share a session
1462
1501
  like `--resume` does on the CLI. Persona and workspace context travel inside
1463
1502
  each phase prompt. On claude the agent's `tools`, CLI grants and MCP servers
1464
1503
  become the session's allowlist (settings sources off) and the session is
1465
- switched to `acceptEdits`; codex runs in its workspace-write mode. A permission request the harness
1504
+ switched to `acceptEdits`; codex runs in its workspace-write mode,
1505
+ antigravity in `accept-edits`. A permission request the harness
1466
1506
  still raises is declined — nobody watches a workflow run, and kraftwerk
1467
1507
  never answers for a human. A programmatic `Run` ends its adapters with
1468
1508
  `disposeAcpSessions(runDir)` (the YAML runner does this itself).
@@ -1500,7 +1540,7 @@ workspace: |
1500
1540
  Dateien: brand.md, tagline.md
1501
1541
  agents:
1502
1542
  analyst:
1503
- runs-on: claude # claude (default) | codex | pi
1543
+ runs-on: claude # claude (default) | codex | pi | antigravity
1504
1544
  model: haiku # effort: low..max optional
1505
1545
  tools: [Read, Write, Edit, WebFetch]
1506
1546
  persona: |
package/dist/acp.d.ts CHANGED
@@ -7,10 +7,14 @@ import type { McpServerConfig } from "./harness.js";
7
7
  * CLI on the PATH is needed), model/effort tuning, and spawning one adapter
8
8
  * as a subprocess speaking ACP over its stdio.
9
9
  *
10
- * Auth rides on the local CLI logins (Claude Code / Codex) via the
11
- * inherited environment — same story as the CLI harnesses.
10
+ * Auth rides on the local CLI logins (Claude Code / Codex / Antigravity)
11
+ * via the inherited environment — same story as the CLI harnesses.
12
+ *
13
+ * Antigravity is the exception to "bundled": Google ships no npm adapter,
14
+ * its own CLI speaks ACP natively (`agy acp`), so that one is spawned from
15
+ * the PATH and needs `agy` installed and logged in.
12
16
  */
13
- export type AcpAgent = "claude" | "codex";
17
+ export type AcpAgent = "claude" | "codex" | "antigravity";
14
18
  /**
15
19
  * Model/effort overrides ride on adapter-specific channels: the claude
16
20
  * adapter takes the model via session `_meta.claudeCode.options` and the
@@ -21,6 +25,19 @@ export declare function adapterEnv(agent: AcpAgent, tuning: {
21
25
  model?: string;
22
26
  effort?: string;
23
27
  }): NodeJS.ProcessEnv;
28
+ /**
29
+ * Model/effort for an adapter that takes them as session config options
30
+ * (Antigravity: `model`, `thought_level`) instead of env or `_meta`: the
31
+ * values to set once the session is open. Only choices the session offers
32
+ * are set; anything else keeps the agent's default.
33
+ */
34
+ export declare function tuningConfig(agent: AcpAgent, tuning: {
35
+ model?: string;
36
+ effort?: string;
37
+ }, options: SessionConfigOption[] | null | undefined): Array<{
38
+ configId: string;
39
+ value: string;
40
+ }>;
24
41
  /** Kraftwerk's MCP config (stdio or url) -> the protocol's session mcpServers entries. */
25
42
  export declare function acpMcpServers(servers?: Record<string, McpServerConfig>): McpServer[];
26
43
  /**
@@ -175,6 +192,17 @@ export declare function connectAcp(agent: AcpAgent, opts: {
175
192
  * `fn` settles.
176
193
  */
177
194
  export declare function withAdapter<T>(agent: AcpAgent, cwd: string, fn: (conn: AcpConnection) => Promise<T>): Promise<T>;
195
+ /**
196
+ * Set the model and thinking depth an adapter takes as session settings
197
+ * (see tuningConfig), the model first: what the thinking depth offers
198
+ * depends on it (agy drops thought_level for a model without levels). A
199
+ * refused setting is reported through `warn` and the agent's default
200
+ * stays. Returns the session's settings as they are afterwards.
201
+ */
202
+ export declare function applyTuningConfig(agent: AcpAgent, conn: Pick<AcpConnection, "setSessionConfigOption">, sessionId: string, tuning: {
203
+ model?: string;
204
+ effort?: string;
205
+ }, options: SessionConfigOption[] | null | undefined, warn: (message: string) => void): Promise<SessionConfigOption[] | null | undefined>;
178
206
  /** The subset of the connection a session open needs (a test can stand in for it). */
179
207
  export type SessionOpener = Pick<AcpConnection, "newSession" | "resumeSession">;
180
208
  export interface OpenedSession {
package/dist/acp.js CHANGED
@@ -9,6 +9,10 @@ const ADAPTERS = {
9
9
  claude: "@agentclientprotocol/claude-agent-acp",
10
10
  codex: "@agentclientprotocol/codex-acp",
11
11
  };
12
+ /** Agents whose own CLI is the ACP server: command + args, spawned from the PATH. */
13
+ const NATIVE = {
14
+ antigravity: ["agy", ["acp"]],
15
+ };
12
16
  /**
13
17
  * The adapter's executable: its package's `bin` (the packages' `exports`
14
18
  * may hide dist/, and claude-agent-acp's main is a library, not the CLI).
@@ -49,6 +53,35 @@ export function adapterEnv(agent, tuning) {
49
53
  }
50
54
  return env;
51
55
  }
56
+ /** Effort tier -> Antigravity's thought_level choices (low | medium | high). */
57
+ const ANTIGRAVITY_THOUGHT = { low: "low", medium: "medium", high: "high", xhigh: "high", max: "high" };
58
+ /**
59
+ * Model/effort for an adapter that takes them as session config options
60
+ * (Antigravity: `model`, `thought_level`) instead of env or `_meta`: the
61
+ * values to set once the session is open. Only choices the session offers
62
+ * are set; anything else keeps the agent's default.
63
+ */
64
+ export function tuningConfig(agent, tuning, options) {
65
+ if (agent !== "antigravity" || !options?.length)
66
+ return [];
67
+ const offers = (id, value) => {
68
+ const o = options.find((x) => x.id === id);
69
+ return !!value && !!o && o.type === "select" && flatChoices(o).includes(value);
70
+ };
71
+ const out = [];
72
+ if (offers("model", tuning.model))
73
+ out.push({ configId: "model", value: tuning.model });
74
+ const level = tuning.effort ? ANTIGRAVITY_THOUGHT[tuning.effort] : undefined;
75
+ if (offers("thought_level", level))
76
+ out.push({ configId: "thought_level", value: level });
77
+ return out;
78
+ }
79
+ /** The values of a select option, its groups flattened. */
80
+ function flatChoices(o) {
81
+ if (o.type !== "select")
82
+ return [];
83
+ return o.options.flatMap((c) => (c.options ? c.options.map((x) => x.value) : c.value ? [c.value] : []));
84
+ }
52
85
  /** Kraftwerk's MCP config (stdio or url) -> the protocol's session mcpServers entries. */
53
86
  export function acpMcpServers(servers = {}) {
54
87
  return Object.entries(servers).map(([name, cfg]) => "url" in cfg
@@ -193,8 +226,12 @@ function agentCalls(ctx) {
193
226
  */
194
227
  export async function connectAcp(agent, opts) {
195
228
  // KRAFTWERK_ACP_ADAPTER: a script standing in for the adapter (the tests' scripted fake agent).
196
- const entry = process.env.KRAFTWERK_ACP_ADAPTER || adapterEntry(agent);
197
- const child = spawn(process.execPath, [entry], {
229
+ const fake = process.env.KRAFTWERK_ACP_ADAPTER;
230
+ const native = NATIVE[agent];
231
+ const [command, args] = fake
232
+ ? [process.execPath, [fake]]
233
+ : native ?? [process.execPath, [adapterEntry(agent)]];
234
+ const child = spawn(command, args, {
198
235
  cwd: opts.cwd,
199
236
  stdio: ["pipe", "pipe", "pipe"],
200
237
  env: opts.env,
@@ -258,6 +295,30 @@ export async function withAdapter(agent, cwd, fn) {
258
295
  child.kill("SIGTERM");
259
296
  }
260
297
  }
298
+ /**
299
+ * Set the model and thinking depth an adapter takes as session settings
300
+ * (see tuningConfig), the model first: what the thinking depth offers
301
+ * depends on it (agy drops thought_level for a model without levels). A
302
+ * refused setting is reported through `warn` and the agent's default
303
+ * stays. Returns the session's settings as they are afterwards.
304
+ */
305
+ export async function applyTuningConfig(agent, conn, sessionId, tuning, options, warn) {
306
+ let current = options;
307
+ for (const configId of ["model", "thought_level"]) {
308
+ const c = tuningConfig(agent, tuning, current).find((x) => x.configId === configId);
309
+ if (!c)
310
+ continue;
311
+ try {
312
+ const res = await conn.setSessionConfigOption({ sessionId, ...c });
313
+ if (res.configOptions)
314
+ current = res.configOptions;
315
+ }
316
+ catch (err) {
317
+ warn(`could not set ${c.configId} to ${c.value} (${err.message})`);
318
+ }
319
+ }
320
+ return current;
321
+ }
261
322
  /**
262
323
  * Open a session: continue `resume` when given (session/resume — the
263
324
  * agent's own transcript carries the history, no replay), else a new one.
@@ -5,6 +5,7 @@ import { appendTaskLog, assignTask, createBoard, createTask, DEFAULT_BOARD, dele
5
5
  import { taskSessions } from "../core/board-wake.js";
6
6
  import { initContext as prepare } from "./routines.js";
7
7
  import { fmtAgo } from "./workspaces.js";
8
+ import { actorFor } from "../core/person.js";
8
9
  /**
9
10
  * `kraftwerk boards` and `kraftwerk tasks` — the boards (columns of tasks)
10
11
  * of a project or of the workspace, and the tasks on them. The same module
@@ -36,8 +37,8 @@ const die = (msg) => {
36
37
  console.error(chalk.red(msg));
37
38
  process.exit(1);
38
39
  };
39
- /** Who writes: --actor, else the session's KRAFTWERK_ACTOR, else human:user. */
40
- const actorOf = (opt) => (opt ?? process.env.KRAFTWERK_ACTOR ?? "").trim() || "human:user";
40
+ /** Who writes: --actor, else the session's KRAFTWERK_ACTOR (an agent), else this machine's person (core/person.ts). */
41
+ const actorOf = (opt) => (opt ?? process.env.KRAFTWERK_ACTOR ?? "").trim() || undefined;
41
42
  /** Which agent acts: --as, else the session's KRAFTWERK_AGENT. */
42
43
  const agentOf = (opt) => (opt ?? process.env.KRAFTWERK_AGENT ?? "").trim();
43
44
  /** The board a command means: --board, else the project's default board when it exists, else the only board. */
@@ -312,7 +313,7 @@ export function registerBoardCommands(program) {
312
313
  .option("--file <path>", "The task's markdown (what, done-when, notes) from a file")
313
314
  .option("--notes <text>", "The task's markdown inline")
314
315
  .option("-m, --message <text>", "A first log line")
315
- .option("--actor <actor>", "Who writes (default: KRAFTWERK_ACTOR, else human:user)")
316
+ .option("--actor <actor>", "Who writes (default: KRAFTWERK_ACTOR, else you: human:<handle>)")
316
317
  .option("--json", "Print the task as JSON")
317
318
  .action(async (title, opts) => {
318
319
  await prepare();
@@ -420,7 +421,7 @@ export function registerBoardCommands(program) {
420
421
  .argument("[entry]", "The line to record")
421
422
  .option("--file <path>", "Read the entry from a file")
422
423
  .option("--tail <n>", "Print the newest n lines instead of writing")
423
- .option("--actor <actor>", "Who writes (default: KRAFTWERK_ACTOR, else human:user)")
424
+ .option("--actor <actor>", "Who writes (default: KRAFTWERK_ACTOR, else you: human:<handle>)")
424
425
  .action(async (task, entry, opts) => {
425
426
  await prepare();
426
427
  try {
@@ -439,7 +440,7 @@ export function registerBoardCommands(program) {
439
440
  }
440
441
  const text = opts.file ? await readFile(opts.file, "utf8") : entry ?? "";
441
442
  const t = await appendTaskLog(ref, task, text, actorOf(opts.actor));
442
- console.log(`${chalk.green("✔")} logged on ${chalk.cyan(String(t.number))} ${chalk.dim(`(${actorOf(opts.actor)})`)}`);
443
+ console.log(`${chalk.green("✔")} logged on ${chalk.cyan(String(t.number))} ${chalk.dim(`(${await actorFor(actorOf(opts.actor))})`)}`);
443
444
  }
444
445
  catch (err) {
445
446
  die(err.message);
@@ -32,7 +32,7 @@ nothing to register.
32
32
  sequences fit YAML; if the requirements demand loops or human approval
33
33
  gates, STOP and tell the user this needs a TypeScript workflow instead.
34
34
  - **Agents**: one per role — persona (WHO), model + optional effort (WHAT
35
- thinks), tools (governance), \`runs-on\` (WHERE: claude | codex | pi).
35
+ thinks), tools (governance), \`runs-on\` (WHERE: claude | codex | pi | antigravity).
36
36
  - **Gates** per step: what file evidence proves the step worked?
37
37
  3. Write \`${root}/<name>/workflow.yml\`. Complete example of every feature:
38
38
 
@@ -59,7 +59,7 @@ nothing to register.
59
59
  persona: |
60
60
  You analyze brands based on their website ...
61
61
  writer:
62
- runs-on: codex # optional: claude (default) | codex | pi
62
+ runs-on: codex # optional: claude (default) | codex | pi | antigravity
63
63
  model: gpt-5.6-sol
64
64
  effort: high # optional: low | medium | high | xhigh | max
65
65
  tools: [Read, Write, Edit]
@@ -3,7 +3,7 @@
3
3
  * (a LaunchAgent), so it runs after a reboot without a terminal or the
4
4
  * desktop app. launchd starts the same `kraftwerk daemon` a terminal would —
5
5
  * this node, this install — with the PATH of the shell that installed it,
6
- * because launchd's own PATH would not find the agents (claude, codex, pi).
6
+ * because launchd's own PATH would not find the agents (claude, codex, pi, agy).
7
7
  * The daemon's supervisor restarts it after a self-update; launchd only
8
8
  * starts it at login.
9
9
  */
@@ -11,7 +11,7 @@ import { tildify } from "../core/instances.js";
11
11
  * (a LaunchAgent), so it runs after a reboot without a terminal or the
12
12
  * desktop app. launchd starts the same `kraftwerk daemon` a terminal would —
13
13
  * this node, this install — with the PATH of the shell that installed it,
14
- * because launchd's own PATH would not find the agents (claude, codex, pi).
14
+ * because launchd's own PATH would not find the agents (claude, codex, pi, agy).
15
15
  * The daemon's supervisor restarts it after a self-update; launchd only
16
16
  * starts it at login.
17
17
  */
@@ -214,7 +214,9 @@ export async function runDoctor(cwd, opts = {}) {
214
214
  let acp = false;
215
215
  for (const e of found) {
216
216
  for (const a of e.workflow?.meta.agents ?? []) {
217
- if (a.protocol === "acp")
217
+ if (a.harness === "antigravity")
218
+ needed.add("antigravity");
219
+ else if (a.protocol === "acp")
218
220
  acp = true;
219
221
  else
220
222
  needed.add(a.harness ?? "claude");
@@ -222,8 +224,9 @@ export async function runDoctor(cwd, opts = {}) {
222
224
  }
223
225
  if (acp)
224
226
  report("ok", "agent protocol adapters", "claude-agent-acp + codex-acp bundled with kraftwerk");
225
- for (const harness of ["claude", "codex", "pi"]) {
226
- const version = cliVersion(harness);
227
+ // Antigravity has no bundled adapter: its own CLI (agy) is the ACP server, needed on either protocol.
228
+ for (const harness of ["claude", "codex", "pi", "antigravity"]) {
229
+ const version = cliVersion(harness === "antigravity" ? "agy" : harness);
227
230
  const isNeeded = needed.has(harness);
228
231
  if (version) {
229
232
  report("ok", `${harness} CLI`, version);
package/dist/cli/init.js CHANGED
@@ -38,6 +38,8 @@ skills: ${DATA_DIR}/skills # workspace skills (shared instruction packag
38
38
  # presentations: # slide decks as folders (deck.md + assets) per project and under ${DATA_DIR}/presentations — rendered from a template into PPTX, PDF and slide images (uncomment to enable)
39
39
  # cloud: # the daemon registers this MACHINE with the kraftwerk cloud and lists this workspace (\`kraftwerk login\` claims the machine)
40
40
  # enabled: false # uncomment both lines to leave this workspace out (\`kraftwerk cloud off\` turns the cloud off for the whole machine)
41
+ # users: # who works here: local (default) = this machine's handle; cloud = people sign in with their kraftwerk cloud account
42
+ # mode: cloud
41
43
  `;
42
44
  const WORKFLOW_TEMPLATE = `# yaml-language-server: $schema=${SCHEMA_URL}
43
45
  name: hello
@@ -5,6 +5,7 @@ import { resolveWorkspace } from "../config.js";
5
5
  import { fsck, getConcept, initBundle, knowledgeRoot, listBundles, listConcepts, searchKnowledge, validateBundle, verifyConcept, writeConcept, } from "../okf.js";
6
6
  import { deleteBundle } from "../core/knowledge.js";
7
7
  import { initContext as prepare } from "./routines.js";
8
+ import { actorFor } from "../core/person.js";
8
9
  /**
9
10
  * `kraftwerk knowledge` — the CLI surface over OKF bundles (the
10
11
  * inspector's Knowledge screen). This is the enforced write path: `put` stamps provenance
@@ -13,10 +14,11 @@ import { initContext as prepare } from "./routines.js";
13
14
  *
14
15
  * Agents identify via --actor (or KRAFTWERK_ACTOR); the OKF convention is
15
16
  * `<producer>/<version>` for agents, `human:<id>` for people,
16
- * `process:<id>` for automation. Humans default to `human:user`.
17
+ * `process:<id>` for automation. A person is this machine's
18
+ * (`human:<handle>`, core/person.ts).
17
19
  */
18
- const DEFAULT_ACTOR = "human:user";
19
- const actorOf = (opts) => opts.actor?.trim() || process.env.KRAFTWERK_ACTOR?.trim() || DEFAULT_ACTOR;
20
+ const DEFAULT_ACTOR = "you: human:<handle>";
21
+ const actorOf = (opts) => actorFor(opts.actor?.trim() || process.env.KRAFTWERK_ACTOR?.trim());
20
22
  async function root() {
21
23
  const project = await resolveWorkspace(process.cwd());
22
24
  return knowledgeRoot(project.root, project.config.knowledge);
@@ -128,9 +130,10 @@ export function registerKnowledgeCommands(program) {
128
130
  process.exit(2);
129
131
  }
130
132
  try {
131
- const result = await writeConcept(await root(), bundle, id, content, actorOf(opts));
133
+ const actor = await actorOf(opts);
134
+ const result = await writeConcept(await root(), bundle, id, content, actor);
132
135
  console.log(`${chalk.green("✔")} ${result.created ? "created" : "updated"} ${chalk.cyan(`${bundle}/${result.concept.id}`)} ` +
133
- chalk.dim(`(${result.concept.type}, by ${actorOf(opts)})`));
136
+ chalk.dim(`(${result.concept.type}, by ${actor})`));
134
137
  }
135
138
  catch (err) {
136
139
  console.error(chalk.red(err.message));
@@ -144,7 +147,7 @@ export function registerKnowledgeCommands(program) {
144
147
  .option("--by <actor>", `Verifier actor (default: ${DEFAULT_ACTOR})`)
145
148
  .action(async (ref, opts) => {
146
149
  const { bundle, id } = splitRef(ref);
147
- const actor = opts.by?.trim() || process.env.KRAFTWERK_ACTOR?.trim() || DEFAULT_ACTOR;
150
+ const actor = await actorFor(opts.by?.trim() || process.env.KRAFTWERK_ACTOR?.trim());
148
151
  try {
149
152
  const concept = await verifyConcept(await root(), bundle, id, actor);
150
153
  console.log(`${chalk.green("✔")} ${ref} verified by ${actor} → ${tierColor(concept.trustTier)}`);
@@ -4,6 +4,7 @@ import { readFile } from "node:fs/promises";
4
4
  import { createDeck, deleteDeck, exportDeck, getDeck, addComment, listComments, updateComment, initTemplate, listAllDecks, listDecks, listTemplates, } from "../core/presentations/index.js";
5
5
  import { initContext as prepare } from "./routines.js";
6
6
  import { fmtAgo } from "./workspaces.js";
7
+ import { machinePerson } from "../core/person.js";
7
8
  /**
8
9
  * kraftwerk presentations [list] [--project <slug>] [--all] [--json]
9
10
  * kraftwerk presentations show <name> [--project <slug>] [--json] the slides, the template's layouts and slots, the warnings
@@ -171,8 +172,11 @@ export function registerPresentationCommands(program) {
171
172
  console.log(`${chalk.green("wrote")} ${f}`);
172
173
  printWarnings(warnings);
173
174
  });
174
- /** Who writes: the session's actor (an agent), else human:user. */
175
- const actor = () => (process.env.KRAFTWERK_ACTOR ?? "").trim() || "human:user";
175
+ /** Who writes: the session's actor (an agent), else this machine's person. */
176
+ const actor = async () => {
177
+ const given = (process.env.KRAFTWERK_ACTOR ?? "").trim();
178
+ return given || (await machinePerson()).handle;
179
+ };
176
180
  cmd
177
181
  .command("comments")
178
182
  .description("The comments on a deck's slides and boxes: the open ones, or --all")
@@ -208,7 +212,7 @@ export function registerPresentationCommands(program) {
208
212
  .option("--slot <box>", "The box it is about")
209
213
  .action(async (name, slide, text, opts) => {
210
214
  await prepare();
211
- const c = await addComment(refOf(name, opts.project), { slide: Number(slide), text, author: actor(), ...(opts.slot ? { slot: opts.slot } : {}) }).catch((err) => die(err.message));
215
+ const c = await addComment(refOf(name, opts.project), { slide: Number(slide), text, author: await actor(), ...(opts.slot ? { slot: opts.slot } : {}) }).catch((err) => die(err.message));
212
216
  console.log(`${chalk.green("commented")} ${c.id} on slide ${c.n}`);
213
217
  });
214
218
  cmd
@@ -221,7 +225,7 @@ export function registerPresentationCommands(program) {
221
225
  .option("--reopen", "Open it again instead")
222
226
  .action(async (name, id, opts) => {
223
227
  await prepare();
224
- await updateComment(refOf(name, opts.project), id, { resolved: !opts.reopen, author: actor(), ...(opts.reply ? { reply: opts.reply } : {}) }).catch((err) => die(err.message));
228
+ await updateComment(refOf(name, opts.project), id, { resolved: !opts.reopen, author: await actor(), ...(opts.reply ? { reply: opts.reply } : {}) }).catch((err) => die(err.message));
225
229
  console.log(`${chalk.green(opts.reopen ? "reopened" : "resolved")} ${id}`);
226
230
  });
227
231
  cmd
@@ -100,7 +100,7 @@ export function registerProjectCommands(program) {
100
100
  .argument("<title>", "Display title; the folder name is derived from it unless --slug is given")
101
101
  .option("--goal <text>", "One-line goal")
102
102
  .option("--slug <slug>", "Folder name under the root (lowercase, digits, dashes)")
103
- .option("--harness <harness>", "Harness every chat in the project runs on: claude | codex | pi (default: claude)")
103
+ .option("--harness <harness>", "Harness every chat in the project runs on: claude | codex | pi | antigravity (default: claude)")
104
104
  .option("--model <model>", "Model for that harness (default: the harness default)")
105
105
  .option("--effort <effort>", "Reasoning effort: low | medium | high | xhigh | max")
106
106
  .option("--json", "Print the new project as JSON")
@@ -141,7 +141,7 @@ export function registerProjectCommands(program) {
141
141
  .command("set")
142
142
  .description("Change the project's harness, model, effort, status or goal (like an agent's settings)")
143
143
  .argument("<slug>", "Project folder name")
144
- .option("--harness <harness>", "claude | codex | pi")
144
+ .option("--harness <harness>", "claude | codex | pi | antigravity")
145
145
  .option("--model <model>", 'Model for the harness; "" for the default')
146
146
  .option("--effort <effort>", 'low | medium | high | xhigh | max; "" for the default')
147
147
  .option("--status <status>", "active | paused | done | archived")
@@ -194,7 +194,7 @@ export function registerProjectCommands(program) {
194
194
  .argument("<slug>", "Project folder name")
195
195
  .argument("[entry]", "The line to record; omit with --file")
196
196
  .option("--file <path>", "Read the entry from a file")
197
- .option("--actor <actor>", "Who writes: human:<id>, <agent>/<harness>, process:<id>", "human:user")
197
+ .option("--actor <actor>", "Who writes: <agent>/<harness>, process:<id> (default: you, human:<handle>)")
198
198
  .action(async (slug, entry, opts) => {
199
199
  await prepare();
200
200
  try {
@@ -77,6 +77,8 @@ export interface ClientOptions {
77
77
  token?: string;
78
78
  /** Called when the server says this device is not paired (401 `{pair: true}`) — show the pairing screen. */
79
79
  onUnauthorized?: () => void;
80
+ /** Called when the workspace signs people in (kraftwerk.yml `users: cloud`) and this browser is not: 401 `{signin}` names where. */
81
+ onSignin?: (url: string) => void;
80
82
  }
81
83
  export interface Client {
82
84
  call<N extends ApiName>(name: N, ...input: InputArg<N>): Promise<ApiResult<N>>;
@@ -62,6 +62,9 @@ export function createClient(opts = {}) {
62
62
  fn();
63
63
  if (res.status === 401 && data?.pair === true)
64
64
  opts.onUnauthorized?.();
65
+ const signin = data?.signin;
66
+ if (res.status === 401 && typeof signin === "string")
67
+ opts.onSignin?.(signin);
65
68
  return res.ok ? { ok: true, status: res.status, data } : { ok: false, status: res.status, data, error: errorOf(data) };
66
69
  };
67
70
  return {
@@ -10,6 +10,7 @@ export declare const ROUTES: {
10
10
  readonly "agents.get": readonly ["GET", "/api/agents/:slug"];
11
11
  readonly "agents.journal": readonly ["GET", "/api/agents/:slug/journal"];
12
12
  readonly "agents.list": readonly ["GET", "/api/agents"];
13
+ readonly "agents.options": readonly ["GET", "/api/agent-options"];
13
14
  readonly "agents.routines": readonly ["GET", "/api/agents/:slug/routines"];
14
15
  readonly "agents.runRoutine": readonly ["POST", "/api/agents/:slug/routines/:id/run"];
15
16
  readonly "agents.save": readonly ["PUT", "/api/agents/:slug"];
@@ -100,6 +101,7 @@ export declare const ROUTES: {
100
101
  readonly "knowledge.list": readonly ["GET", "/api/knowledge"];
101
102
  readonly "knowledge.putConcept": readonly ["POST", "/api/knowledge/:bundle/concept"];
102
103
  readonly "knowledge.verify": readonly ["POST", "/api/knowledge/:bundle/verify"];
104
+ readonly "me.get": readonly ["GET", "/api/me"];
103
105
  readonly "meta.get": readonly ["GET", "/api/meta"];
104
106
  readonly "notifications.clear": readonly ["DELETE", "/api/notifications"];
105
107
  readonly "notifications.diagnose": readonly ["POST", "/api/notifications/:id/diagnose"];
@@ -11,6 +11,7 @@ export const ROUTES = {
11
11
  "agents.get": ["GET", "/api/agents/:slug"],
12
12
  "agents.journal": ["GET", "/api/agents/:slug/journal"],
13
13
  "agents.list": ["GET", "/api/agents"],
14
+ "agents.options": ["GET", "/api/agent-options"],
14
15
  "agents.routines": ["GET", "/api/agents/:slug/routines"],
15
16
  "agents.runRoutine": ["POST", "/api/agents/:slug/routines/:id/run"],
16
17
  "agents.save": ["PUT", "/api/agents/:slug"],
@@ -101,6 +102,7 @@ export const ROUTES = {
101
102
  "knowledge.list": ["GET", "/api/knowledge"],
102
103
  "knowledge.putConcept": ["POST", "/api/knowledge/:bundle/concept"],
103
104
  "knowledge.verify": ["POST", "/api/knowledge/:bundle/verify"],
105
+ "me.get": ["GET", "/api/me"],
104
106
  "meta.get": ["GET", "/api/meta"],
105
107
  "notifications.clear": ["DELETE", "/api/notifications"],
106
108
  "notifications.diagnose": ["POST", "/api/notifications/:id/diagnose"],
package/dist/config.d.ts CHANGED
@@ -38,6 +38,8 @@
38
38
  * enabled: false # a per-workspace veto; the machine's switch is `kraftwerk cloud on|off` (~/.kraftwerk/cloud.json)
39
39
  * # No key here: the daemon registers the MACHINE (its relay id) and `kraftwerk login` claims it.
40
40
  * # `url` and `interval` are deprecated: the cloud's origin is the machine's (cloud.json / KRAFTWERK_CLOUD_URL).
41
+ * users: # who works here (see UsersConfig)
42
+ * mode: cloud # local (default): this machine's handle · cloud: sign in with a kraftwerk cloud account
41
43
  */
42
44
  /** Stable, versionless URL of the workflow JSON schema (editor validation). */
43
45
  export declare const SCHEMA_URL = "https://raw.githubusercontent.com/NETNODEAG/kraftwerk/main/kraftwerk/schema/workflow.schema.json";
@@ -188,6 +190,25 @@ export interface CloudConfig {
188
190
  /** @deprecated Ignored: the cloud sets the heartbeat interval. */
189
191
  interval?: number;
190
192
  }
193
+ /**
194
+ * kraftwerk.yml `users:` — who the person working in this workspace is.
195
+ *
196
+ * users:
197
+ * mode: local # default: whoever sits at this machine, named by its handle (~/.kraftwerk/identity.json)
198
+ * mode: cloud # people sign in with their kraftwerk cloud account: the UI asks first, and
199
+ * # what they do is signed with their account (uuid, handle) — the same person
200
+ * # on every machine and clone
201
+ *
202
+ * `cloud` needs the machine's daemon connected to the cloud (it redeems the
203
+ * sign-in) and the workspace's `id`. The machine's own shell (the CLI) acts
204
+ * as the account that claimed the machine (`kraftwerk login`).
205
+ */
206
+ export interface UsersConfig {
207
+ mode?: UsersMode;
208
+ }
209
+ export type UsersMode = "local" | "cloud";
210
+ /** A workspace's users mode: `cloud` only when kraftwerk.yml says so. */
211
+ export declare const usersMode: (config: WorkspaceConfig) => UsersMode;
191
212
  export declare const CLOUD_DEFAULT_URL = "https://srv.kraftwerk-cloud.netnode.cloud";
192
213
  /** A directory as a .gitignore entry: relative, forward slashes, no trailing slash; undefined outside the root. */
193
214
  export declare function ignoreEntryFor(projectRoot: string, dir: string): string | undefined;
@@ -255,6 +276,8 @@ export interface WorkspaceConfig {
255
276
  presentations?: PresentationsConfig;
256
277
  /** The machine's cloud record lists this workspace. Absent = listed; `enabled: false` leaves it out. */
257
278
  cloud?: CloudConfig;
279
+ /** Who the people working here are: local (default) or signed in with a cloud account. */
280
+ users?: UsersConfig;
258
281
  }
259
282
  export interface ResolvedWorkspace {
260
283
  /** Absolute project root the CLI operates on. */
@@ -317,3 +340,14 @@ export declare function newWorkspaceId(): string;
317
340
  * Returns the id, or the one already there.
318
341
  */
319
342
  export declare function addWorkspaceId(configPath: string): Promise<string>;
343
+ /**
344
+ * kraftwerk.yml, parsed and checked — from the file cache while the file is
345
+ * unchanged (every request resolves the workspace, so this runs constantly).
346
+ * Each caller gets its own copy.
347
+ */
348
+ /**
349
+ * The config of a known workspace root, cheap enough for every request (one
350
+ * stat while kraftwerk.yml is unchanged); {} without one or when it does not
351
+ * parse.
352
+ */
353
+ export declare function configAt(root: string): Promise<WorkspaceConfig>;