@sma1lboy/kobe 0.8.113 → 0.8.115

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.
@@ -43,7 +43,7 @@ async function fetchSpec(taskId, mode) {
43
43
  const res = await fetch(`http://localhost:${DAEMON_WEB_PORT}${path}?taskId=${encodeURIComponent(taskId)}`)
44
44
  const json = await res.json()
45
45
  if (!res.ok || json.error) throw new Error(json.error ?? `engine-spec failed (${res.status})`)
46
- return json // { cwd, command: string[] }
46
+ return json // { cwd, command: string[], firstMessage?: string }
47
47
  }
48
48
 
49
49
  const ptySessions = createPtySessionManager({
@@ -160,6 +160,26 @@ export function createPtySessionManager({
160
160
  return entry
161
161
  }
162
162
 
163
+ /** Bracketed-paste `text` into the session and submit, after `pasteDelay`
164
+ * ms — shared by sendText and a fresh spawn's spec-carried first message
165
+ * (paste-delivery vendors, issue #25: the message can't ride the argv). */
166
+ function schedulePaste(entry, text, pasteDelay) {
167
+ setTimeoutFn(() => {
168
+ try {
169
+ entry.pty.write(`\x1b[200~${text}\x1b[201~`)
170
+ } catch {
171
+ return
172
+ }
173
+ setTimeoutFn(() => {
174
+ try {
175
+ entry.pty.write("\r")
176
+ } catch {
177
+ /* best-effort */
178
+ }
179
+ }, submitDelays.enterMs)
180
+ }, pasteDelay)
181
+ }
182
+
163
183
  async function ensureSession(tabId, taskId, mode, cols, rows) {
164
184
  const existing = sessions.get(tabId)
165
185
  if (existing) return existing
@@ -167,7 +187,15 @@ export function createPtySessionManager({
167
187
  if (inflight) return inflight
168
188
  const p = (async () => {
169
189
  const spec = await fetchSpec(taskId, mode)
170
- return sessions.get(tabId) ?? spawnSession(tabId, spec, cols, rows)
190
+ let entry = sessions.get(tabId)
191
+ const spawned = !entry
192
+ if (!entry) entry = spawnSession(tabId, spec, cols, rows)
193
+ // Paste-delivery vendor (kimi — issue #25): the daemon kept the first
194
+ // message OUT of the launch argv, so a FRESH spawn owes it a paste —
195
+ // same fixed-delay rule as sendText's spawn-on-send path. An existing
196
+ // session already received (or never had) it.
197
+ if (spawned && spec.firstMessage) schedulePaste(entry, spec.firstMessage, submitDelays.spawnedPasteMs)
198
+ return entry
171
199
  })()
172
200
  pendingSpawns.set(tabId, p)
173
201
  try {
@@ -240,20 +268,7 @@ export function createPtySessionManager({
240
268
 
241
269
  const target = entry
242
270
  const pasteDelay = spawned ? submitDelays.spawnedPasteMs : submitDelays.existingPasteMs
243
- setTimeoutFn(() => {
244
- try {
245
- target.pty.write(`\x1b[200~${text}\x1b[201~`)
246
- } catch {
247
- return
248
- }
249
- setTimeoutFn(() => {
250
- try {
251
- target.pty.write("\r")
252
- } catch {
253
- /* best-effort */
254
- }
255
- }, submitDelays.enterMs)
256
- }, pasteDelay)
271
+ schedulePaste(target, text, pasteDelay)
257
272
  return { sent: true, spawned }
258
273
  }
259
274
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@sma1lboy/kobe",
4
- "version": "0.8.113",
4
+ "version": "0.8.115",
5
5
  "description": "Rove — the agent multiplexer for your terminal. Run coding agents on parallel tasks with isolated worktrees and persistent sessions.",
6
6
  "type": "module",
7
7
  "packageManager": "bun@1.3.13",