cueloop 0.1.0-alpha.34 → 0.1.0-alpha.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cueloop",
3
- "version": "0.1.0-alpha.34",
3
+ "version": "0.1.0-alpha.35",
4
4
  "description": "Terminal review surface for coding agents: annotate plans and diffs, return a verdict, send structured feedback back",
5
5
  "homepage": "https://github.com/mmurakaru/cueloop#readme",
6
6
  "bugs": {
@@ -27,9 +27,10 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@cueloop/client": "0.1.0-alpha.34",
31
- "@cueloop/daemon": "0.1.0-alpha.34",
32
- "@cueloop/schema": "0.1.0-alpha.34"
30
+ "@cueloop/adapters": "0.1.0-alpha.35",
31
+ "@cueloop/client": "0.1.0-alpha.35",
32
+ "@cueloop/daemon": "0.1.0-alpha.35",
33
+ "@cueloop/schema": "0.1.0-alpha.35"
33
34
  },
34
35
  "engines": {
35
36
  "bun": ">=1.3.0"
package/src/main.ts CHANGED
@@ -85,6 +85,10 @@ async function main(): Promise<number> {
85
85
  return sharePullCommand({ ...target, sessionId: positional[1] });
86
86
  return shareCommand({ ...target, sessionId: positional[0] });
87
87
  }
88
+ case "wake": {
89
+ const { wakeCommand } = await import("./wake-command");
90
+ return wakeCommand(argv.slice(1));
91
+ }
88
92
  case "review":
89
93
  return reviewEntry(argv.slice(1));
90
94
  case "review-post": {
@@ -250,6 +254,7 @@ function printHelp(): void {
250
254
  "",
251
255
  "scripting:",
252
256
  " cueloop session <verb> [flags] script the daemon (create|get|list|wait|annotate|resolve|submit-revision)",
257
+ " cueloop wake <id> [--harness codex --thread <id>] resume the agent with the verdict (spawn detached)",
253
258
  " cueloop review-post <id> <pr> post a resolved session's verdict back to the PR",
254
259
  " cueloop daemon run the daemon in the foreground",
255
260
  "",
@@ -0,0 +1,14 @@
1
+ /** cueloop wake argument guards: a missing session id and a codex wake without a thread id both fail with a usage code before any daemon or harness work. */
2
+
3
+ import { describe, expect, test } from "bun:test";
4
+ import { wakeCommand } from "./wake-command";
5
+
6
+ describe("wakeCommand argument guards", () => {
7
+ test("a missing session id is a usage error", async () => {
8
+ expect(await wakeCommand([])).toBe(2);
9
+ });
10
+
11
+ test("a codex wake without a thread id is a usage error", async () => {
12
+ expect(await wakeCommand(["ses_1", "--harness", "codex"])).toBe(2);
13
+ });
14
+ });
@@ -0,0 +1,37 @@
1
+ /**
2
+ * `cueloop wake <session-id>` - the production caller for the non-blocking wake.
3
+ * A detached child of a coding-agent session parks on the review's verdict and
4
+ * injects it back into that same live session when the human decides, so the
5
+ * agent resumes itself without a blocked, pinned tool call. The plan skill (and
6
+ * the Claude Code hook's non-blocking path) spawn this right after a
7
+ * non-blocking review: `cueloop wake <session-id> &`.
8
+ *
9
+ * Claude Code is the default and reads its inbox socket from the environment.
10
+ * Codex needs its running thread id (`--harness codex --thread <thread-id>`).
11
+ * pi wakes in-process from its extension and does not use this command.
12
+ */
13
+
14
+ import { parseArgs, stringFlag } from "./args";
15
+
16
+ export async function wakeCommand(argv: string[]): Promise<number> {
17
+ const { positional, flags } = parseArgs(argv);
18
+ const sessionId = positional[0];
19
+ if (sessionId === undefined) {
20
+ console.error(
21
+ "usage: cueloop wake <session-id> [--harness claude-code|codex] [--thread <codex-thread-id>]",
22
+ );
23
+ return 2;
24
+ }
25
+ const harness = stringFlag(flags, "harness") ?? "claude-code";
26
+ if (harness === "codex") {
27
+ const threadId = stringFlag(flags, "thread");
28
+ if (threadId === undefined) {
29
+ console.error("cueloop wake --harness codex needs --thread <codex-thread-id>");
30
+ return 2;
31
+ }
32
+ const { runCodexWake } = await import("@cueloop/adapters/codex/wake");
33
+ return (await runCodexWake(sessionId, threadId)) ? 0 : 1;
34
+ }
35
+ const { runInboxWake } = await import("@cueloop/adapters/claude-code/wake");
36
+ return (await runInboxWake(sessionId)) ? 0 : 1;
37
+ }