pi-usereq 0.88.0 → 0.89.0

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # PI-useReq/pi-usereq (0.88.0)
1
+ # PI-useReq/pi-usereq (0.89.0)
2
2
 
3
3
  <p align="center">
4
4
  <img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-usereq",
3
- "version": "0.88.0",
3
+ "version": "0.89.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Ogekuri/PI-useReq.git"
@@ -126,6 +126,20 @@ export function buildCommandReportErrorEntryData(
126
126
  };
127
127
  }
128
128
 
129
+ /**
130
+ * @brief Serializes one durable command report entry into its complete plain-text form.
131
+ * @details Joins the `pi-usereq <command>: execution report` header with every per-operation outcome line using newline separators so notification `%%OUTPUT%%` substitution carries exactly the report content rendered in the transcript. Runtime is O(n) in aggregate report-line length. No external state is mutated.
132
+ * @param[in] data {CommandReportEntryData} Report entry payload to serialize.
133
+ * @return {string} Complete execution-report text starting with the report header.
134
+ * @satisfies REQ-436, REQ-448
135
+ */
136
+ export function buildCommandReportEntryText(data: CommandReportEntryData): string {
137
+ return [
138
+ `pi-usereq ${data.command}: execution report`,
139
+ ...data.lines,
140
+ ].join("\n");
141
+ }
142
+
129
143
  /**
130
144
  * @brief Appends one durable command report entry to the active session when the host supports custom entries.
131
145
  * @details Probes the optional `pi.appendEntry(...)` surface before use so legacy hosts and offline harnesses without custom-entry support skip persistence silently; supported hosts persist the payload as a `custom` session entry that survives session restore while remaining excluded from LLM context. Runtime is O(1) plus delegated session-entry persistence. Side effects include session-file entry persistence on supported hosts.
package/src/index.ts CHANGED
@@ -179,9 +179,9 @@ import {
179
179
  import { ensureBundledResourcesAccessible, readBundledPromptDescription } from "./core/resources.js";
180
180
  import {
181
181
  appendCommandReportEntry,
182
+ buildCommandReportEntryText,
182
183
  buildCommandReportErrorEntryData,
183
184
  buildReqReferencesCommandReportEntryData,
184
- buildReqReferencesCommandReportLines,
185
185
  registerCommandReportEntryRenderer,
186
186
  } from "./core/command-report-entry.js";
187
187
  import { ReqError } from "./core/errors.js";
@@ -3586,7 +3586,7 @@ function registerReqResetCommand(
3586
3586
 
3587
3587
  /**
3588
3588
  * @brief Registers the specialized `req-references` slash command.
3589
- * @details Registers the non-agentic references-maintenance command that rejects non-`idle` invocations by transitioning workflow state to `error` before direct execution, otherwise reuses slash-command-owned git validation, transitions workflow state through `checking|running|idle`, regenerates `REFERENCES.md` directly from configured source directories, stages only the generated file, creates the fixed-message git commit, verifies repository cleanliness, appends one durable `pi-usereq.command-report` session entry recording the executed operations with their outcomes so the report renders in the transcript and survives session restore, emits execution notifications that conform to the operations actually performed — one stating whether the references file was updated or already matched the generated content and one stating whether the fixed-message commit was created or skipped — regardless of the update and commit outcomes, dispatches prompt-end notification effects carrying the per-operation process output as `%%OUTPUT%%`, all without starting an LLM session or creating a worktree. Runtime is dominated by git subprocess execution plus source-summary generation. Side effects include command registration, status-controller mutation, filesystem writes, git index/history mutation, session-entry persistence, user notifications, and optional prompt-end notify, sound, and Pushover dispatch.
3589
+ * @details Registers the non-agentic references-maintenance command that rejects non-`idle` invocations by transitioning workflow state to `error` before direct execution, otherwise reuses slash-command-owned git validation, transitions workflow state through `checking|running|idle`, regenerates `REFERENCES.md` directly from configured source directories, stages only the generated file, creates the fixed-message git commit, verifies repository cleanliness, appends one durable `pi-usereq.command-report` session entry recording the executed operations with their outcomes so the report renders in the transcript and survives session restore, emits execution notifications that conform to the operations actually performed — one stating whether the references file was updated or already matched the generated content and one stating whether the fixed-message commit was created or skipped — regardless of the update and commit outcomes, dispatches prompt-end notification effects carrying the complete execution-report text (header plus per-operation outcome lines) as `%%OUTPUT%%` for completed and failed runs, all without starting an LLM session or creating a worktree. Runtime is dominated by git subprocess execution plus source-summary generation. Side effects include command registration, status-controller mutation, filesystem writes, git index/history mutation, session-entry persistence, user notifications, and optional prompt-end notify, sound, and Pushover dispatch.
3590
3590
  * @param[in] pi {ExtensionAPI} Active extension API instance.
3591
3591
  * @param[in,out] statusController {PiUsereqStatusController} Mutable status controller.
3592
3592
  * @return {void} No return value.
@@ -3647,7 +3647,7 @@ function registerReqReferencesCommand(
3647
3647
  promptArgs: args,
3648
3648
  basePath: projectBase,
3649
3649
  completionTimeMs: Math.max(0, Date.now() - commandStartMs),
3650
- agentOutput: buildReqReferencesCommandReportLines(executionResult).join("\n"),
3650
+ agentOutput: buildCommandReportEntryText(buildReqReferencesCommandReportEntryData(executionResult)),
3651
3651
  });
3652
3652
  notifyContextRetentionReminder(statusController, ctx);
3653
3653
  } catch (error) {
@@ -3662,7 +3662,7 @@ function registerReqReferencesCommand(
3662
3662
  promptArgs: args,
3663
3663
  basePath: projectBase,
3664
3664
  completionTimeMs: Math.max(0, Date.now() - commandStartMs),
3665
- agentOutput: message,
3665
+ agentOutput: buildCommandReportEntryText(buildCommandReportErrorEntryData("req-references", message)),
3666
3666
  });
3667
3667
  throw error;
3668
3668
  }