agentful 0.4.9 → 0.4.10

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.
Files changed (2) hide show
  1. package/dist/index.cjs +37 -2
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -3044,7 +3044,7 @@ var VERSION, brand, useColor, wrap, paint, tuiDesign, sym, ui;
3044
3044
  var init_branding = __esm({
3045
3045
  "src/branding.ts"() {
3046
3046
  "use strict";
3047
- VERSION = "0.4.9" ? "0.4.9" : null.version;
3047
+ VERSION = "0.4.10" ? "0.4.10" : null.version;
3048
3048
  brand = {
3049
3049
  name: "agentful",
3050
3050
  // the command users type
@@ -3491,6 +3491,36 @@ var require_ignore = __commonJS({
3491
3491
  }
3492
3492
  });
3493
3493
 
3494
+ // src/lib/engineFarewell.ts
3495
+ var FAREWELL_FILTER_SOURCE;
3496
+ var init_engineFarewell = __esm({
3497
+ "src/lib/engineFarewell.ts"() {
3498
+ "use strict";
3499
+ FAREWELL_FILTER_SOURCE = String.raw`
3500
+ /** The engine's quit text: its wordmark, "Session <title>", "Continue opencode -s <id>". */
3501
+ function isEngineFarewell(chunk) {
3502
+ if (typeof chunk !== 'string') return false
3503
+ const plain = chunk.replace(/\x1b\[[0-9;]*m/g, '')
3504
+ return /^ *Continue +opencode -s \S+ *$/m.test(plain)
3505
+ }
3506
+
3507
+ /** Drop the farewell once, then step aside. Called from api.lifecycle.onDispose. */
3508
+ function dropEngineFarewell() {
3509
+ const out = process.stdout
3510
+ const write = out.write
3511
+ const filtered = function (chunk, ...rest) {
3512
+ if (!isEngineFarewell(chunk)) return write.call(this, chunk, ...rest)
3513
+ if (out.write === filtered) out.write = write
3514
+ const done = rest.find((arg) => typeof arg === 'function')
3515
+ if (done) queueMicrotask(() => done())
3516
+ return true
3517
+ }
3518
+ out.write = filtered
3519
+ }
3520
+ `;
3521
+ }
3522
+ });
3523
+
3494
3524
  // src/branding/logo.txt
3495
3525
  var logo_default;
3496
3526
  var init_logo = __esm({
@@ -3536,10 +3566,14 @@ function tail(text, max) {
3536
3566
  const s = String(text)
3537
3567
  return s.length <= max ? s : '\u2026' + s.slice(s.length - (max - 1))
3538
3568
  }
3539
-
3569
+ ${FAREWELL_FILTER_SOURCE}
3540
3570
  const plugin = {
3541
3571
  id: 'agentful-branding',
3542
3572
  tui(api) {
3573
+ // Through safe(): a throw here would make the host roll back the whole
3574
+ // plugin, and the design with it \u2014 for the sake of one line on quit.
3575
+ safe(() => api.lifecycle.onDispose(dropEngineFarewell))
3576
+
3543
3577
  const Prompt = api.ui.Prompt
3544
3578
  const HostSlot = api.ui.Slot
3545
3579
  // The slot context carries no colors; the theme lives on the plugin api.
@@ -3820,6 +3854,7 @@ var init_plugin = __esm({
3820
3854
  "src/branding/plugin.ts"() {
3821
3855
  "use strict";
3822
3856
  init_branding();
3857
+ init_engineFarewell();
3823
3858
  init_logo();
3824
3859
  }
3825
3860
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentful",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "Agentful in your terminal — local development with push-to-cloud previews",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://agentful.dev",