@psnext/slingcli 2.5.20260617-1 → 2.5.20260621-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.
Files changed (170) hide show
  1. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.browser.js +276 -1
  2. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +276 -1
  3. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.native.js +276 -1
  4. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js +276 -1
  5. package/node_modules/@aws-sdk/core/package.json +1 -1
  6. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  7. package/node_modules/@aws-sdk/credential-provider-http/node_modules/@smithy/node-http-handler/package.json +2 -2
  8. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  9. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  10. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  11. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  12. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  13. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
  14. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  15. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  16. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  17. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  18. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  19. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  20. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  21. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  22. package/node_modules/@aws-sdk/nested-clients/node_modules/@smithy/node-http-handler/package.json +2 -2
  23. package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
  24. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  25. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +21 -57
  26. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +30 -0
  27. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +252 -261
  28. package/node_modules/@earendil-works/pi-ai/dist/models.js +4 -1
  29. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +52 -34
  30. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +11 -9
  31. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +7 -4
  32. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js +4 -3
  33. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +15 -5
  34. package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +2 -1
  35. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +18 -17
  36. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +21 -8
  37. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +2 -1
  38. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +8 -7
  39. package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +1 -0
  40. package/node_modules/@earendil-works/pi-ai/dist/stream.js +1 -1
  41. package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +17 -22
  42. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js +2 -1
  43. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +3 -2
  44. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js +44 -0
  45. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  46. package/node_modules/@earendil-works/pi-coding-agent/dist/bun/restore-sandbox-env.js +4 -0
  47. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +1 -1
  48. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +10 -7
  49. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +8 -1
  50. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/branch-summarization.js +2 -2
  51. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +10 -10
  52. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/vendor/marked.min.js +75 -3
  53. package/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js +17 -1
  54. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +8 -4
  55. package/node_modules/@earendil-works/pi-coding-agent/dist/core/project-trust.js +1 -1
  56. package/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-attribution.js +10 -0
  57. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.js +19 -19
  58. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +2 -0
  59. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +6 -6
  60. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +4 -0
  61. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +17 -5
  62. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +4 -0
  63. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +0 -1
  64. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/session-selector.js +0 -5
  65. package/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +6 -6
  66. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/child-process.js +23 -5
  67. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +17 -17
  68. package/node_modules/@earendil-works/pi-coding-agent/package.json +4 -4
  69. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +5 -1
  70. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  71. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +10 -2
  72. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +10 -2
  73. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpProtocol.d.ts +6 -0
  74. package/node_modules/@smithy/core/package.json +1 -1
  75. package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
  76. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  77. package/node_modules/@smithy/signature-v4/package.json +2 -2
  78. package/node_modules/@types/node/README.md +1 -1
  79. package/node_modules/@types/node/assert/strict.d.ts +10 -1
  80. package/node_modules/@types/node/assert.d.ts +144 -17
  81. package/node_modules/@types/node/async_hooks.d.ts +9 -9
  82. package/node_modules/@types/node/buffer.d.ts +0 -5
  83. package/node_modules/@types/node/child_process.d.ts +17 -21
  84. package/node_modules/@types/node/cluster.d.ts +13 -13
  85. package/node_modules/@types/node/console.d.ts +1 -1
  86. package/node_modules/@types/node/crypto.d.ts +454 -571
  87. package/node_modules/@types/node/diagnostics_channel.d.ts +20 -9
  88. package/node_modules/@types/node/dns.d.ts +14 -14
  89. package/node_modules/@types/node/events.d.ts +3 -3
  90. package/node_modules/@types/node/fs/promises.d.ts +4 -4
  91. package/node_modules/@types/node/fs.d.ts +3 -12
  92. package/node_modules/@types/node/globals.d.ts +4 -4
  93. package/node_modules/@types/node/http.d.ts +5 -5
  94. package/node_modules/@types/node/http2.d.ts +1 -1
  95. package/node_modules/@types/node/index.d.ts +0 -3
  96. package/node_modules/@types/node/inspector.d.ts +1 -1
  97. package/node_modules/@types/node/module.d.ts +16 -45
  98. package/node_modules/@types/node/net.d.ts +1 -1
  99. package/node_modules/@types/node/os.d.ts +2 -2
  100. package/node_modules/@types/node/package.json +4 -4
  101. package/node_modules/@types/node/perf_hooks.d.ts +1 -9
  102. package/node_modules/@types/node/process.d.ts +11 -11
  103. package/node_modules/@types/node/readline.d.ts +12 -11
  104. package/node_modules/@types/node/repl.d.ts +10 -10
  105. package/node_modules/@types/node/sqlite.d.ts +1 -1
  106. package/node_modules/@types/node/stream/promises.d.ts +2 -2
  107. package/node_modules/@types/node/stream/web.d.ts +1 -1
  108. package/node_modules/@types/node/stream.d.ts +5 -5
  109. package/node_modules/@types/node/test/reporters.d.ts +1 -1
  110. package/node_modules/@types/node/test.d.ts +8 -8
  111. package/node_modules/@types/node/tls.d.ts +1 -1
  112. package/node_modules/@types/node/ts5.6/index.d.ts +1 -4
  113. package/node_modules/@types/node/ts5.7/index.d.ts +0 -3
  114. package/node_modules/@types/node/url.d.ts +3 -3
  115. package/node_modules/@types/node/util/types.d.ts +1 -1
  116. package/node_modules/@types/node/util.d.ts +3 -20
  117. package/node_modules/@types/node/v8.d.ts +1 -1
  118. package/node_modules/@types/node/vm.d.ts +9 -9
  119. package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
  120. package/node_modules/@types/node/worker_threads.d.ts +2 -5
  121. package/node_modules/@types/node/zlib.d.ts +3 -3
  122. package/node_modules/anynum/package.json +2 -2
  123. package/node_modules/marked/README.md +13 -4
  124. package/node_modules/marked/bin/main.js +16 -14
  125. package/node_modules/marked/bin/marked.js +2 -1
  126. package/node_modules/marked/lib/marked.d.ts +157 -125
  127. package/node_modules/marked/lib/marked.esm.js +67 -2179
  128. package/node_modules/marked/lib/marked.esm.js.map +3 -3
  129. package/node_modules/marked/lib/marked.umd.js +67 -2201
  130. package/node_modules/marked/lib/marked.umd.js.map +3 -3
  131. package/node_modules/marked/man/marked.1 +4 -2
  132. package/node_modules/marked/man/marked.1.md +2 -1
  133. package/node_modules/marked/package.json +27 -35
  134. package/node_modules/path-expression-matcher/README.md +82 -7
  135. package/node_modules/path-expression-matcher/lib/pem.cjs +1 -1
  136. package/node_modules/path-expression-matcher/lib/pem.d.cts +83 -2
  137. package/node_modules/path-expression-matcher/lib/pem.min.js +1 -1
  138. package/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -1
  139. package/node_modules/path-expression-matcher/package.json +3 -2
  140. package/node_modules/path-expression-matcher/src/ExpressionSet.js +18 -2
  141. package/node_modules/path-expression-matcher/src/Matcher.js +93 -3
  142. package/node_modules/path-expression-matcher/src/index.d.ts +67 -1
  143. package/node_modules/semver/classes/range.js +6 -2
  144. package/node_modules/semver/package.json +1 -1
  145. package/node_modules/strnum/package.json +5 -4
  146. package/node_modules/undici-types/agent.d.ts +0 -2
  147. package/node_modules/undici-types/client.d.ts +25 -19
  148. package/node_modules/undici-types/dispatcher.d.ts +7 -33
  149. package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
  150. package/node_modules/undici-types/fetch.d.ts +24 -4
  151. package/node_modules/undici-types/h2c-client.d.ts +6 -6
  152. package/node_modules/undici-types/handlers.d.ts +1 -2
  153. package/node_modules/undici-types/header.d.ts +5 -0
  154. package/node_modules/undici-types/index.d.ts +3 -1
  155. package/node_modules/undici-types/interceptors.d.ts +1 -1
  156. package/node_modules/undici-types/package.json +1 -1
  157. package/node_modules/undici-types/pool.d.ts +0 -2
  158. package/node_modules/undici-types/proxy-agent.d.ts +2 -2
  159. package/node_modules/undici-types/round-robin-pool.d.ts +0 -2
  160. package/node_modules/undici-types/snapshot-agent.d.ts +4 -0
  161. package/node_modules/undici-types/socks5-proxy-agent.d.ts +2 -2
  162. package/node_modules/undici-types/webidl.d.ts +0 -1
  163. package/package.json +6 -6
  164. package/slingshot/index.js +253 -253
  165. package/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  166. package/node_modules/marked/lib/marked.cjs +0 -2211
  167. package/node_modules/marked/lib/marked.cjs.map +0 -7
  168. package/node_modules/marked/lib/marked.d.cts +0 -728
  169. package/node_modules/marked/marked.min.js +0 -69
  170. /package/node_modules/marked/{LICENSE.md → LICENSE} +0 -0
