@cydm/pie 4.3.11 → 4.3.12

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.
@@ -39,6 +39,7 @@ import {
39
39
  SearchContextSchema,
40
40
  TodoInputItemSchema,
41
41
  abortExecutionState,
42
+ appendRetireSection,
42
43
  applyNextGatedPatch,
43
44
  assertBoundedGlobPattern,
44
45
  boundEditOutput,
@@ -48,6 +49,7 @@ import {
48
49
  buildPathResolutionDescription,
49
50
  buildReadFileUnderstandingPrompt,
50
51
  buildRetentionOps,
52
+ buildRetireSuggestions,
51
53
  buildRootParameterSchema,
52
54
  buildTodoClosureContinuePrompt,
53
55
  buildTodoSuccessMessage,
@@ -211,7 +213,7 @@ import {
211
213
  understandFileWithModel,
212
214
  validateTodos,
213
215
  writeJournalNarrative
214
- } from "./chunk-LLCEO7ET.js";
216
+ } from "./chunk-N5B5IGJ6.js";
215
217
  import "./chunk-XMOWWL4B.js";
216
218
  import "./chunk-B4N5LJMD.js";
217
219
  import {
@@ -259,6 +261,7 @@ export {
259
261
  SearchContextSchema,
260
262
  TodoInputItemSchema,
261
263
  abortExecutionState,
264
+ appendRetireSection,
262
265
  applyNextGatedPatch,
263
266
  assertBoundedGlobPattern,
264
267
  boundEditOutput,
@@ -268,6 +271,7 @@ export {
268
271
  buildPathResolutionDescription,
269
272
  buildReadFileUnderstandingPrompt,
270
273
  buildRetentionOps,
274
+ buildRetireSuggestions,
271
275
  buildRootParameterSchema,
272
276
  buildTodoClosureContinuePrompt,
273
277
  buildTodoSuccessMessage,
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  runDistillWorkerMain,
15
15
  spawnDistillAutoWorker,
16
16
  spawnDistillWorker
17
- } from "./chunks/chunk-ZAJEKDPV.js";
17
+ } from "./chunks/chunk-GY47MKCJ.js";
18
18
  import {
19
19
  CLI_RETRY_MAX_RETRIES,
20
20
  classifyCliFailure,
@@ -31,7 +31,7 @@ import {
31
31
  logTransportLifecycle,
32
32
  setYoloGrantListener,
33
33
  truncateHeadTail
34
- } from "./chunks/chunk-KCZGLNRM.js";
34
+ } from "./chunks/chunk-I7PBXG5Q.js";
35
35
  import {
36
36
  VERSION,
37
37
  getAgentDir,
@@ -76,7 +76,7 @@ import {
76
76
  shouldPreserveExecutionStateForUserText,
77
77
  supersedeExecutionState,
78
78
  todayKey
79
- } from "./chunks/chunk-LLCEO7ET.js";
79
+ } from "./chunks/chunk-N5B5IGJ6.js";
80
80
  import {
81
81
  AGENTS_CONTEXT_FILE_NAME,
82
82
  AgentSessionController,
@@ -53751,9 +53751,10 @@ async function runScheduleCommand(rest) {
53751
53751
  const cron = timeToCron(time);
53752
53752
  if ("error" in cron) die(cron.error);
53753
53753
  const command = managedMemoryCommand();
53754
+ const replacedBefore = store.findProcess(MEMORY_MANAGER);
53754
53755
  let job;
53755
53756
  try {
53756
- job = store.addProcess(command, MEMORY_MANAGER, process.cwd(), cron);
53757
+ job = store.addProcess(command, MEMORY_MANAGER, process.cwd(), cron, Date.now(), { forceReplace: true });
53757
53758
  } catch (error) {
53758
53759
  die(String(error instanceof Error ? error.message : error));
53759
53760
  }
@@ -53762,6 +53763,9 @@ async function runScheduleCommand(rest) {
53762
53763
  } catch {
53763
53764
  }
53764
53765
  console.log(`memory schedule on: daily at ${time} local (${cron.cron} UTC; fixed-UTC \u2014 DST shifts the local time). Runs: ${command.join(" ")}`);
53766
+ if (replacedBefore && replacedBefore.id !== job.id && (replacedBefore.state === "blocked" || replacedBefore.enabled === false)) {
53767
+ console.log(`note: replaced an existing ${replacedBefore.state === "blocked" ? "BLOCKED" : "paused"} job (was id ${replacedBefore.id.slice(0, 8)}); its pending review record is reset.`);
53768
+ }
53765
53769
  console.log("The cron extension triggers it whenever at least one cron-enabled Pie is open; missed days are caught up by --auto.");
53766
53770
  return;
53767
53771
  }
@@ -55280,6 +55284,9 @@ function createExtensionContext(extension, cwd, uiContext, abortFn, isIdleFn, ca
55280
55284
  getSessionDisplayName() {
55281
55285
  return actions?.getSessionDisplayName?.() ?? actions?.getSessionName?.();
55282
55286
  },
55287
+ getCurrentModel() {
55288
+ return actions?.getCurrentModel?.();
55289
+ },
55283
55290
  registerProvider(name, config) {
55284
55291
  if (!actions?.registerProvider) throw new Error("registerProvider is not available in this host mode");
55285
55292
  return actions.registerProvider(name, config);
@@ -63791,6 +63798,7 @@ var ExtensionRunner = class {
63791
63798
  },
63792
63799
  getSessionName: () => runner.actions.getSessionName?.(),
63793
63800
  getSessionDisplayName: () => runner.actions.getSessionDisplayName?.() ?? runner.actions.getSessionName?.(),
63801
+ getCurrentModel: () => runner.actions.getCurrentModel?.(),
63794
63802
  registerProvider: (name, config) => {
63795
63803
  if (!runner.actions.registerProvider) throw new Error("registerProvider is not available in this host mode");
63796
63804
  return runner.trackUnregisterHandle(runner.actions.registerProvider(name, config));
@@ -63951,7 +63959,7 @@ var ExtensionRunner = class {
63951
63959
  const result = await handler({ ...event, text }, ctx);
63952
63960
  if (!result || typeof result !== "object" || !("action" in result)) continue;
63953
63961
  if (result.action === "consume") return { action: "consume" };
63954
- if (result.action === "reject") return { action: "reject" };
63962
+ if (result.action === "reject") return { action: "reject", ...typeof result.reason === "string" && result.reason ? { reason: result.reason } : {} };
63955
63963
  if (result.action === "transform" && typeof result.text === "string") {
63956
63964
  text = result.text;
63957
63965
  current = { action: "transform", text };
@@ -82477,12 +82485,19 @@ function beginUserInput(host, extensionIsCurrent = () => true) {
82477
82485
  unsubscribe();
82478
82486
  });
82479
82487
  const isCurrent = () => !retired && host.sessionManager.getActiveSession() === session && host.agentSessionController === controller && host.extensionRunner === runner && host.attachmentMentionHandler?.() === handlerAtCapture && extensionIsCurrent();
82488
+ let lastRejectReason;
82480
82489
  return {
82481
82490
  isCurrent,
82482
82491
  dispose,
82492
+ /** Reason string from the last terminal:input rejection, if the
82493
+ * rejecting extension provided one (cleared on each submit). */
82494
+ get lastRejectReason() {
82495
+ return lastRejectReason;
82496
+ },
82483
82497
  async submit(text, files = []) {
82484
82498
  if (used || !isCurrent() || !text.trim() && !files.length) return false;
82485
82499
  used = true;
82500
+ lastRejectReason = void 0;
82486
82501
  try {
82487
82502
  const mentions = [];
82488
82503
  for (const file of files) {
@@ -82494,7 +82509,11 @@ function beginUserInput(host, extensionIsCurrent = () => true) {
82494
82509
  }
82495
82510
  let content = [text.trim(), ...mentions].filter(Boolean).join("\n");
82496
82511
  const decision = await runner.emitTerminalInput({ type: "terminal:input", text: content });
82497
- if (!isCurrent() || decision.action === "consume" || decision.action === "reject") return false;
82512
+ if (!isCurrent() || decision.action === "consume") return false;
82513
+ if (decision.action === "reject") {
82514
+ lastRejectReason = decision.reason;
82515
+ return false;
82516
+ }
82498
82517
  if (decision.action === "transform") content = decision.text.trim();
82499
82518
  if (!content || mentions.some((mention) => !content.includes(mention))) return false;
82500
82519
  host.queueMessage(content, "followUp", { clearEditor: false, deliverWhileStreaming: false });
@@ -82636,6 +82655,13 @@ async function loadInteractiveExtensions(host) {
82636
82655
  // Optional on purpose: hand-rolled test harnesses and older hosts may
82637
82656
  // not implement it; falling back to the routing name keeps display sane.
82638
82657
  getSessionDisplayName: () => host.sessionManager.getSessionDisplayName?.() ?? host.sessionManager.getSessionName?.(),
82658
+ // panel v2 (review P2-1): the LIVE model for the status heartbeat —
82659
+ // read from the host's current options on every call (never captured
82660
+ // at startup: /model and model.set controls change it at runtime).
82661
+ getCurrentModel: () => {
82662
+ const model = host.options.model;
82663
+ return model?.provider && model?.id ? `${model.provider}/${model.id}` : void 0;
82664
+ },
82639
82665
  registerProvider: (name, config) => {
82640
82666
  const unregister = host.options.modelRegistry.registerProvider(name, config);
82641
82667
  host.noteRuntimeModeChanged("extension_register_provider");
@@ -84692,6 +84718,13 @@ async function loadJsonModeExtensions(params) {
84692
84718
  },
84693
84719
  getSessionName: () => params.runtime.sessionManager.getSessionName(),
84694
84720
  getSessionDisplayName: () => params.runtime.sessionManager.getSessionDisplayName(),
84721
+ // panel v2 (4.3.13): the live active model for the status heartbeat —
84722
+ // provider/modelId, updated by model.set and the session's own /model.
84723
+ getCurrentModel: () => {
84724
+ const provider = params.runtime.provider;
84725
+ const modelId = params.runtime.modelId;
84726
+ return provider && modelId ? `${provider}/${modelId}` : void 0;
84727
+ },
84695
84728
  getSessionMetadata: () => ({
84696
84729
  ...params.runtime.sessionManager.getActiveSession()?.metadata ?? {}
84697
84730
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/pie",
3
- "version": "4.3.11",
3
+ "version": "4.3.12",
4
4
  "description": "Pie AI Agent CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,7 +20,7 @@
20
20
  "test:skill-regressions": "node --test --test-force-exit --import tsx test/axi-bridge-lifecycle.test.ts test/bash-lifecycle.test.ts test/bash-powershell-display.test.ts test/skill-creator-runner.test.ts test/tui-use-contract.test.ts test/tui-use-runtime.test.ts test/tui-use-reap.test.ts test/tui-use-kill-escalation.test.ts test/browser-runtime.test.ts test/axi-stop-semantics.test.ts test/axi-page-routing.test.ts test/computer-use-axi.test.ts test/computer-evidence.test.ts test/interactive-lifecycle.test.ts",
21
21
  "test:offline:post": "node --test --test-force-exit --import tsx test/remote-model-catalog.test.ts",
22
22
  "test:offline": "node ../../scripts/run-cli-offline.mjs",
23
- "test:offline:main": "node --test --test-concurrency=2 --test-force-exit --import tsx test/cli-attention.test.ts test/cron.test.ts test/cron-process.test.ts test/cron-poll-gate.test.ts test/memory-distill.test.ts test/memory-injection-freeze.test.ts test/memory-consumption-e2e.test.ts test/memory-frozen-matching.test.ts test/memory-soul-injection.test.ts test/config-dir-fail-closed.test.ts test/cron-concurrency.test.ts test/cron-dogfood.test.ts test/cron.terminal.test.ts test/cron-journey.terminal.test.ts test/builtin-extensions.test.ts test/im-forward.test.ts test/im-forward-cli.test.ts test/im-forward-integration.test.ts test/im-forward-dogfood.terminal.test.ts test/thread-registry.test.ts test/im-forward-event-hub.test.ts test/im-forward-session-anchors.test.ts test/extension-user-input.test.ts test/pie-ipc-pure.test.ts test/pie-ipc-discovery.test.ts test/pie-ipc-transport.test.ts test/pie-ipc-delivery.test.ts test/pie-ipc-extension.test.ts test/pie-ipc-e2e.test.ts test/pie-ipc-security.test.ts test/pie-ipc-dogfood.test.ts test/pie-ipc-resident-dispatch.test.ts test/pie-proc.test.ts test/pie-ipc-host.terminal.test.ts test/core-services.test.ts test/cli.test.ts test/cli-auto-compaction.test.ts test/execution-state-manager.test.ts test/queued-steer-execution-state.test.ts test/todo-steering-ownership.test.ts test/architecture-boundaries.test.ts test/attachment-resolver.test.ts test/kimi-attachment-provider.test.ts test/document-attachment-extension.test.ts test/auto-compact-overflow.test.ts test/auto-compaction-ui.test.ts test/tool-compaction-dogfood.terminal.test.ts test/hierarchical-command-system.test.ts test/mcp-adapter.test.ts test/herdr-agent-state.test.ts test/extensions-enablement.test.ts test/extension-selector-shortcuts.test.ts test/skill-tool-enablement.test.ts test/message-queue-unit.test.ts test/evals-harness.test.ts test/session-trace.test.ts test/json-events-event-sink.test.ts test/json-events-lifecycle-bridge.test.ts test/json-events-self-input.test.ts test/json-events-idle-mode.test.ts test/manager-cli.test.ts test/json-events-sidechat-diagnostics.test.ts test/json-events-prewarm-shutdown.test.ts test/json-envelope-composition.test.ts test/subagent-session-store.test.ts test/supervisor-anchor-inject.test.ts test/runtime-mode-context.test.ts test/tool-policy.test.ts test/retry-policy.test.ts test/yolo-command.test.ts test/footer-lifecycle.test.ts test/footer-waiting-for-user.test.ts test/files-utils.test.ts test/source-size-guard.test.ts test/runtime-logger.test.ts test/release-readiness.test.ts test/package-artifacts.test.ts test/init-extension-contract.test.ts test/skills-runtime.test.ts test/skills-agents-discovery.test.ts test/skills-symlink.test.ts test/model-overrides.test.ts test/auth-storage.test.ts test/extension-register-provider.test.ts test/extension-reload.test.ts test/extension-terminal-input.test.ts test/extension-session-before-events.test.ts test/extension-widgets.test.ts test/extension-render-hint.test.ts test/extension-oauth-restore.test.ts test/cross-host-parity.test.ts test/tool-name-rendering.test.ts test/session-selector.test.ts test/tree-selector-pagination.test.ts test/context-report.test.ts test/context-signals.test.ts test/plan-cache-stability.test.ts test/cache-invalidation-trace.test.ts test/cache-retention.test.ts test/trace-report.test.ts test/boot-report.test.ts test/compaction-diff.test.ts test/entry-body-and-usage.test.ts test/session-control.test.ts test/terminal-title.test.ts test/interactive-controller-title.test.ts test/todo-title.terminal.test.ts test/host-envelope-dogfood.terminal.test.ts test/host-envelope-cross-mode.test.ts test/host-envelope-registry-lifecycle.test.ts test/host-envelope-migration-roundtrip.test.ts test/host-envelope-intake-order.test.ts test/plan-mode-extension.test.ts test/extension-interaction-signals.test.ts test/rendered-page-reader.test.ts test/tools-registry.test.ts test/system-prompt-contract.test.ts test/bash-yolo.test.ts test/terminal-state-hygiene.test.ts test/terminal-mode-filter-families.test.ts test/manager-model-env.test.ts test/bash-mode-sequence-boundary.test.ts test/bash-contract.test.ts test/bash-confirm-pending.test.ts test/interaction-status-lifecycle.test.ts test/bash-process-group.test.ts test/bash-artifact-sink.test.ts test/direct-bash.test.ts test/terminal-bell.test.ts test/ctrl-d-exit.test.ts test/session-display-title.test.ts test/calm-mode.test.ts test/stream-render-throttle.test.ts test/assistant-message-performance.test.ts test/streaming-split-parity.test.ts test/message-display-resync.test.ts test/project-root.test.ts test/guard-advisory-context.test.ts test/clear-command-usage.test.ts test/daily-agent-smoke.terminal.test.ts test/slash-menu-toggles.terminal.test.ts test/cli-args.test.ts test/session-resume-cwd.test.ts test/session-resume-restart.test.ts test/session-resume-picker.test.ts test/extensions-configured-paths.test.ts test/extensions-loader-path.test.ts test/file-picker.test.ts test/interrupt-recovery.test.ts test/mention-insert-regression.test.ts test/image-paste.test.ts test/clipboard-read-image.test.ts test/clipboard-races.test.ts test/clipboard-dogfood.terminal.test.ts test/mention-picker-navigation.test.ts test/pie-unity-rpc-skill.test.ts test/skill-creator-scripts.test.ts test/interactive-compact-command.test.ts test/computer-use-broker.test.ts test/computer-use-review-regressions.test.ts test/computer-use-safety.test.ts ../../scripts/node-test-diagnostics.test.js ../../scripts/offline-test-runner.test.js ../../scripts/unity-consumer.test.mjs ../../scripts/owned-process-cleanup.test.mjs",
23
+ "test:offline:main": "node --test --test-concurrency=2 --test-force-exit --import tsx test/cli-attention.test.ts test/cron.test.ts test/cron-process.test.ts test/cron-poll-gate.test.ts test/memory-distill.test.ts test/memory-injection-budget.test.ts test/memory-injection-freeze.test.ts test/memory-consumption-e2e.test.ts test/memory-frozen-matching.test.ts test/memory-soul-injection.test.ts test/config-dir-fail-closed.test.ts test/cron-concurrency.test.ts test/cron-dogfood.test.ts test/cron.terminal.test.ts test/cron-journey.terminal.test.ts test/builtin-extensions.test.ts test/im-forward.test.ts test/im-forward-cli.test.ts test/im-forward-userassigned.test.ts test/im-forward-bus-health.test.ts test/im-forward-panel-fastpath.test.ts test/im-forward-consumer.test.ts test/im-forward-card-compiler.test.ts test/im-forward-integration.test.ts test/im-forward-dogfood.terminal.test.ts test/thread-registry.test.ts test/im-forward-event-hub.test.ts test/im-forward-session-anchors.test.ts test/extension-user-input.test.ts test/pie-ipc-pure.test.ts test/pie-ipc-resolve.test.ts test/pie-ipc-discovery.test.ts test/pie-ipc-transport.test.ts test/pie-ipc-delivery.test.ts test/pie-ipc-extension.test.ts test/pie-ipc-e2e.test.ts test/pie-ipc-security.test.ts test/pie-ipc-dogfood.test.ts test/pie-ipc-resident-dispatch.test.ts test/pie-proc.test.ts test/pie-ipc-host.terminal.test.ts test/core-services.test.ts test/cli.test.ts test/cli-auto-compaction.test.ts test/execution-state-manager.test.ts test/queued-steer-execution-state.test.ts test/todo-steering-ownership.test.ts test/architecture-boundaries.test.ts test/attachment-resolver.test.ts test/kimi-attachment-provider.test.ts test/document-attachment-extension.test.ts test/auto-compact-overflow.test.ts test/auto-compaction-ui.test.ts test/tool-compaction-dogfood.terminal.test.ts test/hierarchical-command-system.test.ts test/mcp-adapter.test.ts test/herdr-agent-state.test.ts test/extensions-enablement.test.ts test/extension-selector-shortcuts.test.ts test/skill-tool-enablement.test.ts test/message-queue-unit.test.ts test/evals-harness.test.ts test/session-trace.test.ts test/json-events-event-sink.test.ts test/json-events-lifecycle-bridge.test.ts test/json-events-self-input.test.ts test/json-events-idle-mode.test.ts test/manager-cli.test.ts test/json-events-sidechat-diagnostics.test.ts test/json-events-prewarm-shutdown.test.ts test/json-envelope-composition.test.ts test/subagent-session-store.test.ts test/subagent-resolution.test.ts test/supervisor-anchor-inject.test.ts test/runtime-mode-context.test.ts test/tool-policy.test.ts test/retry-policy.test.ts test/yolo-command.test.ts test/footer-lifecycle.test.ts test/footer-waiting-for-user.test.ts test/files-utils.test.ts test/source-size-guard.test.ts test/runtime-logger.test.ts test/release-readiness.test.ts test/package-artifacts.test.ts test/init-extension-contract.test.ts test/skills-runtime.test.ts test/skills-agents-discovery.test.ts test/skills-symlink.test.ts test/model-overrides.test.ts test/auth-storage.test.ts test/extension-register-provider.test.ts test/extension-reload.test.ts test/extension-terminal-input.test.ts test/extension-session-before-events.test.ts test/extension-widgets.test.ts test/extension-render-hint.test.ts test/extension-oauth-restore.test.ts test/cross-host-parity.test.ts test/tool-name-rendering.test.ts test/session-selector.test.ts test/tree-selector-pagination.test.ts test/context-report.test.ts test/context-signals.test.ts test/plan-cache-stability.test.ts test/cache-invalidation-trace.test.ts test/cache-retention.test.ts test/trace-report.test.ts test/boot-report.test.ts test/compaction-diff.test.ts test/entry-body-and-usage.test.ts test/session-control.test.ts test/terminal-title.test.ts test/interactive-controller-title.test.ts test/todo-title.terminal.test.ts test/host-envelope-dogfood.terminal.test.ts test/host-envelope-cross-mode.test.ts test/host-envelope-registry-lifecycle.test.ts test/host-envelope-migration-roundtrip.test.ts test/host-envelope-intake-order.test.ts test/plan-mode-extension.test.ts test/extension-interaction-signals.test.ts test/rendered-page-reader.test.ts test/tools-registry.test.ts test/system-prompt-contract.test.ts test/bash-yolo.test.ts test/terminal-state-hygiene.test.ts test/terminal-mode-filter-families.test.ts test/manager-model-env.test.ts test/bash-mode-sequence-boundary.test.ts test/bash-contract.test.ts test/bash-confirm-pending.test.ts test/interaction-status-lifecycle.test.ts test/bash-process-group.test.ts test/bash-artifact-sink.test.ts test/direct-bash.test.ts test/terminal-bell.test.ts test/ctrl-d-exit.test.ts test/session-display-title.test.ts test/calm-mode.test.ts test/stream-render-throttle.test.ts test/assistant-message-performance.test.ts test/streaming-split-parity.test.ts test/message-display-resync.test.ts test/project-root.test.ts test/guard-advisory-context.test.ts test/clear-command-usage.test.ts test/daily-agent-smoke.terminal.test.ts test/slash-menu-toggles.terminal.test.ts test/cli-args.test.ts test/session-resume-cwd.test.ts test/session-resume-restart.test.ts test/session-resume-picker.test.ts test/extensions-configured-paths.test.ts test/extensions-loader-path.test.ts test/file-picker.test.ts test/interrupt-recovery.test.ts test/mention-insert-regression.test.ts test/image-paste.test.ts test/clipboard-read-image.test.ts test/clipboard-races.test.ts test/clipboard-dogfood.terminal.test.ts test/mention-picker-navigation.test.ts test/pie-unity-rpc-skill.test.ts test/skill-creator-scripts.test.ts test/interactive-compact-command.test.ts test/computer-use-broker.test.ts test/computer-use-review-regressions.test.ts test/computer-use-safety.test.ts ../../scripts/node-test-diagnostics.test.js ../../scripts/offline-test-runner.test.js ../../scripts/unity-consumer.test.mjs ../../scripts/owned-process-cleanup.test.mjs",
24
24
  "test:all": "npm run test:offline && npm run test:terminal:vitest",
25
25
  "test:cron:tui": "node ../../scripts/run-with-env.mjs PIE_REAL_CRON_TUI=1 -- --test --import tsx test/cron.terminal.test.ts test/cron-journey.terminal.test.ts",
26
26
  "test:ipc:tui": "node ../../scripts/run-with-env.mjs PIE_REAL_IPC_TUI=1 -- --test --import tsx test/pie-ipc-host.terminal.test.ts",