cueloop 0.1.0-alpha.61 → 0.1.0-alpha.63

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.61",
3
+ "version": "0.1.0-alpha.63",
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": {
@@ -30,10 +30,10 @@
30
30
  "build:binary": "bun build --compile --external cpu-features ./src/main.ts --outfile dist/cueloop"
31
31
  },
32
32
  "dependencies": {
33
- "@cueloop/adapters": "0.1.0-alpha.61",
34
- "@cueloop/client": "0.1.0-alpha.61",
35
- "@cueloop/daemon": "0.1.0-alpha.61",
36
- "@cueloop/schema": "0.1.0-alpha.61"
33
+ "@cueloop/adapters": "0.1.0-alpha.63",
34
+ "@cueloop/client": "0.1.0-alpha.63",
35
+ "@cueloop/daemon": "0.1.0-alpha.63",
36
+ "@cueloop/schema": "0.1.0-alpha.63"
37
37
  },
38
38
  "engines": {
39
39
  "bun": ">=1.3.0"
@@ -4,7 +4,7 @@
4
4
  * JSON on stdout; exit code 0 unless the daemon returned an error.
5
5
  */
6
6
 
7
- import { newAnnotationId, type ArtifactType, type VerdictKind } from "@cueloop/schema";
7
+ import { ARTIFACT_TYPES, isArtifactType, newAnnotationId, type VerdictKind } from "@cueloop/schema";
8
8
  import { DaemonClient } from "@cueloop/daemon/client";
9
9
  import { openHerdrPaneForReview } from "@cueloop/daemon/herdr-pane";
10
10
  import { openReview, verdictResponse, type ReviewNote } from "@cueloop/daemon/review";
@@ -24,6 +24,12 @@ type SessionContext = { client: DaemonClient; positional: string[]; flags: Sessi
24
24
  type SessionVerbHandler = (context: SessionContext) => Promise<number>;
25
25
 
26
26
  async function sessionCreate({ client, flags }: SessionContext): Promise<number> {
27
+ const type = stringFlag(flags, "type") ?? "plan";
28
+
29
+ if (!isArtifactType(type)) {
30
+ console.error(`unknown artifact type "${type}" - one of: ${ARTIFACT_TYPES.join(", ")}`);
31
+ return 2;
32
+ }
27
33
  const contentFile = stringFlag(flags, "content-file");
28
34
  const content = contentFile ? await Bun.file(contentFile).text() : await readStdin();
29
35
  // per-file agent notes for diff sessions: a JSON array of { path, body }
@@ -32,7 +38,7 @@ async function sessionCreate({ client, flags }: SessionContext): Promise<number>
32
38
  ? (JSON.parse(await Bun.file(notesFile).text()) as ReviewNote[])
33
39
  : undefined;
34
40
  const review = await openReview(client, {
35
- type: (stringFlag(flags, "type") ?? "plan") as ArtifactType,
41
+ type,
36
42
  content,
37
43
  cwd: stringFlag(flags, "cwd"),
38
44
  agent: stringFlag(flags, "agent"),