@opencode-cockpit/daemon 0.1.0 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode-cockpit/daemon",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "cockpitd: the process host behind opencode-cockpit (PTY shells, clean logs, wait conditions)",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@opencode-cockpit/protocol": "0.0.1",
37
+ "@opencode-cockpit/protocol": "0.1.1",
38
38
  "@xterm/headless": "6.0.0"
39
39
  },
40
40
  "engines": {
@@ -75,6 +75,11 @@ export class Shell {
75
75
  return this.spec.id
76
76
  }
77
77
 
78
+ /** The line currently being written (e.g. a prompt awaiting input); empty when none. */
79
+ get partialLine(): string {
80
+ return this.normalizer.partial
81
+ }
82
+
78
83
  get running(): boolean {
79
84
  return this.status === "running"
80
85
  }
@@ -38,6 +38,11 @@ export function waitFor(
38
38
  const existing = shell.log.read({ after, tail: 0, limit: Number.MAX_SAFE_INTEGER, grep: regex })
39
39
  const first = existing.lines[0]
40
40
  if (first) return finish({ reason: "pattern", match: first })
41
+ // A prompt already on screen has no newline yet, so it is not in the log.
42
+ const partial = shell.partialLine
43
+ if (partial && regex.test(partial)) {
44
+ return finish({ reason: "pattern", match: { n: shell.log.lastLine + 1, text: partial } })
45
+ }
41
46
  }
42
47
  if (!shell.running) return finish({ reason: "exit" })
43
48