pi-usereq 0.11.0 → 0.12.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/CHANGELOG.md +48 -0
- package/README.md +6 -6
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +818 -691
- package/pi-usereq/docs/REQUIREMENTS.md +131 -77
- package/pi-usereq/docs/WORKFLOW.md +185 -51
- package/scripts/lib/extension-debug-harness.ts +2 -2
- package/scripts/tool-args-to-params.ts +2 -2
- package/src/cli.ts +12 -12
- package/src/core/extension-status.ts +69 -12
- package/src/core/pi-notify.ts +5 -5
- package/src/core/pi-usereq-tools.ts +4 -2
- package/src/core/prompt-command-catalog.ts +4 -5
- package/src/core/prompt-command-runtime.ts +183 -44
- package/src/core/prompts.ts +0 -2
- package/src/core/req-references-command.ts +175 -0
- package/src/core/req-reset-command.ts +323 -0
- package/src/core/resources.ts +6 -23
- package/src/core/settings-menu.ts +85 -28
- package/src/core/tool-runner.ts +26 -6
- package/src/index.ts +523 -85
- package/tests/attended-results-scenarios.ts +5 -5
- package/tests/cli-command-option-parity.test.ts +25 -25
- package/tests/debug-extension-harness.test.ts +1 -1
- package/tests/extension-registration.test.ts +1029 -82
- package/tests/oracle-project.test.ts +4 -4
- package/tests/oracle-standalone.test.ts +5 -5
- package/src/core/reference-payload.ts +0 -752
- package/src/resources/prompts/references.md +0 -64
- /package/tests/fixtures_attended_results/project/{references.json → summarize.json} +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_c.c.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_cpp.cpp.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_csharp.cs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_elixir.ex.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_go.go.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_haskell.hs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_java.java.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_javascript.js.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_kotlin.kt.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_lua.lua.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_perl.pl.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_php.php.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_python.py.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_ruby.rb.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_rust.rs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_scala.scala.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_shell.sh.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_swift.swift.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_typescript.ts.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_zig.zig.json +0 -0
package/src/cli.ts
CHANGED
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
runCompress,
|
|
21
21
|
runFilesCompress,
|
|
22
22
|
runFilesSearch,
|
|
23
|
-
|
|
23
|
+
runFilesSummarize,
|
|
24
24
|
runFilesStaticCheck,
|
|
25
25
|
runFilesTokens,
|
|
26
26
|
runSearch,
|
|
27
27
|
runProjectStaticCheck,
|
|
28
|
-
|
|
28
|
+
runSummarize,
|
|
29
29
|
runTokens,
|
|
30
30
|
} from "./core/tool-runner.js";
|
|
31
31
|
import {
|
|
@@ -46,10 +46,10 @@ interface ParsedArgs {
|
|
|
46
46
|
enableLineNumbers?: boolean;
|
|
47
47
|
enableStaticCheck?: string[];
|
|
48
48
|
filesTokens?: string[];
|
|
49
|
-
|
|
49
|
+
filesSummarize?: string[];
|
|
50
50
|
filesCompress?: string[];
|
|
51
51
|
filesSearch?: string[];
|
|
52
|
-
|
|
52
|
+
summarize?: boolean;
|
|
53
53
|
compress?: boolean;
|
|
54
54
|
search?: [string, string];
|
|
55
55
|
tokens?: boolean;
|
|
@@ -106,9 +106,9 @@ function parseArgs(argv: string[]): ParsedArgs {
|
|
|
106
106
|
index = next;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
|
-
case "--files-
|
|
109
|
+
case "--files-summarize": {
|
|
110
110
|
const [values, next] = takeUntilOption(index + 1);
|
|
111
|
-
parsed.
|
|
111
|
+
parsed.filesSummarize = values;
|
|
112
112
|
index = next;
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
@@ -124,8 +124,8 @@ function parseArgs(argv: string[]): ParsedArgs {
|
|
|
124
124
|
index = next;
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
|
-
case "--
|
|
128
|
-
parsed.
|
|
127
|
+
case "--summarize":
|
|
128
|
+
parsed.summarize = true;
|
|
129
129
|
index += 1;
|
|
130
130
|
break;
|
|
131
131
|
case "--compress":
|
|
@@ -256,12 +256,12 @@ export function main(argv = process.argv.slice(2)): number {
|
|
|
256
256
|
}
|
|
257
257
|
const args = parseArgs(argv);
|
|
258
258
|
const hereOnlyProjectCommand = !!(
|
|
259
|
-
args.
|
|
259
|
+
args.summarize || args.compress || args.tokens || args.search || args.staticCheck
|
|
260
260
|
);
|
|
261
261
|
if (hereOnlyProjectCommand) {
|
|
262
262
|
if (args.base) {
|
|
263
263
|
throw new ReqError(
|
|
264
|
-
"Error: --
|
|
264
|
+
"Error: --summarize, --compress, --tokens, --find, and --static-check do not allow --base; use --here.",
|
|
265
265
|
1,
|
|
266
266
|
);
|
|
267
267
|
}
|
|
@@ -281,12 +281,12 @@ export function main(argv = process.argv.slice(2)): number {
|
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
if (args.filesTokens) return writeResult(runFilesTokens(args.filesTokens));
|
|
284
|
-
if (args.
|
|
284
|
+
if (args.filesSummarize) return writeResult(runFilesSummarize(args.filesSummarize, process.cwd(), args.verbose));
|
|
285
285
|
if (args.filesCompress) return writeResult(runFilesCompress(args.filesCompress, process.cwd(), args.enableLineNumbers, args.verbose));
|
|
286
286
|
if (args.filesSearch) return writeResult(runFilesSearch(args.filesSearch, args.enableLineNumbers, args.verbose));
|
|
287
287
|
if (args.testStaticCheck) return runStaticCheck(args.testStaticCheck);
|
|
288
288
|
if (args.filesStaticCheck) return writeResult(runFilesStaticCheck(args.filesStaticCheck, projectBase, config));
|
|
289
|
-
if (args.
|
|
289
|
+
if (args.summarize) return writeResult(runSummarize(projectBase, config, args.verbose));
|
|
290
290
|
if (args.compress) return writeResult(runCompress(projectBase, config, args.enableLineNumbers, args.verbose));
|
|
291
291
|
if (args.search) return writeResult(runSearch(projectBase, args.search[0], args.search[1], config, args.enableLineNumbers, args.verbose));
|
|
292
292
|
if (args.tokens) return writeResult(runTokens(projectBase, config));
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
ThemeColor,
|
|
15
15
|
} from "@mariozechner/pi-coding-agent";
|
|
16
16
|
import type { UseReqConfig } from "./config.js";
|
|
17
|
+
import type { PiNotifySoundLevel } from "./pi-notify.js";
|
|
17
18
|
import type { PromptCommandExecutionPlan } from "./prompt-command-runtime.js";
|
|
18
19
|
import {
|
|
19
20
|
restorePersistedPromptCommandRuntimeStateForSession,
|
|
@@ -111,7 +112,7 @@ export type PiUsereqWorkflowState = "idle" | "checking" | "running" | "merging"
|
|
|
111
112
|
|
|
112
113
|
/**
|
|
113
114
|
* @brief Stores the mutable runtime facts displayed by the status bar.
|
|
114
|
-
* @details Persists the prompt-orchestration workflow state, the latest context-usage snapshot, the active run start timestamp, the most recent normally completed run duration, the accumulated duration of all normally completed runs, and prompt-request metadata carried from command dispatch into the next runtime execution. Runtime state is mutated in-place by controller helpers. Compile-time only and introduces no runtime cost.
|
|
115
|
+
* @details Persists the prompt-orchestration workflow state, the latest context-usage snapshot, the active run start timestamp, the most recent normally completed run duration, the accumulated duration of all normally completed runs, the in-memory runtime sound level, and prompt-request metadata carried from command dispatch into the next runtime execution. Runtime state is mutated in-place by controller helpers. Compile-time only and introduces no runtime cost.
|
|
115
116
|
*/
|
|
116
117
|
export interface PiUsereqStatusState {
|
|
117
118
|
workflowState: PiUsereqWorkflowState;
|
|
@@ -119,6 +120,7 @@ export interface PiUsereqStatusState {
|
|
|
119
120
|
runStartTimeMs: number | undefined;
|
|
120
121
|
lastRunDurationMs: number | undefined;
|
|
121
122
|
totalRunDurationMs: number | undefined;
|
|
123
|
+
runtimeSoundLevel: PiNotifySoundLevel | undefined;
|
|
122
124
|
pendingPromptRequest: PiUsereqPromptRequest | undefined;
|
|
123
125
|
activePromptRequest: PiUsereqPromptRequest | undefined;
|
|
124
126
|
}
|
|
@@ -403,7 +405,7 @@ function resolveContextUsageIconText(
|
|
|
403
405
|
|
|
404
406
|
/**
|
|
405
407
|
* @brief Formats one icon-based context-usage gauge.
|
|
406
|
-
* @details Renders the documented gauge icon with theme `
|
|
408
|
+
* @details Renders the documented gauge icon with the same non-error status-value theme token used by `status` below `90%`, switches to theme `error` for `>=90%`, and enables terminal blink only for `>=100%`. Runtime is O(1). No external state is mutated.
|
|
407
409
|
* @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
408
410
|
* @param[in] contextUsage {ContextUsage | undefined} Normalized context snapshot.
|
|
409
411
|
* @return {string} Rendered fixed-width gauge icon.
|
|
@@ -420,7 +422,7 @@ function formatContextUsageBar(
|
|
|
420
422
|
if (percent >= 90) {
|
|
421
423
|
return theme.colorize("error", "▕█▏");
|
|
422
424
|
}
|
|
423
|
-
return resolveContextUsageIconText(contextUsage);
|
|
425
|
+
return theme.value(resolveContextUsageIconText(contextUsage));
|
|
424
426
|
}
|
|
425
427
|
|
|
426
428
|
/**
|
|
@@ -548,9 +550,24 @@ function didAgentEndAbort(messages: AgentEndEvent["messages"]): boolean {
|
|
|
548
550
|
);
|
|
549
551
|
}
|
|
550
552
|
|
|
553
|
+
/**
|
|
554
|
+
* @brief Resolves the active runtime sound level used by status and notify flows.
|
|
555
|
+
* @details Prefers the mutable runtime sound state, then falls back to the cached persisted boot value, and finally defaults to `none` before `session_start` loads configuration. Runtime is O(1). No external state is mutated.
|
|
556
|
+
* @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
557
|
+
* @param[in] config {UseReqConfig | undefined} Cached project configuration.
|
|
558
|
+
* @return {PiNotifySoundLevel} Active runtime sound level.
|
|
559
|
+
* @satisfies REQ-180, REQ-285
|
|
560
|
+
*/
|
|
561
|
+
function resolvePiUsereqRuntimeSoundLevel(
|
|
562
|
+
state: PiUsereqStatusState,
|
|
563
|
+
config: UseReqConfig | undefined,
|
|
564
|
+
): PiNotifySoundLevel {
|
|
565
|
+
return state.runtimeSoundLevel ?? config?.["notify-sound"] ?? "none";
|
|
566
|
+
}
|
|
567
|
+
|
|
551
568
|
/**
|
|
552
569
|
* @brief Builds the full single-line pi-usereq status-bar payload.
|
|
553
|
-
* @details Renders status, branch, context, elapsed, and sound fields in the canonical order with dim bullet separators, workflow-state highlighting,
|
|
570
|
+
* @details Renders status, branch, context, elapsed, and sound fields in the canonical order with dim bullet separators, workflow-state highlighting, the documented icon-based context gauge, and the active runtime sound level instead of the persisted boot value. Runtime is O(1). No external state is mutated.
|
|
554
571
|
* @param[in] config {UseReqConfig} Effective project configuration.
|
|
555
572
|
* @param[in] theme {StatusThemeAdapter} Normalized status theme.
|
|
556
573
|
* @param[in] state {PiUsereqStatusState} Mutable status state snapshot.
|
|
@@ -567,7 +584,7 @@ function buildPiUsereqStatusText(
|
|
|
567
584
|
nowMs: number,
|
|
568
585
|
): string {
|
|
569
586
|
const elapsedText = formatElapsedStatusValue(state, nowMs);
|
|
570
|
-
const soundText = config
|
|
587
|
+
const soundText = resolvePiUsereqRuntimeSoundLevel(state, config);
|
|
571
588
|
return [
|
|
572
589
|
formatRenderedStatusField(
|
|
573
590
|
theme,
|
|
@@ -630,7 +647,7 @@ function syncPiUsereqStatusTicker(
|
|
|
630
647
|
|
|
631
648
|
/**
|
|
632
649
|
* @brief Creates an empty pi-usereq status controller.
|
|
633
|
-
* @details Initializes the mutable status snapshot, including empty prompt-request tracking
|
|
650
|
+
* @details Initializes the mutable status snapshot, including empty prompt-request tracking and an unset runtime sound level that later loads from persisted config during `session_start`, and starts with no config, no context, and no live ticker. Runtime is O(1). No external state is mutated.
|
|
634
651
|
* @return {PiUsereqStatusController} New status controller.
|
|
635
652
|
* @satisfies DES-010
|
|
636
653
|
*/
|
|
@@ -644,6 +661,7 @@ export function createPiUsereqStatusController(): PiUsereqStatusController {
|
|
|
644
661
|
runStartTimeMs: undefined,
|
|
645
662
|
lastRunDurationMs: undefined,
|
|
646
663
|
totalRunDurationMs: undefined,
|
|
664
|
+
runtimeSoundLevel: undefined,
|
|
647
665
|
pendingPromptRequest: undefined,
|
|
648
666
|
activePromptRequest: undefined,
|
|
649
667
|
},
|
|
@@ -654,8 +672,9 @@ export function createPiUsereqStatusController(): PiUsereqStatusController {
|
|
|
654
672
|
/**
|
|
655
673
|
* @brief Stores the effective project configuration used by status rendering.
|
|
656
674
|
* @details Replaces the controller's cached configuration so later status
|
|
657
|
-
* renders reuse the latest docs, tests, source-path, and pi-notify
|
|
658
|
-
* without reading from disk on every event
|
|
675
|
+
* renders reuse the latest docs, tests, source-path, and persisted pi-notify
|
|
676
|
+
* values without reading from disk on every event, while leaving the active
|
|
677
|
+
* runtime sound level in `controller.state`. Runtime is O(1). Side effect:
|
|
659
678
|
* mutates `controller.config`.
|
|
660
679
|
* @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
661
680
|
* @param[in] config {UseReqConfig} Effective project configuration.
|
|
@@ -668,13 +687,47 @@ export function setPiUsereqStatusConfig(
|
|
|
668
687
|
controller.config = config;
|
|
669
688
|
}
|
|
670
689
|
|
|
690
|
+
/**
|
|
691
|
+
* @brief Returns the active runtime sound level tracked by the status controller.
|
|
692
|
+
* @details Exposes the in-memory runtime sound state so shortcut handlers and prompt-end notification dispatch can stay decoupled from the persisted boot value stored in `.pi-usereq.json`. Runtime is O(1). No external state is mutated.
|
|
693
|
+
* @param[in] controller {PiUsereqStatusController} Mutable status controller.
|
|
694
|
+
* @return {PiNotifySoundLevel} Active runtime sound level.
|
|
695
|
+
* @satisfies REQ-180, REQ-285
|
|
696
|
+
*/
|
|
697
|
+
export function getPiUsereqRuntimeSoundLevel(
|
|
698
|
+
controller: PiUsereqStatusController,
|
|
699
|
+
): PiNotifySoundLevel {
|
|
700
|
+
return resolvePiUsereqRuntimeSoundLevel(controller.state, controller.config);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* @brief Stores one new runtime sound level and refreshes the status bar.
|
|
705
|
+
* @details Mutates only the in-memory runtime sound state so shortcut-driven sound changes do not update `.pi-usereq.json`, then re-renders the footer when an active extension context is available. Runtime is O(1). Side effect: mutates `controller.state.runtimeSoundLevel` and may update `ctx.ui` status.
|
|
706
|
+
* @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
707
|
+
* @param[in] runtimeSoundLevel {PiNotifySoundLevel} Next active runtime sound level.
|
|
708
|
+
* @param[in] ctx {ExtensionContext | undefined} Optional active extension context.
|
|
709
|
+
* @return {void} No return value.
|
|
710
|
+
* @satisfies REQ-180, REQ-286, REQ-287
|
|
711
|
+
*/
|
|
712
|
+
export function setPiUsereqRuntimeSoundLevel(
|
|
713
|
+
controller: PiUsereqStatusController,
|
|
714
|
+
runtimeSoundLevel: PiNotifySoundLevel,
|
|
715
|
+
ctx?: ExtensionContext,
|
|
716
|
+
): void {
|
|
717
|
+
controller.state.runtimeSoundLevel = runtimeSoundLevel;
|
|
718
|
+
const renderContext = ctx ?? controller.latestContext;
|
|
719
|
+
if (renderContext) {
|
|
720
|
+
renderPiUsereqStatus(controller, renderContext);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
671
724
|
/**
|
|
672
725
|
* @brief Renders the current pi-usereq status bar into the active UI context.
|
|
673
|
-
* @details Updates the controller's latest context pointer and writes the single-line status text only when configuration is available, including the active branch field
|
|
726
|
+
* @details Updates the controller's latest context pointer, refreshes the live `getContextUsage()` snapshot for direct render call sites that do not pass through `updateExtensionStatus(...)`, and writes the single-line status text only when configuration is available, including the active branch field, documented icon-based context gauge, and active runtime sound level. When pi has already invalidated the supplied context after session replacement or reload, the helper clears the stale cached context and returns without surfacing the stale-instance exception. Runtime is O(1) plus git execution for branch refresh. Side effect: mutates `controller.state.contextUsage` and `ctx.ui` status when the context is still active.
|
|
674
727
|
* @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
675
728
|
* @param[in] ctx {ExtensionContext} Active extension context.
|
|
676
729
|
* @return {void} No return value.
|
|
677
|
-
* @satisfies REQ-120, REQ-121, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-159, REQ-180, REQ-233, REQ-280, REQ-283, REQ-284
|
|
730
|
+
* @satisfies REQ-118, REQ-119, REQ-120, REQ-121, REQ-123, REQ-124, REQ-125, REQ-126, REQ-127, REQ-128, REQ-159, REQ-180, REQ-233, REQ-280, REQ-283, REQ-284
|
|
678
731
|
*/
|
|
679
732
|
export function renderPiUsereqStatus(
|
|
680
733
|
controller: PiUsereqStatusController,
|
|
@@ -685,6 +738,7 @@ export function renderPiUsereqStatus(
|
|
|
685
738
|
return;
|
|
686
739
|
}
|
|
687
740
|
try {
|
|
741
|
+
refreshContextUsage(controller.state, ctx);
|
|
688
742
|
const theme = createStatusThemeAdapter(ctx.ui.theme as RawStatusTheme);
|
|
689
743
|
const branchName = resolveStatusBranchValue(ctx);
|
|
690
744
|
ctx.ui.setStatus(
|
|
@@ -732,13 +786,13 @@ export function setPiUsereqWorkflowState(
|
|
|
732
786
|
|
|
733
787
|
/**
|
|
734
788
|
* @brief Updates mutable status state for one intercepted lifecycle hook.
|
|
735
|
-
* @details Refreshes stored context usage on every hook, resets or restores persisted elapsed counters during `session_start`, restores persisted prompt-command metadata when the active session matches a forked execution session, resynchronizes that metadata on later lifecycle hooks so post-switch workflow transitions performed by the initiating command handler become visible to the replacement-session runtime, resets workflow state to `idle` for documented session-start reasons, starts run timing on `agent_start`, promotes pending prompt-request metadata into the active run, captures non-aborted run duration on `agent_end`, accumulates successful runtime into `Σ`, preserves in-memory prompt-command state plus process-scoped persistence across switch-triggered `session_shutdown`, tolerates stale post-replacement render contexts, synchronizes the live ticker, and re-renders the status bar when configuration is available. Runtime is O(n) in `agent_end` message count and otherwise O(1). Side effects include in-memory state mutation, interval scheduling, process-scoped persistence mutation, and footer-status updates.
|
|
789
|
+
* @details Refreshes stored context usage on every hook, resets or restores persisted elapsed counters during `session_start`, loads the active runtime sound level from persisted config during `session_start`, restores persisted prompt-command metadata when the active session matches a forked execution session, resynchronizes that metadata on later lifecycle hooks so post-switch workflow transitions performed by the initiating command handler become visible to the replacement-session runtime, resets workflow state to `idle` for documented session-start reasons, starts run timing on `agent_start`, promotes pending prompt-request metadata into the active run, captures non-aborted run duration on `agent_end`, accumulates successful runtime into `Σ`, preserves in-memory prompt-command state plus process-scoped persistence across switch-triggered `session_shutdown`, tolerates stale post-replacement render contexts, synchronizes the live ticker, and re-renders the status bar when configuration is available. Runtime is O(n) in `agent_end` message count and otherwise O(1). Side effects include in-memory state mutation, interval scheduling, process-scoped persistence mutation, and footer-status updates.
|
|
736
790
|
* @param[in,out] controller {PiUsereqStatusController} Mutable status controller.
|
|
737
791
|
* @param[in] hookName {PiUsereqStatusHookName} Intercepted hook name.
|
|
738
792
|
* @param[in] event {unknown} Hook payload forwarded from the wrapper.
|
|
739
793
|
* @param[in] ctx {ExtensionContext} Active extension context.
|
|
740
794
|
* @return {void} No return value.
|
|
741
|
-
* @satisfies REQ-009, REQ-117, REQ-118, REQ-119, REQ-123, REQ-124, REQ-125, REQ-159, REQ-169, REQ-217, REQ-221, REQ-278, REQ-279, REQ-280
|
|
795
|
+
* @satisfies REQ-009, REQ-117, REQ-118, REQ-119, REQ-123, REQ-124, REQ-125, REQ-159, REQ-169, REQ-217, REQ-221, REQ-278, REQ-279, REQ-280, REQ-285
|
|
742
796
|
*/
|
|
743
797
|
export function updateExtensionStatus(
|
|
744
798
|
controller: PiUsereqStatusController,
|
|
@@ -757,6 +811,9 @@ export function updateExtensionStatus(
|
|
|
757
811
|
} else {
|
|
758
812
|
restorePersistedElapsedState(controller.state);
|
|
759
813
|
}
|
|
814
|
+
controller.state.runtimeSoundLevel = controller.config?.["notify-sound"]
|
|
815
|
+
?? controller.state.runtimeSoundLevel
|
|
816
|
+
?? "none";
|
|
760
817
|
const shouldResetWorkflowState = shouldResetWorkflowStateOnSessionStart(event);
|
|
761
818
|
if (shouldResetWorkflowState) {
|
|
762
819
|
controller.state.workflowState = "idle";
|
package/src/core/pi-notify.ts
CHANGED
|
@@ -110,7 +110,7 @@ export interface PiNotifyEventRequest {
|
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* @brief Describes the configuration fields consumed by pi-notify helpers.
|
|
113
|
-
* @details Narrows the full project config to the
|
|
113
|
+
* @details Narrows the full project config to the notify, sound, and Pushover fields used by status rendering and prompt-end routing. Callers may override `notify-sound` with the active runtime sound level before dispatch. Compile-time only and introduces no runtime cost.
|
|
114
114
|
*/
|
|
115
115
|
export type PiNotifyConfigFields = Pick<
|
|
116
116
|
UseReqConfig,
|
|
@@ -363,10 +363,10 @@ export function formatPiNotifyPushoverStatus(config: Pick<UseReqConfig, "notify-
|
|
|
363
363
|
|
|
364
364
|
/**
|
|
365
365
|
* @brief Cycles one sound level through the canonical shortcut order.
|
|
366
|
-
* @details Advances
|
|
367
|
-
* @param[in] currentLevel {PiNotifySoundLevel} Current
|
|
368
|
-
* @return {PiNotifySoundLevel} Next sound level in the cycle.
|
|
369
|
-
* @satisfies REQ-
|
|
366
|
+
* @details Advances the active runtime sound state in the exact order `none -> low -> mid -> high -> none`, enabling deterministic shortcut toggling without mutating persisted boot configuration. Runtime is O(1). No external state is mutated.
|
|
367
|
+
* @param[in] currentLevel {PiNotifySoundLevel} Current active runtime sound level.
|
|
368
|
+
* @return {PiNotifySoundLevel} Next runtime sound level in the cycle.
|
|
369
|
+
* @satisfies REQ-286
|
|
370
370
|
*/
|
|
371
371
|
export function cyclePiNotifySoundLevel(currentLevel: PiNotifySoundLevel): PiNotifySoundLevel {
|
|
372
372
|
const currentIndex = PI_NOTIFY_SOUND_LEVELS.indexOf(currentLevel);
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export const PI_USEREQ_CUSTOM_TOOL_NAMES = [
|
|
12
12
|
"files-tokens",
|
|
13
|
-
"files-
|
|
13
|
+
"files-summarize",
|
|
14
14
|
"files-compress",
|
|
15
15
|
"files-search",
|
|
16
|
+
"summarize",
|
|
16
17
|
"references",
|
|
17
18
|
"compress",
|
|
18
19
|
"search",
|
|
@@ -51,9 +52,10 @@ export const PI_USEREQ_STARTUP_TOOL_NAMES = [
|
|
|
51
52
|
*/
|
|
52
53
|
export const PI_USEREQ_DEFAULT_ENABLED_TOOL_NAMES = [
|
|
53
54
|
"files-tokens",
|
|
54
|
-
"files-
|
|
55
|
+
"files-summarize",
|
|
55
56
|
"files-compress",
|
|
56
57
|
"files-search",
|
|
58
|
+
"summarize",
|
|
57
59
|
"references",
|
|
58
60
|
"compress",
|
|
59
61
|
"search",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file
|
|
3
|
-
* @brief Declares the canonical bundled `req-*`
|
|
4
|
-
* @details Centralizes prompt-command names shared by extension registration, configuration normalization, debug-menu rendering, and prompt-runtime orchestration. The module is side-effect free. Lookup cost is O(1) per exported constant access.
|
|
3
|
+
* @brief Declares the canonical bundled prompt-backed `req-*` command inventory.
|
|
4
|
+
* @details Centralizes only prompt-template-backed command names shared by extension registration, configuration normalization, debug-menu rendering, and prompt-runtime orchestration. Specialized slash commands such as `req-references` and `req-reset` are registered outside this inventory. The module is side-effect free. Lookup cost is O(1) per exported constant access.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @brief Lists bundled prompt-command names handled by the extension.
|
|
9
|
-
* @details Provides the single source of truth for `req-*`
|
|
8
|
+
* @brief Lists bundled prompt-backed command names handled by the extension.
|
|
9
|
+
* @details Provides the single source of truth for prompt-template-backed `req-*` registration, required-document routing, debug-prompt inventory derivation, and prompt-command worktree orchestration. Access complexity is O(1).
|
|
10
10
|
*/
|
|
11
11
|
export const PROMPT_COMMAND_NAMES = [
|
|
12
12
|
"analyze",
|
|
@@ -21,7 +21,6 @@ export const PROMPT_COMMAND_NAMES = [
|
|
|
21
21
|
"readme",
|
|
22
22
|
"recreate",
|
|
23
23
|
"refactor",
|
|
24
|
-
"references",
|
|
25
24
|
"renumber",
|
|
26
25
|
"workflow",
|
|
27
26
|
"write",
|