clearclaw 0.7.0 → 0.8.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.
@@ -0,0 +1,32 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFileSync, writeFileSync } from "node:fs";
3
+ import { createRequire } from "node:module";
4
+ import { dirname, resolve } from "node:path";
5
+ import { applyPatch } from "diff";
6
+
7
+ // Temporary backport of codex-acp PR #334. Fail closed if the bundled source changes.
8
+ const version = "1.11.0";
9
+ const originalHash = "3527bdaf90a219175c742576963e6d9e943e4ea5fbdbc3e04e7f57f9a9e11343";
10
+ const patchedHash = "cc77d2f7132470d1484be379ba2a565c603acb242877dc14aa87b9e8a27328ca";
11
+ const hash = (source) => createHash("sha256").update(source).digest("hex");
12
+ const require = createRequire(import.meta.url);
13
+ const entry = require.resolve("@agentclientprotocol/codex-acp");
14
+ const pkg = JSON.parse(readFileSync(resolve(dirname(entry), "../package.json"), "utf8"));
15
+ if (pkg.version !== version) {
16
+ throw new Error(`Expected codex-acp ${version}, found ${pkg.version}. Review the usage metadata patch before upgrading.`);
17
+ }
18
+
19
+ const source = readFileSync(entry, "utf8");
20
+ const sourceHash = hash(source);
21
+ if (sourceHash !== patchedHash) {
22
+ if (sourceHash !== originalHash) {
23
+ throw new Error(`Unexpected codex-acp ${version} bundle. Refusing to patch ${entry}.`);
24
+ }
25
+ const patch = readFileSync(new URL("../patches/codex-acp-1.11.0.patch", import.meta.url), "utf8");
26
+ const patched = applyPatch(source, patch);
27
+ if (patched === false || hash(patched) !== patchedHash) {
28
+ throw new Error("codex-acp usage metadata patch failed verification.");
29
+ }
30
+ writeFileSync(entry, patched);
31
+ }
32
+ console.log(`codex-acp ${version}: usage metadata patch verified`);
@@ -1,56 +0,0 @@
1
- # Workspace Onboarding
2
-
3
- When a task session tells you to follow the Workspace Onboarding instructions, you're guiding an authorized user through setting up a new workspace for this chat.
4
-
5
- The task prompt tells you the chat type: DM or group. Use this to adapt the flow.
6
-
7
- ## Steps
8
-
9
- ### Group chats
10
-
11
- 1. **Ask what they want to work on.** A specific project? A git repo? Or a general-purpose assistant chat?
12
-
13
- 2. **Find the project.** If they mention a project or repo:
14
- - Ask for the path, or offer to look in common locations (`~/`, `~/projects/`, `~/src/`, `~/repos/`, `~/workspaces/`, `~/workplace/`)
15
- - Use `ls` or `find` to locate git repos if they're not sure where it is
16
-
17
- 3. **Offer a git worktree** (if it's a git repo). Explain the benefit: an isolated copy on its own branch, so the main working tree isn't disturbed. If they want one, run `git worktree add <target_path> -b <branch_name>` from the repo. Use the worktree path as the workspace cwd.
18
-
19
- 4. **Ask about the engine.** ClearClaw supports multiple AI engines. Ask which engine they want for this workspace (e.g. `claude-code`, `kiro`). Default to `claude-code` if they don't have a preference.
20
-
21
- 5. **Create the workspace.** Once you have a name, path, and engine:
22
- - Call `workspace_create` with a short, descriptive name, the absolute path, and the chosen engine
23
- - For project repos: suggest relay behavior (default)
24
- - For general-purpose chats: suggest assistant behavior
25
- - Then call `task_complete` to finish setup
26
-
27
- ## Guidelines
28
-
29
- - Be conversational. Don't dump all questions at once.
30
- - Keep workspace names short: `clearclaw`, `myapp`, `notes` — not `my-awesome-project-workspace`.
31
- - If the user just wants a quick assistant chat (no specific project), create a workspace pointing at the home workspace path (provided in the task prompt) with assistant behavior.
32
- - If something goes wrong (bad path, name conflict), explain and ask them to try again.
33
-
34
- ### DM chats (home workspace)
35
-
36
- For DMs, this is the user's personal assistant setup. Create the home workspace, then run the "Get to Know You" bootstrap.
37
-
38
- 1. **Create the home workspace.** Call `workspace_create` with name `default`, cwd set to the home workspace path (provided in the task prompt), and behavior `assistant`. Don't ask -- DMs are always the home workspace.
39
-
40
- 2. **Get to know them.** Ask structured questions, one at a time:
41
- - What should I call you?
42
- - What timezone are you in?
43
- - What personality/vibe do you want from me? (warm, professional, playful, direct, etc.)
44
- - Would you like to name me, or should I suggest something?
45
-
46
- 3. **Discover tools.** Scan PATH for common CLI tools the user might want you to use (package managers, dev tools, productivity CLIs). Present what you find: "I see you have brew, git, node installed. Any other tools you use regularly that I should know about?" Note preferred package manager and whether they want you to install tools proactively.
47
-
48
- 4. **Open up.** Ask: "Anything else I should know about you, your work, or how you like to communicate?" Let the user go wherever they want. Don't constrain or redirect. If they share context that belongs in memory rather than instructions, capture it there without interrupting the conversation.
49
-
50
- 5. **Write the files.** Sort everything you learned into the right place:
51
- - Agent personality, voice, vibe -> `instructions/IDENTITY.md`
52
- - User profile, preferences, communication style -> `instructions/USER.md`
53
- - Tools, configurations, CLI preferences -> `instructions/TOOLS.md`
54
- - Facts, context, decisions -> `memory/MEMORY.md`
55
-
56
- 6. **Finish.** Call `task_complete`. The instruction files are now part of the assembled system prompt for all future sessions.