Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
show on this site's /mcp
CLI
abso show 224 --json
JSON
/christopher/abso-core/versions/224?format=json

join: on a project with nothing in it yet, say what comes next. The join wrote no files and stopped there; now it adds: The project is empty. Put its files in this folder, then abso push -m "why" publishes them. Not for a reader, or when the folder already had files. Tests: client/test/join-empty.test.ts (2).

of shared·onboard··Not checked

Version 223 · Files at version 224

2 files, 28 lines added, 0 removed.

--- a/client/src/join-commands.ts
+++ b/client/src/join-commands.ts
@@ -50,6 +50,15 @@
5050 return { server: serverFrom(args, env), project, agent: agentFrom(args) };
5151}
5252
53+/**
54+ * A new project has nothing in it yet: say what comes next, since the join itself wrote nothing. Not for a reader, which
55+ * can't push, or when files were already in the folder (the join's own line names them).
56+ */
57+export function emptyHint(version: number, written: number, kept: number, reader: boolean): string[] {
58+ if (reader || version !== 0 || written > 0 || kept > 0) return [];
59+ return ['The project is empty. Put its files in this folder, then abso push -m "why" publishes them.'];
60+}
5362export async function runInit(args: Parsed, env: Env): Promise<Output> {
5463 if (args.positionals.length > 1) throw new UsageError("init takes one folder");
5564 const root = resolve(env.cwd, args.positionals[0] ?? ".");
@@ -350,6 +359,7 @@
350359 `These files were already here and differ from shared, so they were left alone: ${synced.kept.join(", ")}. abso record sends them as your changes.`,
351360 ]
352361 : []),
362+ ...emptyHint(synced.version, synced.written.length, synced.kept.length, reader),
353363 ...setupHint(root),
354364 hookHint(env.env),
355365 ...(root === resolve(env.cwd) ? [] : [`cd ${relative(env.cwd, root) || root}`]),
--- /dev/null
+++ b/client/test/join-empty.test.ts
@@ -0,0 +1,18 @@
1+// Joining a project that has nothing in it yet: the join writes no files, so it says what comes next.
2+
3+import assert from "node:assert/strict";
4+import { test } from "node:test";
5+import { emptyHint } from "../src/join-commands.ts";
6+
7+test("an empty project: the next step is to put files here and push", () => {
8+ assert.deepEqual(emptyHint(0, 0, 0, false), [
9+ 'The project is empty. Put its files in this folder, then abso push -m "why" publishes them.',
10+ ]);
11+});
13+test("no hint when there is anything to say instead", () => {
14+ assert.deepEqual(emptyHint(3, 0, 0, false), [], "shared has versions, even with no files left");
15+ assert.deepEqual(emptyHint(0, 2, 0, false), [], "files were written");
16+ assert.deepEqual(emptyHint(0, 0, 1, false), [], "files already in the folder, named by the join's own line");
17+ assert.deepEqual(emptyHint(0, 0, 0, true), [], "a reader can't push");
18+});