@juicesharp/rpiv-advisor 0.9.1 → 0.11.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.
Files changed (2) hide show
  1. package/advisor.ts +4 -4
  2. package/package.json +4 -1
package/advisor.ts CHANGED
@@ -95,7 +95,7 @@ interface AdvisorConfig {
95
95
  effort?: ThinkingLevel;
96
96
  }
97
97
 
98
- function loadAdvisorConfig(): AdvisorConfig {
98
+ export function loadAdvisorConfig(): AdvisorConfig {
99
99
  if (!existsSync(ADVISOR_CONFIG_PATH)) return {};
100
100
  try {
101
101
  return JSON.parse(readFileSync(ADVISOR_CONFIG_PATH, "utf-8")) as AdvisorConfig;
@@ -104,7 +104,7 @@ function loadAdvisorConfig(): AdvisorConfig {
104
104
  }
105
105
  }
106
106
 
107
- function saveAdvisorConfig(key: string | undefined, effort: ThinkingLevel | undefined): void {
107
+ export function saveAdvisorConfig(key: string | undefined, effort: ThinkingLevel | undefined): void {
108
108
  const config: AdvisorConfig = {};
109
109
  if (key) config.modelKey = key;
110
110
  if (effort) config.effort = effort;
@@ -167,7 +167,7 @@ function getAdvisorRuntimeState(): AdvisorState {
167
167
  // guarantees stable key ordering across V8 insertion-order variation. Required
168
168
  // because nested TypeBox schemas may be authored in any order, and prompt
169
169
  // caching is byte-sensitive.
170
- function stableStringify(value: unknown): string {
170
+ export function stableStringify(value: unknown): string {
171
171
  if (value === null || typeof value !== "object") {
172
172
  return JSON.stringify(value);
173
173
  }
@@ -196,7 +196,7 @@ function buildInventoryBlock(tools: ToolInfo[]): string {
196
196
  // message. That call is what invoked *us* — there is no matching toolResult
197
197
  // yet, and providers (Anthropic, GLM/zai, OpenAI) reject payloads with orphan
198
198
  // toolCalls. Name-targeted to leave any other trailing toolCalls visible.
199
- function stripInflightAdvisorCall(messages: Message[]): Message[] {
199
+ export function stripInflightAdvisorCall(messages: Message[]): Message[] {
200
200
  if (messages.length === 0) return messages;
201
201
  const last = messages[messages.length - 1];
202
202
  if (last.role !== "assistant") return messages;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-advisor",
3
- "version": "0.9.1",
3
+ "version": "0.11.0",
4
4
  "description": "Pi extension: advisor-strategy pattern — escalate to a stronger reviewer model",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -23,6 +23,9 @@
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
26
+ "scripts": {
27
+ "test": "vitest run"
28
+ },
26
29
  "files": [
27
30
  "index.ts",
28
31
  "advisor.ts",