@netnodeag/kraftwerk 0.99.0 → 0.100.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -2
- package/dist/cli/boards.js +15 -16
- package/dist/cli/cloud.js +60 -1
- package/dist/cli/daemon-call.d.ts +9 -0
- package/dist/cli/daemon-call.js +38 -0
- package/dist/cli/daemon.js +8 -2
- package/dist/cli/doctor.js +2 -2
- package/dist/client/routes.d.ts +2 -0
- package/dist/client/routes.js +2 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.js +7 -0
- package/dist/server/api/boards.d.ts +1 -0
- package/dist/server/api/boards.js +1 -1
- package/dist/server/api/cloud.d.ts +6 -1
- package/dist/server/api/cloud.js +18 -1
- package/dist/server/api/index.d.ts +7 -1
- package/dist/server/api/remote-boards.js +5 -2
- package/dist/server/api/workspace.js +2 -2
- package/dist/server/cloud-boards.d.ts +2 -0
- package/dist/server/cloud-boards.js +6 -2
- package/dist/server/cloud.js +5 -5
- package/dist/server/remote-boards.d.ts +9 -0
- package/dist/server/remote-boards.js +43 -17
- package/dist/server/workspace-cloud.d.ts +54 -0
- package/dist/server/workspace-cloud.js +97 -0
- package/package.json +1 -1
- package/web/dist/assets/{dist-BRxqHunp.js → dist-BQht4Kxn.js} +1 -1
- package/web/dist/assets/{dist-CZyarE8b.js → dist-C6Hh2gvr.js} +1 -1
- package/web/dist/assets/{dist-BXFsZFyR.js → dist-CYnkW4NZ.js} +1 -1
- package/web/dist/assets/dist-CxDUjCCR.js +1 -0
- package/web/dist/assets/{dist-DIla3sxz.js → dist-DQsdt9qV.js} +1 -1
- package/web/dist/assets/{dist-DAw93zvk.js → dist-Dhqv4G4v.js} +1 -1
- package/web/dist/assets/{dist-trHwQ1EL.js → dist-Dj1JIIbI.js} +1 -1
- package/web/dist/assets/{dist-CRwoZ0QP.js → dist-DmqwXVk5.js} +1 -1
- package/web/dist/assets/{dist-Ntegnq0p.js → dist-DxHapyfL.js} +1 -1
- package/web/dist/assets/{dist-MYpSAhEK.js → dist-KYJrjjHE.js} +1 -1
- package/web/dist/assets/{dist-CLgsXxq9.js → dist-OUSFQqAo.js} +1 -1
- package/web/dist/assets/{editor-BIPcwrnh.js → editor-DjVpjnNv.js} +3 -3
- package/web/dist/assets/{index-DbBIKEeD.js → index-BV1cBJKv.js} +17 -17
- package/web/dist/assets/index-ClVr51ut.css +2 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/dist-Whol13-K.js +0 -1
- package/web/dist/assets/index-BGgQaaA9.css +0 -2
package/README.md
CHANGED
|
@@ -496,6 +496,52 @@ repo. Agent logins made inside the container persist in the `agent-home`
|
|
|
496
496
|
volume. This is a different image from the `kraftwerk-runner` sandbox
|
|
497
497
|
(`runner/Dockerfile`) used by `run --sandbox`.
|
|
498
498
|
|
|
499
|
+
### Local or cloud: one switch
|
|
500
|
+
|
|
501
|
+
A workspace runs in **local mode** until you say otherwise: no account,
|
|
502
|
+
everything in files on this machine, single player. That is all you need to
|
|
503
|
+
try kraftwerk. **Cloud mode** adds people and a way in from anywhere:
|
|
504
|
+
|
|
505
|
+
| | Local | Cloud |
|
|
506
|
+
|---|---|---|
|
|
507
|
+
| Who | you, on this machine | everyone on the workspace, signed in with their kraftwerk cloud account |
|
|
508
|
+
| Boards | local boards (files) | local boards and cloud boards, shared with everyone on the workspace |
|
|
509
|
+
| Others | — | invite members (no clone, no install); a clone signs in with its own account |
|
|
510
|
+
| From elsewhere | — | another computer or your phone reaches the workspace |
|
|
511
|
+
| Your files, chats, runs, agents | on this machine | on this machine |
|
|
512
|
+
|
|
513
|
+
Local mode is not silent: kraftwerk reports minimal usage info — the
|
|
514
|
+
machine (name, handle, hostname, platform, version) and the workspaces it serves (names and ids, no
|
|
515
|
+
paths, no content) — so the machine can be claimed later. That is on by
|
|
516
|
+
default; a workspace opts out in its kraftwerk.yml, the whole machine with
|
|
517
|
+
`kraftwerk cloud off`:
|
|
518
|
+
|
|
519
|
+
```yaml
|
|
520
|
+
cloud:
|
|
521
|
+
enabled: false # report nothing about this workspace while it is in local mode
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
In cloud mode the workspace is always reported (the cloud has to know it);
|
|
525
|
+
the opt-out stays in kraftwerk.yml and holds again once you switch back.
|
|
526
|
+
|
|
527
|
+
The mode sits in the top bar (`local · try cloud` or `cloud`); a click
|
|
528
|
+
switches it, and Settings → *local or cloud* explains the difference. In the
|
|
529
|
+
terminal:
|
|
530
|
+
|
|
531
|
+
```bash
|
|
532
|
+
kraftwerk cloud connect --open # this workspace to cloud mode
|
|
533
|
+
kraftwerk cloud disconnect # back to local
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
Switching to cloud does in one go what used to be several steps: it turns
|
|
537
|
+
the machine's cloud on, gives the workspace its `id:`, and — once the
|
|
538
|
+
machine is claimed — writes `users: cloud`. Claiming is the one step you do yourself, in the browser,
|
|
539
|
+
once per machine: the switch shows the link and code and finishes on its
|
|
540
|
+
own when the claim lands; the page then asks you to sign in. Switching back
|
|
541
|
+
writes `users: local` and leaves the machine as it is. Only an owner
|
|
542
|
+
switches a workspace in cloud mode, and two switches never run at once. `GET /api/workspace/cloud` reports the mode and
|
|
543
|
+
its steps, `POST /api/workspace/cloud {mode}` switches.
|
|
544
|
+
|
|
499
545
|
### This machine in the kraftwerk cloud
|
|
500
546
|
|
|
501
547
|
The kraftwerk cloud is the `~/.kraftwerk` registry made reachable over the
|
|
@@ -519,7 +565,7 @@ kraftwerk logout # release the machine; a fresh claim code follows
|
|
|
519
565
|
kraftwerk cloud off # turn it off for this machine (the daemon says goodbye); `on [--url]` back on
|
|
520
566
|
```
|
|
521
567
|
|
|
522
|
-
The claim code is also shown under Settings →
|
|
568
|
+
The claim code is also shown under Settings → *local or cloud*. The switch and the
|
|
523
569
|
cloud's origin live in `~/.kraftwerk/cloud.json` (`{ "enabled": false,
|
|
524
570
|
"url": "…" }`); `KRAFTWERK_CLOUD_URL` in the environment wins (`off` turns
|
|
525
571
|
the feature off — what the test suites set). In kraftwerk.yml, `cloud:` is
|
|
@@ -575,10 +621,13 @@ Cloud boards are multiplayer. They live in kraftwerk cloud, belong to the
|
|
|
575
621
|
workspace's `id:`, and everyone on the workspace sees and edits them, from
|
|
576
622
|
their own machine or the cloud's web app (`/w/<ws id>`). A task goes to
|
|
577
623
|
anyone on the workspace or to an agent. They never sync with local boards.
|
|
624
|
+
New ones are made in cloud mode only: in local mode the boards page points
|
|
625
|
+
to the switch and creating one answers 409 with `local: true`. A workspace
|
|
626
|
+
in local mode with an `id:` keeps reaching the cloud boards it already has.
|
|
578
627
|
|
|
579
628
|
Here they are boards like any other, with a cloud mark: on Home, in the
|
|
580
629
|
boards page, on a task's page beside its chat. Pick "kraftwerk cloud" when
|
|
581
|
-
you make a board. A cloud board's slug starts with `@`, so the same API
|
|
630
|
+
you make a board (`kraftwerk boards create <title> --cloud`). A cloud board's slug starts with `@`, so the same API
|
|
582
631
|
(`/api/boards/@launch/tasks/3`) and the same commands
|
|
583
632
|
(`kraftwerk tasks show 3 --board @launch`) work on it. A cloud task has no
|
|
584
633
|
folder and no files; a cloud board has no default agent, rules or project
|
package/dist/cli/boards.js
CHANGED
|
@@ -3,11 +3,10 @@ import Table from "cli-table3";
|
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { appendTaskLog, assignTask, createBoard, createTask, DEFAULT_BOARD, deleteBoard, deleteTask, ensureDefaultBoard, getBoard, getTask, listAllBoards, listBoards, moveTask, pickTask, saveBoard, saveTask, } from "../core/boards.js";
|
|
5
5
|
import { taskSessions } from "../core/board-wake.js";
|
|
6
|
+
import { workspaceCall } from "./daemon-call.js";
|
|
6
7
|
import { initContext as prepare } from "./routines.js";
|
|
7
8
|
import { fmtAgo } from "./workspaces.js";
|
|
8
9
|
import { actorFor } from "../core/person.js";
|
|
9
|
-
import { resolveWorkspace, workspaceSlug } from "../config.js";
|
|
10
|
-
import { findDaemon } from "../core/daemon.js";
|
|
11
10
|
/**
|
|
12
11
|
* `kraftwerk boards` and `kraftwerk tasks` — the boards (columns of tasks)
|
|
13
12
|
* of a project or of the workspace, and the tasks on them. The same module
|
|
@@ -73,20 +72,7 @@ async function whereOf(w, create = false) {
|
|
|
73
72
|
const isCloud = (w) => !!w.board?.trim().startsWith("@");
|
|
74
73
|
/** The boards API of this workspace on the running daemon — the way to a cloud board. */
|
|
75
74
|
async function cloudApi(method, route, body) {
|
|
76
|
-
|
|
77
|
-
const daemon = await findDaemon();
|
|
78
|
-
if (!daemon)
|
|
79
|
-
die("cloud boards go through the daemon, and it is not running — `kraftwerk daemon start`");
|
|
80
|
-
const r = await fetch(`http://127.0.0.1:${daemon.port}/w/${encodeURIComponent(workspaceSlug(ws))}${route}`, {
|
|
81
|
-
method,
|
|
82
|
-
headers: body !== undefined ? { "content-type": "application/json" } : {},
|
|
83
|
-
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
84
|
-
signal: AbortSignal.timeout(20_000),
|
|
85
|
-
}).catch((err) => die(`the daemon did not answer: ${err.message}`));
|
|
86
|
-
const data = (await r.json().catch(() => ({})));
|
|
87
|
-
if (!r.ok)
|
|
88
|
-
die(data.error ?? `${r.status} from the daemon`);
|
|
89
|
-
return data;
|
|
75
|
+
return workspaceCall(method, route, body).catch((err) => die(err.message));
|
|
90
76
|
}
|
|
91
77
|
const cloudTask = (w, task, rest = "") => `/api/boards/${encodeURIComponent(w.board.trim())}/tasks/${encodeURIComponent(task)}${rest}`;
|
|
92
78
|
const flags = (ref) => (ref.project ? `--project ${ref.project} --board ${ref.board}` : `--board ${ref.board}`);
|
|
@@ -208,8 +194,21 @@ export function registerBoardCommands(program) {
|
|
|
208
194
|
.option("--columns <list>", "Comma-separated column slugs")
|
|
209
195
|
.option("--agent <slug>", "Default agent: tasks entering todo unassigned go to it")
|
|
210
196
|
.option("--notes <text>", "The board's rules (the body of board.md)")
|
|
197
|
+
.option("--cloud", "Keep it in kraftwerk cloud, shared with everyone on the workspace (cloud mode: `kraftwerk cloud connect`)")
|
|
211
198
|
.option("--json", "Print the board as JSON")
|
|
212
199
|
.action(async (title, opts) => {
|
|
200
|
+
if (opts.cloud) {
|
|
201
|
+
if (opts.project)
|
|
202
|
+
die("a cloud board belongs to the workspace, not a project — drop --project");
|
|
203
|
+
if (opts.agent || opts.notes)
|
|
204
|
+
die("a cloud board has no default agent or rules — drop --agent and --notes");
|
|
205
|
+
const b = await cloudApi("POST", "/api/boards", { title, cloud: true, ...(opts.slug ? { slug: opts.slug } : {}), ...(opts.columns ? { columns: opts.columns.split(",").map((s) => s.trim()).filter(Boolean) } : {}) });
|
|
206
|
+
if (opts.json)
|
|
207
|
+
console.log(JSON.stringify(b, null, 2));
|
|
208
|
+
else
|
|
209
|
+
console.log(`${chalk.green("✔")} ${chalk.cyan(b.board)} ${chalk.dim(`in kraftwerk cloud (columns: ${b.columns.map((c) => c.slug).join(", ")})`)}`);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
213
212
|
await prepare();
|
|
214
213
|
try {
|
|
215
214
|
const b = await createBoard({ project: opts.project, title, slug: opts.slug, columns: opts.columns ? opts.columns.split(",").map((s) => s.trim()).filter(Boolean) : undefined, agent: opts.agent, notes: opts.notes });
|
package/dist/cli/cloud.js
CHANGED
|
@@ -2,6 +2,8 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { CloudError, claimUrlFor, envCloudOff, machineCloud, machineGoodbye, machineHeartbeat, machineRegister, machineUnlink, writeCloudFile, } from "../core/cloud.js";
|
|
5
|
+
import { resolveWorkspace, workspaceSlug } from "../config.js";
|
|
6
|
+
import { workspaceCall } from "./daemon-call.js";
|
|
5
7
|
import { findDaemon } from "../core/daemon.js";
|
|
6
8
|
import { identityString, readIdentity } from "../core/identity.js";
|
|
7
9
|
import { relayId, fromBase64Url } from "../client/relay.js";
|
|
@@ -221,12 +223,59 @@ async function logout() {
|
|
|
221
223
|
printClaim(st);
|
|
222
224
|
console.log(chalk.dim(" `kraftwerk login` claims it again"));
|
|
223
225
|
}
|
|
226
|
+
/** This folder's workspace's mode on the daemon (opened there when needed): GET, or a switch. */
|
|
227
|
+
const workspaceMode = (mode) => workspaceCall(mode ? "POST" : "GET", "/api/workspace/cloud", mode ? { mode } : undefined, { open: true });
|
|
228
|
+
async function connect(opts) {
|
|
229
|
+
const timeout = Number(opts.timeout ?? 600);
|
|
230
|
+
if (!Number.isFinite(timeout) || timeout <= 0)
|
|
231
|
+
fail("--timeout must be a positive number of seconds", 2);
|
|
232
|
+
const ws = await resolveWorkspace(process.cwd()).catch((err) => fail(err.message));
|
|
233
|
+
let st = await workspaceMode("cloud").catch((err) => fail(err.message));
|
|
234
|
+
const until = Date.now() + timeout * 1000;
|
|
235
|
+
let shown = false;
|
|
236
|
+
// Waiting is for the machine to connect and for the claim in the browser; anything else needs the person.
|
|
237
|
+
while ((st.next === "connect" || st.next === "claim") && Date.now() < until) {
|
|
238
|
+
if (st.next === "claim" && !shown) {
|
|
239
|
+
shown = true;
|
|
240
|
+
console.log("Sign in (or sign up) in the browser and claim this machine — once, for every workspace on it:");
|
|
241
|
+
printClaim({ url: st.url, claimCode: st.claimCode, claimUrl: st.claimUrl });
|
|
242
|
+
if (opts.open && st.claimUrl)
|
|
243
|
+
openBrowser(st.claimUrl);
|
|
244
|
+
console.log(chalk.dim("waiting for the claim … (Ctrl-C stops; `kraftwerk cloud connect` picks up again)"));
|
|
245
|
+
}
|
|
246
|
+
await new Promise((r) => setTimeout(r, POLL_MS));
|
|
247
|
+
st = await workspaceMode("cloud").catch(() => st);
|
|
248
|
+
}
|
|
249
|
+
if (st.mode !== "cloud") {
|
|
250
|
+
fail(st.problem ??
|
|
251
|
+
(st.next === "claim" ? `not claimed within ${timeout}s — the code stays valid; \`kraftwerk cloud connect\` waits again` : st.next === "connect" ? `${st.url} did not answer within ${timeout}s` : `could not reach ${st.url}`));
|
|
252
|
+
}
|
|
253
|
+
const name = workspaceSlug(ws);
|
|
254
|
+
console.log(`${chalk.green("✔")} ${chalk.bold(name)} is in cloud mode ${chalk.dim(`— claimed by ${st.account}`)}`);
|
|
255
|
+
console.log(` in the browser ${chalk.dim("the workspace asks you to sign in with your cloud account")}`);
|
|
256
|
+
if (st.workspaceUrl)
|
|
257
|
+
console.log(` in the cloud ${chalk.cyan(st.workspaceUrl)}`);
|
|
258
|
+
console.log(chalk.dim(" cloud boards: `kraftwerk boards create <title> --cloud`, invite people: `kraftwerk invite`"));
|
|
259
|
+
}
|
|
260
|
+
async function disconnect() {
|
|
261
|
+
const ws = await resolveWorkspace(process.cwd()).catch((err) => fail(err.message));
|
|
262
|
+
await workspaceMode("local").catch((err) => fail(err.message));
|
|
263
|
+
console.log(`${chalk.green("✔")} ${chalk.bold(workspaceSlug(ws))} is in local mode ${chalk.dim("— no sign-in; new cloud boards need cloud mode again")}`);
|
|
264
|
+
console.log(chalk.dim(" the machine stays connected for the minimal usage report — `cloud: { enabled: false }` in kraftwerk.yml leaves this workspace out, `kraftwerk cloud off` the whole machine"));
|
|
265
|
+
}
|
|
224
266
|
export function registerCloudCommands(program) {
|
|
225
267
|
const cloud = program
|
|
226
268
|
.command("cloud")
|
|
227
|
-
.description("
|
|
269
|
+
.description("Local or cloud: `connect` switches this workspace to cloud mode, `disconnect` back; status, on, off for this machine")
|
|
228
270
|
.option("--json", "Machine-readable output")
|
|
229
271
|
.addHelpText("after", `
|
|
272
|
+
A workspace runs in local mode (files on this machine, single player, no
|
|
273
|
+
account) until you switch it to cloud mode: people sign in with their cloud
|
|
274
|
+
account, cloud boards are shared, others join as members, you reach it from
|
|
275
|
+
anywhere.
|
|
276
|
+
kraftwerk cloud connect [--open] this workspace to cloud mode — every step at once
|
|
277
|
+
kraftwerk cloud disconnect back to local mode
|
|
278
|
+
|
|
230
279
|
The daemon registers this machine once; its open workspaces ride along.
|
|
231
280
|
kraftwerk cloud registered? claimed? url, machine id, last heartbeat
|
|
232
281
|
kraftwerk cloud on [--url <u>] turn it on (~/.kraftwerk/cloud.json); the daemon follows at once
|
|
@@ -245,6 +294,16 @@ A workspace stays out with \`cloud: { enabled: false }\` in its kraftwerk.yml.`)
|
|
|
245
294
|
.description("Turn the cloud on for this machine (the running daemon registers at once)")
|
|
246
295
|
.option("--url <url>", "The cloud's origin (default: the kraftwerk cloud)")
|
|
247
296
|
.action(async (opts) => setEnabled(true, opts.url));
|
|
297
|
+
cloud
|
|
298
|
+
.command("connect")
|
|
299
|
+
.description("Switch this workspace to cloud mode: turns the cloud on, claims the machine (in the browser), gives the workspace its id, makes people sign in")
|
|
300
|
+
.option("--open", "Open the claim link in the browser")
|
|
301
|
+
.option("--timeout <seconds>", "How long to wait for the claim", "600")
|
|
302
|
+
.action(async (opts) => connect(opts));
|
|
303
|
+
cloud
|
|
304
|
+
.command("disconnect")
|
|
305
|
+
.description("Switch this workspace back to local mode (no sign-in, no cloud boards); the machine stays as it is")
|
|
306
|
+
.action(async () => disconnect());
|
|
248
307
|
cloud
|
|
249
308
|
.command("off")
|
|
250
309
|
.description("Turn the cloud off for this machine (the running daemon says goodbye)")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A route of this folder's workspace on the running daemon — what the CLI
|
|
3
|
+
* uses for what only the daemon does (cloud boards, the workspace's cloud
|
|
4
|
+
* mode). `open`: a workspace the daemon does not serve yet is opened there
|
|
5
|
+
* first (else that is an error). Throws an Error with the daemon's message.
|
|
6
|
+
*/
|
|
7
|
+
export declare function workspaceCall<T>(method: string, route: string, body?: unknown, opts?: {
|
|
8
|
+
open?: boolean;
|
|
9
|
+
}): Promise<T>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { resolveWorkspace, workspaceSlug } from "../config.js";
|
|
2
|
+
import { findDaemon } from "../core/daemon.js";
|
|
3
|
+
/**
|
|
4
|
+
* A route of this folder's workspace on the running daemon — what the CLI
|
|
5
|
+
* uses for what only the daemon does (cloud boards, the workspace's cloud
|
|
6
|
+
* mode). `open`: a workspace the daemon does not serve yet is opened there
|
|
7
|
+
* first (else that is an error). Throws an Error with the daemon's message.
|
|
8
|
+
*/
|
|
9
|
+
export async function workspaceCall(method, route, body, opts = {}) {
|
|
10
|
+
const ws = await resolveWorkspace(process.cwd());
|
|
11
|
+
const daemon = await findDaemon();
|
|
12
|
+
if (!daemon)
|
|
13
|
+
throw new Error("this goes through the daemon, and it is not running — `kraftwerk daemon start`");
|
|
14
|
+
const base = `http://127.0.0.1:${daemon.port}`;
|
|
15
|
+
const send = (url, m, b) => fetch(url, {
|
|
16
|
+
method: m,
|
|
17
|
+
headers: b !== undefined ? { "content-type": "application/json" } : {},
|
|
18
|
+
body: b !== undefined ? JSON.stringify(b) : undefined,
|
|
19
|
+
signal: AbortSignal.timeout(20_000),
|
|
20
|
+
}).catch((err) => {
|
|
21
|
+
throw new Error(`the daemon did not answer: ${err.message}`);
|
|
22
|
+
});
|
|
23
|
+
const read = async (r) => (await r.json().catch(() => ({})));
|
|
24
|
+
const url = `${base}/w/${encodeURIComponent(workspaceSlug(ws))}${route}`;
|
|
25
|
+
let r = await send(url, method, body);
|
|
26
|
+
// Not served there yet: open it (its slug may differ from the folder's), then ask again.
|
|
27
|
+
if (r.status === 404 && opts.open) {
|
|
28
|
+
const o = await send(`${base}/api/hub/open`, "POST", { root: ws.root });
|
|
29
|
+
const opened = (await read(o));
|
|
30
|
+
if (!o.ok || !opened.slug)
|
|
31
|
+
throw new Error(opened.error ?? `${o.status} from the daemon`);
|
|
32
|
+
r = await send(`${base}/w/${encodeURIComponent(opened.slug)}${route}`, method, body);
|
|
33
|
+
}
|
|
34
|
+
const data = await read(r);
|
|
35
|
+
if (!r.ok)
|
|
36
|
+
throw new Error(data.error ?? `${r.status} from the daemon`);
|
|
37
|
+
return data;
|
|
38
|
+
}
|
package/dist/cli/daemon.js
CHANGED
|
@@ -3,7 +3,7 @@ import { DAEMON_PORT, daemonState, lastOpenRoots, setDaemonVersion, writeDaemonF
|
|
|
3
3
|
import { tildify } from "../core/instances.js";
|
|
4
4
|
import { log } from "../core/log.js";
|
|
5
5
|
import { networkUrls } from "../server/bind.js";
|
|
6
|
-
import { startMachineCloud } from "../server/cloud.js";
|
|
6
|
+
import { cloudStatus, startMachineCloud, syncMachineCloud } from "../server/cloud.js";
|
|
7
7
|
import { startPushWatcher } from "../server/push.js";
|
|
8
8
|
import { applyRelay, relayPush } from "../server/relay.js";
|
|
9
9
|
import { startHub } from "../server/server.js";
|
|
@@ -37,7 +37,13 @@ export async function runDaemon(opts) {
|
|
|
37
37
|
port,
|
|
38
38
|
staticDir: ensureBuilt(),
|
|
39
39
|
daemon: true,
|
|
40
|
-
onChange:
|
|
40
|
+
onChange: async (h) => {
|
|
41
|
+
await writeDaemonFile(h.port, h.list().map((o) => o.root));
|
|
42
|
+
// A workspace opened or closed: the cloud hears it now, not with the next heartbeat (up to a minute) —
|
|
43
|
+
// until then its cloud boards and git answer "this machine does not host that workspace".
|
|
44
|
+
if (cloudStatus().state === "connected")
|
|
45
|
+
void syncMachineCloud().catch(() => { });
|
|
46
|
+
},
|
|
41
47
|
});
|
|
42
48
|
await writeDaemonFile(hub.port, []);
|
|
43
49
|
for (const root of reopen) {
|
package/dist/cli/doctor.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readFile } from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import { machineCloud } from "../core/cloud.js";
|
|
6
|
-
import { addWorkspaceId, ignoreEntryFor, isDir, reposRootFor, resolveWorkspace, workspaceSlug } from "../config.js";
|
|
6
|
+
import { addWorkspaceId, cloudIncluded, ignoreEntryFor, isDir, reposRootFor, resolveWorkspace, workspaceSlug } from "../config.js";
|
|
7
7
|
import { discoverWorkflows } from "../discover.js";
|
|
8
8
|
import { missingEnv } from "../yaml.js";
|
|
9
9
|
import { applyDotenv, DOTENV_FILE } from "../dotenv.js";
|
|
@@ -181,7 +181,7 @@ export async function runDoctor(cwd, opts = {}) {
|
|
|
181
181
|
// The kraftwerk cloud: the daemon registers the machine; doctor only says what would happen to this workspace.
|
|
182
182
|
const ymlCloud = project.config.cloud;
|
|
183
183
|
const cloud = await machineCloud(ymlCloud?.url ? [ymlCloud.url] : []);
|
|
184
|
-
if (
|
|
184
|
+
if (!cloudIncluded(project.config)) {
|
|
185
185
|
report("info", "cloud: this workspace is left out", "cloud.enabled: false in kraftwerk.yml — the machine's cloud record does not list it");
|
|
186
186
|
}
|
|
187
187
|
else if (!cloud.enabled) {
|
package/dist/client/routes.d.ts
CHANGED
|
@@ -207,6 +207,8 @@ export declare const ROUTES: {
|
|
|
207
207
|
readonly "workflows.list": readonly ["GET", "/api/workflows"];
|
|
208
208
|
readonly "workflows.run": readonly ["POST", "/api/workflows/:slug/run"];
|
|
209
209
|
readonly "workflows.runner": readonly ["GET", "/api/workflows/:slug/run"];
|
|
210
|
+
readonly "workspace.cloud.get": readonly ["GET", "/api/workspace/cloud"];
|
|
211
|
+
readonly "workspace.cloud.set": readonly ["POST", "/api/workspace/cloud"];
|
|
210
212
|
readonly "workspaces.forget": readonly ["POST", "/api/workspaces/forget"];
|
|
211
213
|
readonly "workspaces.list": readonly ["GET", "/api/workspaces"];
|
|
212
214
|
readonly "workspaces.start": readonly ["POST", "/api/workspaces/start"];
|
package/dist/client/routes.js
CHANGED
|
@@ -208,6 +208,8 @@ export const ROUTES = {
|
|
|
208
208
|
"workflows.list": ["GET", "/api/workflows"],
|
|
209
209
|
"workflows.run": ["POST", "/api/workflows/:slug/run"],
|
|
210
210
|
"workflows.runner": ["GET", "/api/workflows/:slug/run"],
|
|
211
|
+
"workspace.cloud.get": ["GET", "/api/workspace/cloud"],
|
|
212
|
+
"workspace.cloud.set": ["POST", "/api/workspace/cloud"],
|
|
211
213
|
"workspaces.forget": ["POST", "/api/workspaces/forget"],
|
|
212
214
|
"workspaces.list": ["GET", "/api/workspaces"],
|
|
213
215
|
"workspaces.start": ["POST", "/api/workspaces/start"],
|
package/dist/config.d.ts
CHANGED
|
@@ -209,6 +209,13 @@ export interface UsersConfig {
|
|
|
209
209
|
export type UsersMode = "local" | "cloud";
|
|
210
210
|
/** A workspace's users mode: `cloud` only when kraftwerk.yml says so. */
|
|
211
211
|
export declare const usersMode: (config: WorkspaceConfig) => UsersMode;
|
|
212
|
+
/**
|
|
213
|
+
* Whether the machine's cloud record lists this workspace. `cloud.enabled:
|
|
214
|
+
* false` leaves a workspace in local mode out (its minimal usage report);
|
|
215
|
+
* a workspace in cloud mode is always in, since cloud mode needs the cloud
|
|
216
|
+
* to know it — and switching back to local finds the opt-out still there.
|
|
217
|
+
*/
|
|
218
|
+
export declare const cloudIncluded: (config: WorkspaceConfig) => boolean;
|
|
212
219
|
export declare const CLOUD_DEFAULT_URL = "https://srv.kraftwerk-cloud.netnode.cloud";
|
|
213
220
|
/** A directory as a .gitignore entry: relative, forward slashes, no trailing slash; undefined outside the root. */
|
|
214
221
|
export declare function ignoreEntryFor(projectRoot: string, dir: string): string | undefined;
|
package/dist/config.js
CHANGED
|
@@ -127,6 +127,13 @@ export function entitiesRootFor(project, kind) {
|
|
|
127
127
|
}
|
|
128
128
|
/** A workspace's users mode: `cloud` only when kraftwerk.yml says so. */
|
|
129
129
|
export const usersMode = (config) => (config.users?.mode === "cloud" ? "cloud" : "local");
|
|
130
|
+
/**
|
|
131
|
+
* Whether the machine's cloud record lists this workspace. `cloud.enabled:
|
|
132
|
+
* false` leaves a workspace in local mode out (its minimal usage report);
|
|
133
|
+
* a workspace in cloud mode is always in, since cloud mode needs the cloud
|
|
134
|
+
* to know it — and switching back to local finds the opt-out still there.
|
|
135
|
+
*/
|
|
136
|
+
export const cloudIncluded = (config) => usersMode(config) === "cloud" || config.cloud?.enabled !== false;
|
|
130
137
|
export const CLOUD_DEFAULT_URL = "https://srv.kraftwerk-cloud.netnode.cloud";
|
|
131
138
|
/** A directory as a .gitignore entry: relative, forward slashes, no trailing slash; undefined outside the root. */
|
|
132
139
|
export function ignoreEntryFor(projectRoot, dir) {
|
|
@@ -31,6 +31,7 @@ export declare const boardRoutes: (import("./router.js").Route<"boards.create",
|
|
|
31
31
|
error?: string;
|
|
32
32
|
boards: import("../../core/boards.js").BoardSummary[];
|
|
33
33
|
cloud: {
|
|
34
|
+
local?: boolean | undefined;
|
|
34
35
|
offline?: boolean | undefined;
|
|
35
36
|
error?: string | undefined;
|
|
36
37
|
};
|
|
@@ -55,7 +55,7 @@ export const boardRoutes = [
|
|
|
55
55
|
]);
|
|
56
56
|
if (!remote)
|
|
57
57
|
return local;
|
|
58
|
-
return { ...local, boards: [...local.boards, ...remote.boards], cloud: { ...(remote.offline ? { offline: true } : {}), ...(remote.error ? { error: remote.error } : {}) } };
|
|
58
|
+
return { ...local, boards: [...local.boards, ...remote.boards], cloud: { ...(remote.local ? { local: true } : {}), ...(remote.offline ? { offline: true } : {}), ...(remote.error ? { error: remote.error } : {}) } };
|
|
59
59
|
}),
|
|
60
60
|
route({
|
|
61
61
|
name: "boards.create",
|
|
@@ -91,4 +91,9 @@ export declare const cloudRoutes: (import("./router.js").Route<"cloud.invite", i
|
|
|
91
91
|
claimCode?: string | null;
|
|
92
92
|
claimUrl?: string | null;
|
|
93
93
|
workspaces?: number;
|
|
94
|
-
}, "/api/cloud/unlink", undefined>)
|
|
94
|
+
}, "/api/cloud/unlink", undefined> | import("./router.js").Route<"workspace.cloud.get", import("../workspace-cloud.js").WorkspaceCloud, "/api/workspace/cloud", undefined> | import("./router.js").Route<"workspace.cloud.set", import("../workspace-cloud.js").WorkspaceCloud, "/api/workspace/cloud", z.ZodObject<{
|
|
95
|
+
mode: z.ZodEnum<{
|
|
96
|
+
cloud: "cloud";
|
|
97
|
+
local: "local";
|
|
98
|
+
}>;
|
|
99
|
+
}, z.core.$strip>>)[];
|
package/dist/server/api/cloud.js
CHANGED
|
@@ -2,7 +2,8 @@ import * as z from "zod";
|
|
|
2
2
|
import { writeCloudFile } from "../../core/cloud.js";
|
|
3
3
|
import { applyMachineCloud, cloudStatus, createWorkspaceInvite, syncMachineCloud, unlinkMachineCloud } from "../cloud.js";
|
|
4
4
|
import { currentHub } from "../hub-context.js";
|
|
5
|
-
import {
|
|
5
|
+
import { setWorkspaceCloud, workspaceCloud } from "../workspace-cloud.js";
|
|
6
|
+
import { fail, route } from "./router.js";
|
|
6
7
|
/**
|
|
7
8
|
* The machine in the kraftwerk cloud (server/cloud.ts): its record, turning
|
|
8
9
|
* it on or off, a round now, releasing the claim. What `kraftwerk cloud`,
|
|
@@ -48,4 +49,20 @@ export const cloudRoutes = [
|
|
|
48
49
|
daemon: currentHub().daemon === true,
|
|
49
50
|
...(await unlinkMachineCloud()),
|
|
50
51
|
})),
|
|
52
|
+
// This workspace's mode — local or cloud — as one switch (server/workspace-cloud.ts).
|
|
53
|
+
route({ name: "workspace.cloud.get", method: "GET", path: "/api/workspace/cloud", summary: "this workspace's mode (local | cloud) and the steps cloud mode needs: machine on, claimed, workspace id, sign-in", access: "local" }, async () => workspaceCloud()),
|
|
54
|
+
route({
|
|
55
|
+
name: "workspace.cloud.set",
|
|
56
|
+
method: "POST",
|
|
57
|
+
path: "/api/workspace/cloud",
|
|
58
|
+
summary: "switch this workspace to local or cloud {mode}; cloud does every step it can and answers next: \"claim\" while the browser has to claim the machine",
|
|
59
|
+
access: "local",
|
|
60
|
+
errors: 400,
|
|
61
|
+
body: z.object({ mode: z.enum(["local", "cloud"]) }),
|
|
62
|
+
}, async (c) => {
|
|
63
|
+
// In cloud mode only an owner switches the workspace back.
|
|
64
|
+
if (c.trust.kind === "local" && c.trust.user && c.trust.user.role !== "owner")
|
|
65
|
+
fail(403, "only an owner of the workspace switches its mode");
|
|
66
|
+
return setWorkspaceCloud((await c.body()).mode);
|
|
67
|
+
}),
|
|
51
68
|
];
|
|
@@ -131,6 +131,7 @@ export declare const routes: (Route<"agents.addJournal", {
|
|
|
131
131
|
error?: string;
|
|
132
132
|
boards: import("../../core/boards.js").BoardSummary[];
|
|
133
133
|
cloud: {
|
|
134
|
+
local?: boolean | undefined;
|
|
134
135
|
offline?: boolean | undefined;
|
|
135
136
|
error?: string | undefined;
|
|
136
137
|
};
|
|
@@ -1071,7 +1072,12 @@ export declare const routes: (Route<"agents.addJournal", {
|
|
|
1071
1072
|
}, z.core.$strip>> | Route<"workflows.runner", {
|
|
1072
1073
|
available: boolean;
|
|
1073
1074
|
image: boolean;
|
|
1074
|
-
}, "/api/workflows/:slug/run", undefined> | Route<"
|
|
1075
|
+
}, "/api/workflows/:slug/run", undefined> | Route<"workspace.cloud.get", import("../workspace-cloud.js").WorkspaceCloud, "/api/workspace/cloud", undefined> | Route<"workspace.cloud.set", import("../workspace-cloud.js").WorkspaceCloud, "/api/workspace/cloud", z.ZodObject<{
|
|
1076
|
+
mode: z.ZodEnum<{
|
|
1077
|
+
cloud: "cloud";
|
|
1078
|
+
local: "local";
|
|
1079
|
+
}>;
|
|
1080
|
+
}, z.core.$strip>> | Route<"workspaces.forget", {
|
|
1075
1081
|
ok: boolean;
|
|
1076
1082
|
}, "/api/workspaces/forget", z.ZodObject<{
|
|
1077
1083
|
root: z.ZodOptional<z.ZodString>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { remoteCall, remoteWorkspaceUrl } from "../remote-boards.js";
|
|
2
|
+
import { remoteCall, remoteWorkspaceUrl, requireCloudMode } from "../remote-boards.js";
|
|
3
3
|
import { reply, route } from "./router.js";
|
|
4
4
|
const BoardFields = z.object({
|
|
5
5
|
title: z.string().optional(),
|
|
@@ -29,7 +29,10 @@ export const remoteBoardRoutes = [
|
|
|
29
29
|
const r = await remoteCall(c.trust, { method: "GET", path: "boards", actor: actorOf(c) });
|
|
30
30
|
return { ...r, cloudUrl: await remoteWorkspaceUrl() };
|
|
31
31
|
}),
|
|
32
|
-
route({ name: "remoteBoards.create", method: "POST", path: "/api/remote-boards", summary: "create a remote board {title, slug?, columns?}", body: BoardFields }, async (c) =>
|
|
32
|
+
route({ name: "remoteBoards.create", method: "POST", path: "/api/remote-boards", summary: "create a remote board {title, slug?, columns?}", body: BoardFields }, async (c) => {
|
|
33
|
+
await requireCloudMode();
|
|
34
|
+
return reply(201, await remoteCall(c.trust, { method: "POST", path: "boards", body: await c.body() }));
|
|
35
|
+
}),
|
|
33
36
|
route({ name: "remoteBoards.people", method: "GET", path: "/api/remote-boards/people", summary: "the people of the workspace (assignable as human:<handle>) and who you are there" }, async (c) => remoteCall(c.trust, { method: "GET", path: "people", actor: actorOf(c) })),
|
|
34
37
|
route({ name: "remoteBoards.get", method: "GET", path: "/api/remote-boards/:board", summary: "a remote board: columns, counts, every task, the people" }, async (c) => remoteCall(c.trust, { method: "GET", path: board(c), actor: actorOf(c) })),
|
|
35
38
|
route({ name: "remoteBoards.save", method: "PUT", path: "/api/remote-boards/:board", summary: "rename a remote board or change its columns", body: BoardFields }, async (c) => remoteCall(c.trust, { method: "PUT", path: board(c), body: await c.body() })),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { absolutePath, resolveWorkspace, slugFromFolder, usersMode, workspaceSlug } from "../../config.js";
|
|
3
|
+
import { absolutePath, cloudIncluded, resolveWorkspace, slugFromFolder, usersMode, workspaceSlug } from "../../config.js";
|
|
4
4
|
import { disposeAllBackends } from "../../core/chat/sessions.js";
|
|
5
5
|
import { cloudStatus } from "../cloud.js";
|
|
6
6
|
import { workspaceRoot } from "../../core/context.js";
|
|
@@ -119,7 +119,7 @@ export const workspaceRoutes = [
|
|
|
119
119
|
/** @deprecated Always "": the Cloudflare Tunnel that set it was removed in 0.65. Removed with protocol 2. */
|
|
120
120
|
publicUrl: "",
|
|
121
121
|
// The machine's cloud record (only the daemon registers one); `included`: this workspace rides along (no cloud.enabled: false veto).
|
|
122
|
-
cloud: { ...cloudStatus(), included: ws
|
|
122
|
+
cloud: { ...cloudStatus(), included: ws ? cloudIncluded(ws.config) : true },
|
|
123
123
|
switcher,
|
|
124
124
|
};
|
|
125
125
|
}),
|
|
@@ -24,6 +24,8 @@ export interface CloudList {
|
|
|
24
24
|
/** Why there are none to show: offline (the cloud off or not answering), or not set up for this workspace. */
|
|
25
25
|
error?: string;
|
|
26
26
|
offline?: boolean;
|
|
27
|
+
/** The workspace is in local mode: no cloud boards until it is switched to cloud. */
|
|
28
|
+
local?: boolean;
|
|
27
29
|
/** This workspace in the cloud's web app. */
|
|
28
30
|
url?: string | null;
|
|
29
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiError } from "./api/router.js";
|
|
2
|
-
import { remoteCall } from "./remote-boards.js";
|
|
2
|
+
import { inLocalMode, remoteCall, requireCloudMode } from "./remote-boards.js";
|
|
3
3
|
/**
|
|
4
4
|
* Cloud boards in the shape of local boards. The boards API (api/boards.ts)
|
|
5
5
|
* serves a cloud board wherever it serves a local one, so every view —
|
|
@@ -86,11 +86,14 @@ function detail(board, t) {
|
|
|
86
86
|
export async function listCloudBoards(trust) {
|
|
87
87
|
try {
|
|
88
88
|
const r = await remoteCall(trust, { method: "GET", path: "boards" });
|
|
89
|
-
|
|
89
|
+
// In local mode the ones made before stay; `local` tells the UI to offer cloud mode for new ones.
|
|
90
|
+
return { boards: r.boards.map(summary), ...((await inLocalMode()) ? { local: true } : {}) };
|
|
90
91
|
}
|
|
91
92
|
catch (err) {
|
|
92
93
|
const e = err;
|
|
93
94
|
const body = (e.body ?? {});
|
|
95
|
+
if (body.local)
|
|
96
|
+
return { boards: [], local: true };
|
|
94
97
|
return { boards: [], error: e.message, ...(body.offline ? { offline: true } : {}) };
|
|
95
98
|
}
|
|
96
99
|
}
|
|
@@ -117,6 +120,7 @@ export async function getCloudTask(trust, board, t) {
|
|
|
117
120
|
}
|
|
118
121
|
/* ---------- writes ---------- */
|
|
119
122
|
export async function createCloudBoard(trust, input) {
|
|
123
|
+
await requireCloudMode();
|
|
120
124
|
const columns = Array.isArray(input.columns) ? input.columns.map((c) => (typeof c === "string" ? { title: c } : { slug: c.slug, title: c.label ?? c.slug })) : undefined;
|
|
121
125
|
const r = await remoteCall(trust, { method: "POST", path: "boards", body: { title: input.title, ...(input.slug ? { slug: input.slug } : {}), ...(columns ? { columns } : {}) } });
|
|
122
126
|
return summary(r.board);
|
package/dist/server/cloud.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fs } from "node:fs";
|
|
2
2
|
import { log } from "../core/log.js";
|
|
3
3
|
import os from "node:os";
|
|
4
|
-
import { resolveWorkspace } from "../config.js";
|
|
4
|
+
import { cloudIncluded, resolveWorkspace } from "../config.js";
|
|
5
5
|
import { claimUrlFor, machineCloud, machineGoodbye, machineHeartbeat, machineRegister, machineUnlink, MAX_REPORTED_ROUTINES, retiredCloudDir, unknownMachine, workspaceInvite, writeAccountFile, } from "../core/cloud.js";
|
|
6
6
|
import { identityString, readIdentity } from "../core/identity.js";
|
|
7
7
|
import { routineReport } from "../core/routines.js";
|
|
@@ -38,7 +38,7 @@ async function entries(withRoots) {
|
|
|
38
38
|
for (const o of m.source()) {
|
|
39
39
|
const ws = await resolveWorkspace(o.root).catch(() => null);
|
|
40
40
|
const c = ws?.config.cloud;
|
|
41
|
-
if (
|
|
41
|
+
if (ws && !cloudIncluded(ws.config))
|
|
42
42
|
continue;
|
|
43
43
|
if (c?.url)
|
|
44
44
|
ymlUrls.push(c.url.replace(/\/+$/, ""));
|
|
@@ -66,7 +66,7 @@ async function routineEntries() {
|
|
|
66
66
|
for (const o of m.source()) {
|
|
67
67
|
const ws = await resolveWorkspace(o.root).catch(() => null);
|
|
68
68
|
const id = ws?.config.id;
|
|
69
|
-
if (!id || ws.config
|
|
69
|
+
if (!id || !cloudIncluded(ws.config) || !o.ws)
|
|
70
70
|
continue;
|
|
71
71
|
// A workspace closing meanwhile throws "workspace closed": it simply reports nothing.
|
|
72
72
|
const run = o.ws.run.bind(o.ws);
|
|
@@ -313,7 +313,7 @@ export function machineLink() {
|
|
|
313
313
|
export async function servedWorkspace(id) {
|
|
314
314
|
for (const o of m.source()) {
|
|
315
315
|
const ws = await resolveWorkspace(o.root).catch(() => null);
|
|
316
|
-
if (ws?.config.id === id && ws.config
|
|
316
|
+
if (ws?.config.id === id && cloudIncluded(ws.config))
|
|
317
317
|
return { slug: o.slug, name: o.name, root: o.root };
|
|
318
318
|
}
|
|
319
319
|
return null;
|
|
@@ -328,7 +328,7 @@ export async function createWorkspaceInvite(which, role) {
|
|
|
328
328
|
if (!o)
|
|
329
329
|
throw new Error(`the daemon does not serve ${which.slug ? `"${which.slug}"` : which.root} — open it first (\`kraftwerk ui\` in its folder)`);
|
|
330
330
|
const ws = await resolveWorkspace(o.root);
|
|
331
|
-
if (ws.config
|
|
331
|
+
if (!cloudIncluded(ws.config))
|
|
332
332
|
throw new Error(`${o.slug} is left out of the cloud (cloud.enabled: false in kraftwerk.yml)`);
|
|
333
333
|
const id = ws.config.id;
|
|
334
334
|
if (!id)
|
|
@@ -16,6 +16,10 @@ import type { Trust } from "./trust.js";
|
|
|
16
16
|
* the cloud never takes a human actor from a machine. The cloud allows a
|
|
17
17
|
* machine to act only for its account and the people who signed in to it.
|
|
18
18
|
*
|
|
19
|
+
* New cloud boards are made in cloud mode only (kraftwerk.yml `users:
|
|
20
|
+
* cloud`); a workspace in local mode with an id keeps the ones it has, and
|
|
21
|
+
* one without an id has none (409 with `local: true`).
|
|
22
|
+
*
|
|
19
23
|
* Offline is offline: no cache. With the machine not connected (cloud off,
|
|
20
24
|
* not claimed, the workspace without a ws_ id) or the cloud not answering,
|
|
21
25
|
* calls fail 503 with `offline: true` and the UI marks remote boards offline.
|
|
@@ -28,6 +32,11 @@ export interface RemoteCall {
|
|
|
28
32
|
/** An agent or process naming itself (lisa/claude, process:sync); a human actor is ignored. */
|
|
29
33
|
actor?: string;
|
|
30
34
|
}
|
|
35
|
+
export declare const LOCAL_MODE = "this workspace runs locally \u2014 switch it to cloud mode (settings \u2192 local or cloud, or `kraftwerk cloud connect`) for new cloud boards";
|
|
36
|
+
/** Whether this workspace is in local mode (kraftwerk.yml `users:`). */
|
|
37
|
+
export declare function inLocalMode(): Promise<boolean>;
|
|
38
|
+
/** New cloud boards only in cloud mode: 409 `local: true` otherwise. */
|
|
39
|
+
export declare function requireCloudMode(): Promise<void>;
|
|
31
40
|
/** The ws_ id of the workspace this request is in; 409 without one (`kraftwerk doctor --fix` writes it). */
|
|
32
41
|
export declare function remoteWorkspaceId(): Promise<string>;
|
|
33
42
|
export declare function remoteCall<T>(trust: Trust, call: RemoteCall): Promise<T>;
|