@@ -20,7 +20,7 @@ import { createAgentSessionFromServices, createAgentSessionServices, } from "./c
20
20
  import { formatNoModelsAvailableMessage } from "./core/auth-guidance.js";
21
21
  import { AuthStorage } from "./core/auth-storage.js";
22
22
  import { exportFromFile } from "./core/export-html/index.js";
23
- import { configureHttpDispatcher } from "./core/http-dispatcher.js";
23
+ import { applyHttpProxySettings, configureHttpDispatcher } from "./core/http-dispatcher.js";
24
24
  import { resolveCliModel, resolveModelScope } from "./core/model-resolver.js";
25
25
  import { restoreStdout, takeOverStdout } from "./core/output-guard.js";
26
26
  import { resolveProjectTrusted } from "./core/project-trust.js";
@@ -360,8 +360,21 @@ export async function main(args, options) {
360
360
  if (process.platform === "win32") {
361
361
  cleanupWindowsSelfUpdateQuarantine(getPackageDir());
362
362
  }
363
+ const cwd = process.cwd();
364
+ const agentDir = getAgentDir();
365
+ const bootstrapSettingsManager = SettingsManager.create(cwd, agentDir, { projectTrusted: false });
366
+ applyHttpProxySettings(bootstrapSettingsManager.getGlobalSettings().httpProxy);
367
+ configureHttpDispatcher();
363
368
  if (await handlePackageCommand(args, { extensionFactories: options?.extensionFactories })) {
364
- process.exit(process.exitCode ?? 0);
369
+ const exitCode = process.exitCode ?? 0;
370
+ if (process.platform === "win32" && exitCode === 0 && args[0] === "update") {
371
+ // We normally prefer process.exit(0) for package commands so bad extensions cannot keep
372
+ // one-shot commands alive. On Windows, Node can assert after fetch() if process.exit(0)
373
+ // runs during teardown; let successful `pi update` drain naturally instead.
374
+ // https://github.com/nodejs/node/issues/56645
375
+ return;
376
+ }
377
+ process.exit(exitCode);
365
378
  return;
366
379
  }
367
380
  if (await handleConfigCommand(args, { extensionFactories: options?.extensionFactories })) {
@@ -408,10 +421,8 @@ export async function main(args, options) {
408
421
  validateForkFlags(parsed);
409
422
  validateSessionIdFlags(parsed);
410
423
  // Run migrations (pass cwd for project-local migrations)
411
- const { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(process.cwd());
424
+ const { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(cwd);
412
425
  time("runMigrations");
413
- const cwd = process.cwd();
414
- const agentDir = getAgentDir();
415
426
  const startupSettingsManager = SettingsManager.create(cwd, agentDir);
416
427
  reportDiagnostics(collectSettingsDiagnostics(startupSettingsManager, "startup session lookup"));
417
428
  // Experimental first-time setup: theme choice and analytics opt-in.
@@ -577,6 +588,7 @@ export async function main(args, options) {
577
588
  time("createAgentSessionRuntime");
578
589
  const { services, session, modelFallbackMessage } = runtime;
579
590
  const { settingsManager, modelRegistry, resourceLoader } = services;
591
+ applyHttpProxySettings(settingsManager.getGlobalSettings().httpProxy);
580
592
  configureHttpDispatcher(settingsManager.getHttpIdleTimeoutMs());
581
593
  if (parsed.help) {
582
594
  const extensionFlags = resourceLoader
@@ -1,5 +1,6 @@
1
1
  import { isAbsolute, relative, resolve, sep } from "node:path";
2
2
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
3
+ import { areExperimentalFeaturesEnabled } from "../../../core/experimental.js";
3
4
  import { theme } from "../theme/theme.js";
4
5
  /**
5
6
  * Sanitize text for display in a single-line status.
@@ -144,6 +145,9 @@ export class FooterComponent {
144
145
  contextPercentStr = contextPercentDisplay;
145
146
  }
146
147
  statsParts.push(contextPercentStr);
148
+ if (areExperimentalFeaturesEnabled()) {
149
+ statsParts.push(`${theme.fg("dim", "•")} ${theme.bold(theme.fg("warning", "xp"))}`);
150
+ }
147
151
  let statsLeft = statsParts.join(" ");
148
152
  // Add model name on the right side, plus thinking level if model supports it
149
153
  const modelName = state.model?.id || "no-model";
@@ -101,7 +101,6 @@ export class LoginDialogComponent extends Container {
101
101
  this.contentContainer.addChild(new Text(theme.fg("dim", hyperlink), 1, 0));
102
102
  this.contentContainer.addChild(new Spacer(1));
103
103
  this.contentContainer.addChild(new Text(theme.fg("warning", `Enter code: ${info.userCode}`), 1, 0));
104
- openBrowser(info.verificationUri);
105
104
  this.tui.requestRender();
106
105
  }
107
106
  /**
@@ -587,7 +587,6 @@ export class SessionSelectorComponent extends Container {
587
587
  allSessions = null;
588
588
  currentSessionsLoader;
589
589
  allSessionsLoader;
590
- onCancel;
591
590
  requestRender;
592
591
  renameSession;
593
592
  currentLoading = false;
@@ -627,7 +626,6 @@ export class SessionSelectorComponent extends Container {
627
626
  this.keybindings = options?.keybindings ?? KeybindingsManager.create();
628
627
  this.currentSessionsLoader = currentSessionsLoader;
629
628
  this.allSessionsLoader = allSessionsLoader;
630
- this.onCancel = onCancel;
631
629
  this.requestRender = requestRender;
632
630
  this.header = new SessionSelectorHeader(this.scope, this.sortMode, this.nameFilter, this.requestRender);
633
631
  const renameSession = options?.renameSession;
@@ -793,9 +791,6 @@ export class SessionSelectorComponent extends Container {
793
791
  this.header.setLoading(false);
794
792
  this.sessionList.setSessions(sessions, showCwd);
795
793
  this.requestRender();
796
- if (scope === "all" && sessions.length === 0 && (this.currentSessions?.length ?? 0) === 0) {
797
- this.onCancel();
798
- }
799
794
  }
800
795
  catch (err) {
801
796
  if (scope === "current") {
@@ -78,7 +78,7 @@ Remove a package and its source from settings.
78
78
  Alias: ${APP_NAME} uninstall <source> [-l]
79
79
 
80
80
  Options:
81
- -l, --local Remove from project settings (.sling/settings.json)
81
+ -l, --local Remove from project settings (.pi/settings.json)
82
82
  -a, --approve Trust project-local files for this command
83
83
  -na, --no-approve Ignore project-local files for this command
84
84
 
@@ -91,20 +91,20 @@ Examples:
91
91
  console.log(`${chalk.bold("Usage:")}
92
92
  ${getPackageCommandUsage("update")}
93
93
 
94
- Update sling and installed packages.
94
+ Update pi and installed packages.
95
95
 
96
96
  Options:
97
- --self Update sling only
97
+ --self Update pi only
98
98
  --extensions Update installed packages only
99
99
  --extension <source> Update one package only
100
100
  -a, --approve Trust project-local files for this command
101
101
  -na, --no-approve Ignore project-local files for this command
102
- --force Reinstall sling even if the current version is latest
102
+ --force Reinstall pi even if the current version is latest
103
103
 
104
104
  Short forms:
105
- ${APP_NAME} update Update sling and all extensions
105
+ ${APP_NAME} update Update pi and all extensions
106
106
  ${APP_NAME} update <source> Update one package
107
- ${APP_NAME} update sling Update sling only (self works as alias to sling)
107
+ ${APP_NAME} update pi Update pi only (self works as alias to pi)
108
108
  `);
109
109
  return;
110
110
  case "list":
@@ -12,10 +12,13 @@ export function spawnProcessSync(command, args, options) {
12
12
  /**
13
13
  * Wait for a child process to terminate without hanging on inherited stdio handles.
14
14
  *
15
- * On Windows, daemonized descendants can inherit the child's stdout/stderr pipe
16
- * handles. In that case the child emits `exit`, but `close` can hang forever even
17
- * though the original process is already gone. We wait briefly for stdio to end,
18
- * then forcibly stop tracking the inherited handles.
15
+ * A short-lived child can `exit` while a detached descendant keeps its stdout/stderr
16
+ * pipe open. We must not resolve and destroy the streams on a fixed deadline measured
17
+ * from `exit`, or output still being written past that deadline is silently lost
18
+ * (earendil-works/pi#5303). Instead, after `exit` we wait for the pipes to fall idle:
19
+ * the grace timer is re-armed on every chunk, so an actively writing descendant keeps
20
+ * us reading, while a quiet inherited handle (e.g. a Windows daemonized descendant
21
+ * that never lets `close` fire) still releases us after the grace elapses.
19
22
  */
20
23
  export function waitForChildProcess(child) {
21
24
  return new Promise((resolve, reject) => {
@@ -35,6 +38,8 @@ export function waitForChildProcess(child) {
35
38
  child.removeListener("close", onClose);
36
39
  child.stdout?.removeListener("end", onStdoutEnd);
37
40
  child.stderr?.removeListener("end", onStderrEnd);
41
+ child.stdout?.removeListener("data", onData);
42
+ child.stderr?.removeListener("data", onData);
38
43
  };
39
44
  const finalize = (code) => {
40
45
  if (settled)
@@ -52,6 +57,17 @@ export function waitForChildProcess(child) {
52
57
  finalize(exitCode);
53
58
  }
54
59
  };
60
+ const armIdleTimer = () => {
61
+ if (postExitTimer)
62
+ clearTimeout(postExitTimer);
63
+ postExitTimer = setTimeout(() => finalize(exitCode), EXIT_STDIO_GRACE_MS);
64
+ };
65
+ const onData = () => {
66
+ // Output is still arriving after exit; defer finalizing so we don't
67
+ // destroy the stream mid-write and truncate the tail.
68
+ if (exited && !settled)
69
+ armIdleTimer();
70
+ };
55
71
  const onStdoutEnd = () => {
56
72
  stdoutEnded = true;
57
73
  maybeFinalizeAfterExit();
@@ -72,7 +88,7 @@ export function waitForChildProcess(child) {
72
88
  exitCode = code;
73
89
  maybeFinalizeAfterExit();
74
90
  if (!settled) {
75
- postExitTimer = setTimeout(() => finalize(code), EXIT_STDIO_GRACE_MS);
91
+ armIdleTimer();
76
92
  }
77
93
  };
78
94
  const onClose = (code) => {
@@ -80,6 +96,8 @@ export function waitForChildProcess(child) {
80
96
  };
81
97
  child.stdout?.once("end", onStdoutEnd);
82
98
  child.stderr?.once("end", onStderrEnd);
99
+ child.stdout?.on("data", onData);
100
+ child.stderr?.on("data", onData);
83
101
  child.once("error", onError);
84
102
  child.once("exit", onExit);
85
103
  child.once("close", onClose);
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-coding-agent",
3
- "version": "0.79.3",
3
+ "version": "0.79.6",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@earendil-works/pi-coding-agent",
9
- "version": "0.79.3",
9
+ "version": "0.79.6",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@earendil-works/pi-agent-core": "^0.79.3",
13
- "@earendil-works/pi-ai": "^0.79.3",
14
- "@earendil-works/pi-tui": "^0.79.3",
12
+ "@earendil-works/pi-agent-core": "^0.79.6",
13
+ "@earendil-works/pi-ai": "^0.79.6",
14
+ "@earendil-works/pi-tui": "^0.79.6",
15
15
  "@silvia-odwyer/photon-node": "0.3.4",
16
16
  "chalk": "5.6.2",
17
17
  "cross-spawn": "7.0.6",
@@ -474,11 +474,11 @@
474
474
  }
475
475
  },
476
476
  "node_modules/@earendil-works/pi-agent-core": {
477
- "version": "0.79.3",
478
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.79.3.tgz",
477
+ "version": "0.79.6",
478
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.79.6.tgz",
479
479
  "license": "MIT",
480
480
  "dependencies": {
481
- "@earendil-works/pi-ai": "^0.79.3",
481
+ "@earendil-works/pi-ai": "^0.79.6",
482
482
  "ignore": "7.0.5",
483
483
  "typebox": "1.1.38",
484
484
  "yaml": "2.9.0"
@@ -488,8 +488,8 @@
488
488
  }
489
489
  },
490
490
  "node_modules/@earendil-works/pi-ai": {
491
- "version": "0.79.3",
492
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.79.3.tgz",
491
+ "version": "0.79.6",
492
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.79.6.tgz",
493
493
  "license": "MIT",
494
494
  "dependencies": {
495
495
  "@anthropic-ai/sdk": "0.91.1",
@@ -511,12 +511,12 @@
511
511
  }
512
512
  },
513
513
  "node_modules/@earendil-works/pi-tui": {
514
- "version": "0.79.3",
515
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.79.3.tgz",
514
+ "version": "0.79.6",
515
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.79.6.tgz",
516
516
  "license": "MIT",
517
517
  "dependencies": {
518
518
  "get-east-asian-width": "1.6.0",
519
- "marked": "15.0.12"
519
+ "marked": "18.0.5"
520
520
  },
521
521
  "engines": {
522
522
  "node": ">=22.19.0"
@@ -1399,15 +1399,15 @@
1399
1399
  }
1400
1400
  },
1401
1401
  "node_modules/marked": {
1402
- "version": "15.0.12",
1403
- "resolved": "https://registry.npmjs.org/marked/-/marked-15.0.12.tgz",
1404
- "integrity": "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==",
1402
+ "version": "18.0.5",
1403
+ "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.5.tgz",
1404
+ "integrity": "sha512-S6GcvALHg6K4ohtu4E7x0a1AqhAjp6cV8KhLSyN9qVapnzJkusVBxZRcIU9AeYsbe6P1hKDusSbEOzGyyuce6w==",
1405
1405
  "license": "MIT",
1406
1406
  "bin": {
1407
1407
  "marked": "bin/marked.js"
1408
1408
  },
1409
1409
  "engines": {
1410
- "node": ">= 18"
1410
+ "node": ">= 20"
1411
1411
  }
1412
1412
  },
1413
1413
  "node_modules/minimatch": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-coding-agent",
3
- "version": "0.79.3",
3
+ "version": "0.79.6",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -37,9 +37,9 @@
37
37
  "prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
38
38
  },
39
39
  "dependencies": {
40
- "@earendil-works/pi-agent-core": "^0.79.3",
41
- "@earendil-works/pi-ai": "^0.79.3",
42
- "@earendil-works/pi-tui": "^0.79.3",
40
+ "@earendil-works/pi-agent-core": "^0.79.6",
41
+ "@earendil-works/pi-ai": "^0.79.6",
42
+ "@earendil-works/pi-tui": "^0.79.6",
43
43
  "@silvia-odwyer/photon-node": "0.3.4",
44
44
  "chalk": "5.6.2",
45
45
  "cross-spawn": "7.0.6",
@@ -296,6 +296,9 @@ export class Editor {
296
296
  this.history.pop();
297
297
  }
298
298
  }
299
+ isEditorEmpty() {
300
+ return this.state.lines.length === 1 && this.state.lines[0] === "";
301
+ }
299
302
  isOnFirstVisualLine() {
300
303
  const visualLines = this.buildVisualLineMap(this.lastWidth);
301
304
  const currentVisualLine = this.findCurrentVisualLine(visualLines);
@@ -656,7 +659,8 @@ export class Editor {
656
659
  }
657
660
  // Arrow key navigation (with history support)
658
661
  if (kb.matches(data, "tui.editor.cursorUp")) {
659
- if (this.isOnFirstVisualLine() && this.history.length > 0) {
662
+ if (this.isOnFirstVisualLine() &&
663
+ (this.isEditorEmpty() || this.historyIndex > -1 || this.state.cursorCol === 0)) {
660
664
  this.navigateHistory(-1);
661
665
  }
662
666
  else if (this.isOnFirstVisualLine()) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-tui",
3
- "version": "0.79.3",
3
+ "version": "0.79.6",
4
4
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "types": "./dist/index.d.ts",
39
39
  "dependencies": {
40
40
  "get-east-asian-width": "1.6.0",
41
- "marked": "15.0.12"
41
+ "marked": "18.0.5"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@xterm/headless": "5.5.0",
@@ -144,15 +144,23 @@ class HttpProtocol extends SerdeContext {
144
144
  });
145
145
  }
146
146
  async loadEventStreamCapability() {
147
- const { EventStreamSerde } = require('@smithy/core/event-streams');
147
+ const { EventStreamSerde, eventStreamSerdeProvider } = require('@smithy/core/event-streams');
148
+ const marshaller = this.resolveEventStreamMarshaller(eventStreamSerdeProvider);
148
149
  return new EventStreamSerde({
149
- marshaller: this.getEventStreamMarshaller(),
150
+ marshaller,
150
151
  serializer: this.serializer,
151
152
  deserializer: this.deserializer,
152
153
  serdeContext: this.serdeContext,
153
154
  defaultContentType: this.getDefaultContentType(),
154
155
  });
155
156
  }
157
+ resolveEventStreamMarshaller(importedProvider) {
158
+ const context = this.serdeContext;
159
+ if (context.eventStreamMarshaller) {
160
+ return context.eventStreamMarshaller;
161
+ }
162
+ return importedProvider(this.serdeContext);
163
+ }
156
164
  getDefaultContentType() {
157
165
  throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
158
166
  }
@@ -112,15 +112,23 @@ export class HttpProtocol extends SerdeContext {
112
112
  });
113
113
  }
114
114
  async loadEventStreamCapability() {
115
- const { EventStreamSerde } = await import("@smithy/core/event-streams");
115
+ const { EventStreamSerde, eventStreamSerdeProvider } = await import("@smithy/core/event-streams");
116
+ const marshaller = this.resolveEventStreamMarshaller(eventStreamSerdeProvider);
116
117
  return new EventStreamSerde({
117
- marshaller: this.getEventStreamMarshaller(),
118
+ marshaller,
118
119
  serializer: this.serializer,
119
120
  deserializer: this.deserializer,
120
121
  serdeContext: this.serdeContext,
121
122
  defaultContentType: this.getDefaultContentType(),
122
123
  });
123
124
  }
125
+ resolveEventStreamMarshaller(importedProvider) {
126
+ const context = this.serdeContext;
127
+ if (context.eventStreamMarshaller) {
128
+ return context.eventStreamMarshaller;
129
+ }
130
+ return importedProvider(this.serdeContext);
131
+ }
124
132
  getDefaultContentType() {
125
133
  throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
126
134
  }
@@ -74,6 +74,12 @@ export declare abstract class HttpProtocol extends SerdeContext implements Clien
74
74
  * Loads eventStream capability async (for chunking).
75
75
  */
76
76
  protected loadEventStreamCapability(): Promise<EventStreamSerde>;
77
+ /**
78
+ * Returns a platform-specific EventStreamMarshaller.
79
+ * Prefers user-injected marshaller from serdeContext (via client config),
80
+ * falls back to the dynamically imported provider.
81
+ */
82
+ private resolveEventStreamMarshaller;
77
83
  /**
78
84
  * @returns content-type default header value for event stream events and other documents.
79
85
  */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.25.0",
3
+ "version": "3.25.1",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "premove dist-es && yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/credential-provider-imds",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -27,7 +27,7 @@
27
27
  "license": "Apache-2.0",
28
28
  "sideEffects": false,
29
29
  "dependencies": {
30
- "@smithy/core": "^3.25.0",
30
+ "@smithy/core": "^3.25.1",
31
31
  "@smithy/types": "^4.15.0",
32
32
  "tslib": "^2.6.2"
33
33
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "5.5.0",
3
+ "version": "5.5.1",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
@@ -27,7 +27,7 @@
27
27
  "module": "./dist-es/index.js",
28
28
  "types": "./dist-types/index.d.ts",
29
29
  "dependencies": {
30
- "@smithy/core": "^3.25.0",
30
+ "@smithy/core": "^3.25.1",
31
31
  "@smithy/types": "^4.15.0",
32
32
  "tslib": "^2.6.2"
33
33
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/signature-v4",
3
- "version": "5.5.0",
3
+ "version": "5.5.1",
4
4
  "description": "A standalone implementation of the AWS Signature V4 request signing algorithm",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -25,7 +25,7 @@
25
25
  "license": "Apache-2.0",
26
26
  "sideEffects": false,
27
27
  "dependencies": {
28
- "@smithy/core": "^3.25.0",
28
+ "@smithy/core": "^3.25.1",
29
29
  "@smithy/types": "^4.15.0",
30
30
  "tslib": "^2.6.2"
31
31
  },
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 10 Jun 2026 22:15:09 GMT
11
+ * Last updated: Fri, 19 Jun 2026 07:14:38 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -3,6 +3,7 @@ declare module "node:assert/strict" {
3
3
  Assert,
4
4
  AssertionError,
5
5
  AssertionErrorOptions,
6
+ AssertMessageFunction,
6
7
  AssertOptions,
7
8
  AssertPredicate,
8
9
  AssertStrict,
@@ -21,7 +22,15 @@ declare module "node:assert/strict" {
21
22
  strictEqual,
22
23
  throws,
23
24
  } from "node:assert";
24
- function strict(value: unknown, message?: string | Error): asserts value;
25
+ function strict(
26
+ value: unknown,
27
+ message?: Error | AssertMessageFunction,
28
+ ): asserts value;
29
+ function strict(
30
+ value: unknown,
31
+ message: string,
32
+ ...args: unknown[]
33
+ ): asserts value;
25
34
  namespace strict {
26
35
  export {
27
36
  Assert,