pi-smart-compact 7.13.0 → 7.13.2
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 +19 -0
- package/README.md +58 -13
- package/SECURITY.md +28 -0
- package/SUPPORT.md +17 -0
- package/dist/app/explore-wrap.d.ts +8 -0
- package/dist/app/explore-wrap.d.ts.map +1 -0
- package/dist/app/run-context.d.ts +196 -0
- package/dist/app/run-context.d.ts.map +1 -0
- package/dist/app/run-smart-compact.d.ts +69 -0
- package/dist/app/run-smart-compact.d.ts.map +1 -0
- package/dist/app/steps/extract.d.ts +21 -0
- package/dist/app/steps/extract.d.ts.map +1 -0
- package/dist/app/steps/metrics.d.ts +33 -0
- package/dist/app/steps/metrics.d.ts.map +1 -0
- package/dist/app/steps/persist.d.ts +47 -0
- package/dist/app/steps/persist.d.ts.map +1 -0
- package/dist/app/steps/prepare.d.ts +12 -0
- package/dist/app/steps/prepare.d.ts.map +1 -0
- package/dist/app/steps/recover.d.ts +13 -0
- package/dist/app/steps/recover.d.ts.map +1 -0
- package/dist/app/steps/state.d.ts +13 -0
- package/dist/app/steps/state.d.ts.map +1 -0
- package/dist/app/steps/synthesize.d.ts +22 -0
- package/dist/app/steps/synthesize.d.ts.map +1 -0
- package/dist/app/steps/tier.d.ts +12 -0
- package/dist/app/steps/tier.d.ts.map +1 -0
- package/dist/app/steps/verify.d.ts +19 -0
- package/dist/app/steps/verify.d.ts.map +1 -0
- package/dist/app/steps/window.d.ts +18 -0
- package/dist/app/steps/window.d.ts.map +1 -0
- package/dist/constants.d.ts +11 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/domain/summary-parse.d.ts +50 -0
- package/dist/domain/summary-parse.d.ts.map +1 -0
- package/dist/domain/summary-schema.d.ts +49 -0
- package/dist/domain/summary-schema.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4647 -3564
- package/dist/infra/clock.d.ts +13 -0
- package/dist/infra/clock.d.ts.map +1 -0
- package/dist/infra/fs.d.ts +57 -0
- package/dist/infra/fs.d.ts.map +1 -0
- package/dist/infra/git.d.ts +17 -0
- package/dist/infra/git.d.ts.map +1 -0
- package/dist/infra/llm-client.d.ts +42 -0
- package/dist/infra/llm-client.d.ts.map +1 -0
- package/dist/infra/llm-retry.d.ts +46 -0
- package/dist/infra/llm-retry.d.ts.map +1 -0
- package/dist/infra/paths.d.ts +46 -0
- package/dist/infra/paths.d.ts.map +1 -0
- package/dist/infra/services.d.ts +111 -0
- package/dist/infra/services.d.ts.map +1 -0
- package/dist/phases/explore.d.ts +15 -3
- package/dist/phases/explore.d.ts.map +1 -1
- package/dist/phases/synthesize.d.ts +4 -3
- package/dist/phases/synthesize.d.ts.map +1 -1
- package/dist/phases/verify.d.ts +18 -2
- package/dist/phases/verify.d.ts.map +1 -1
- package/dist/types.d.ts +42 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/overlays.d.ts +2 -1
- package/dist/ui/overlays.d.ts.map +1 -1
- package/dist/utils/cache.d.ts +41 -13
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/damage.d.ts.map +1 -1
- package/dist/utils/extraction.d.ts +11 -1
- package/dist/utils/extraction.d.ts.map +1 -1
- package/dist/utils/fingerprint.d.ts +7 -0
- package/dist/utils/fingerprint.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts +2 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/id-fingerprint.d.ts +52 -0
- package/dist/utils/id-fingerprint.d.ts.map +1 -0
- package/dist/utils/pruning.d.ts +17 -1
- package/dist/utils/pruning.d.ts.map +1 -1
- package/dist/utils/session-log.d.ts.map +1 -1
- package/dist/utils/state.d.ts +18 -1
- package/dist/utils/state.d.ts.map +1 -1
- package/dist/utils/tokens.d.ts +30 -2
- package/dist/utils/tokens.d.ts.map +1 -1
- package/dist/utils/type-guards.d.ts +22 -0
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/docs/RELEASE.md +40 -0
- package/docs/assets/pi-smart-compact.png +0 -0
- package/package.json +14 -3
- package/dist/core.d.ts +0 -31
- package/dist/core.d.ts.map +0 -1
package/dist/ui/overlays.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
import type { CompactMetricsEntry, CompressionProfile, ModelOption, ProgressState, SmartCompactDetails, StructuredExtraction } from "../types.ts";
|
|
6
|
+
import type { SmartCompactServices } from "../infra/services.ts";
|
|
6
7
|
export declare function renderContextBar(theme: any, pct: number, tokens: number, barLen?: number): string;
|
|
7
8
|
export declare function renderTokenBar(theme: any, before: number, after: number, label: string, barLen?: number): string;
|
|
8
9
|
export declare function selectModel(ctx: ExtensionCommandContext, opts: {
|
|
@@ -16,7 +17,7 @@ export declare function selectProfile(ctx: ExtensionCommandContext, selectedMode
|
|
|
16
17
|
contextPercent: number;
|
|
17
18
|
}): Promise<CompressionProfile | null>;
|
|
18
19
|
export declare function showProgressOverlay(ctx: ExtensionCommandContext, state: ProgressState): void;
|
|
19
|
-
export declare function showResultScreen(ctx: ExtensionCommandContext, details: SmartCompactDetails, extraction: StructuredExtraction): Promise<void>;
|
|
20
|
+
export declare function showResultScreen(ctx: ExtensionCommandContext, details: SmartCompactDetails, extraction: StructuredExtraction, services?: SmartCompactServices): Promise<void>;
|
|
20
21
|
type DashboardAction = "html" | null;
|
|
21
22
|
export declare function showMetricsDashboardUI(ctx: ExtensionCommandContext, opts: {
|
|
22
23
|
entries: CompactMetricsEntry[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlays.d.ts","sourceRoot":"","sources":["../../src/ui/overlays.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAI/E,OAAO,KAAK,EACV,mBAAmB,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,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AAsB,gBAAgB,CACpC,GAAG,EAAE,uBAAuB,EAC5B,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,EAChC,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA8Jf;AAGD,KAAK,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC;AAErC,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,uBAAuB,EAC5B,IAAI,EAAE;IAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClF,OAAO,CAAC,eAAe,CAAC,CA+F1B;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,uBAAuB,EAC5B,IAAI,EAAE;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACvG,OAAO,CAAC;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,kBAAkB,CAAA;CAAE,GAAG,IAAI,CAAC,CAMrE"}
|
package/dist/utils/cache.d.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Extraction cache, metrics, and cache-aware LLM options.
|
|
3
|
+
*
|
|
4
|
+
* Filesystem writes go through `src/infra/fs.ts` (atomic temp+rename for
|
|
5
|
+
* snapshots, advisory lock for the metrics append log) so that two pi
|
|
6
|
+
* sessions racing to compact the same project cannot corrupt each other's
|
|
7
|
+
* state. All LLM I/O routes through `getLlmClient()` so tests can swap a fake
|
|
8
|
+
* provider in without resolving the real peer dependency.
|
|
3
9
|
*/
|
|
4
10
|
import type { LLMCallMetric, StructuredExtraction, CachedExtraction, CacheAwareOptions, CompactMetricsEntry } from "../types.ts";
|
|
5
|
-
import {
|
|
11
|
+
import type { Model, Api, AssistantMessage, Context } from "@earendil-works/pi-ai";
|
|
12
|
+
import { type SmartCompactServices } from "../infra/services.ts";
|
|
6
13
|
export declare function getCompactSessionId(): string;
|
|
7
14
|
export declare function resetCompactSessionId(): void;
|
|
8
|
-
export declare function cacheOpts(opts: CacheAwareOptions, provider?: string, phase?: LLMCallMetric["phase"]): CacheAwareOptions & {
|
|
15
|
+
export declare function cacheOpts(opts: CacheAwareOptions, provider?: string, phase?: LLMCallMetric["phase"], services?: SmartCompactServices): CacheAwareOptions & {
|
|
9
16
|
sessionId?: string;
|
|
10
17
|
};
|
|
11
|
-
export declare function resetMetrics(): void;
|
|
12
|
-
export declare function recordMetric(m: LLMCallMetric): void;
|
|
13
|
-
export declare function getMetrics(): LLMCallMetric[];
|
|
18
|
+
export declare function resetMetrics(services?: SmartCompactServices): void;
|
|
19
|
+
export declare function recordMetric(m: LLMCallMetric, services?: SmartCompactServices): void;
|
|
20
|
+
export declare function getMetrics(services?: SmartCompactServices): LLMCallMetric[];
|
|
14
21
|
export declare function effectivePromptInputTokens(inputTokens: number, cacheHitTokens: number): number;
|
|
15
|
-
export declare function getMetricsSummary(): {
|
|
22
|
+
export declare function getMetricsSummary(services?: SmartCompactServices): {
|
|
16
23
|
totalCalls: number;
|
|
17
24
|
totalInput: number;
|
|
18
25
|
totalOutput: number;
|
|
@@ -20,17 +27,24 @@ export declare function getMetricsSummary(): {
|
|
|
20
27
|
avgLatency: number;
|
|
21
28
|
cacheHitRate: number;
|
|
22
29
|
};
|
|
23
|
-
export declare function trackedComplete(phase: LLMCallMetric["phase"], model: Model<Api>, reqBody: Context, opts: CacheAwareOptions): Promise<AssistantMessage>;
|
|
24
|
-
export declare function resetExtractionCacheStats(): void;
|
|
25
|
-
export declare function getExtractionCacheStats(): {
|
|
30
|
+
export declare function trackedComplete(phase: LLMCallMetric["phase"], model: Model<Api>, reqBody: Context, opts: CacheAwareOptions, services?: SmartCompactServices): Promise<AssistantMessage>;
|
|
31
|
+
export declare function resetExtractionCacheStats(services?: SmartCompactServices): void;
|
|
32
|
+
export declare function getExtractionCacheStats(services?: SmartCompactServices): {
|
|
26
33
|
hits: number;
|
|
27
34
|
misses: number;
|
|
28
35
|
hitRate: number;
|
|
29
36
|
};
|
|
30
|
-
export declare function recordExtractionCacheHit(): void;
|
|
31
|
-
export declare function recordExtractionCacheMiss(): void;
|
|
37
|
+
export declare function recordExtractionCacheHit(services?: SmartCompactServices): void;
|
|
38
|
+
export declare function recordExtractionCacheMiss(services?: SmartCompactServices): void;
|
|
32
39
|
/**
|
|
33
|
-
* Save extraction cache with entry-id
|
|
40
|
+
* Save extraction cache with entry-id fingerprints for branch-aware
|
|
41
|
+
* invalidation.
|
|
42
|
+
*
|
|
43
|
+
* We store **compact fingerprints** rather than the raw id arrays so the cache
|
|
44
|
+
* file stays a few hundred bytes regardless of session size. The fingerprint
|
|
45
|
+
* carries enough information (count + tail + prefix hash) for the next run to
|
|
46
|
+
* prove that the cached extraction's domain is a strict prefix of the current
|
|
47
|
+
* pruned/unpruned conversation.
|
|
34
48
|
*
|
|
35
49
|
* @param msgCount — Length of the **pruned** llmMessages array. This is the
|
|
36
50
|
* domain for all index-bearing fields inside `extraction` (topics, errors,
|
|
@@ -55,7 +69,21 @@ export declare function loadCachedExtraction(sessionId: string): CachedExtractio
|
|
|
55
69
|
*/
|
|
56
70
|
export declare function mergeExtractions(base: StructuredExtraction, delta: StructuredExtraction, baseMsgCount: number): StructuredExtraction;
|
|
57
71
|
/** Extended metrics entry including pipeline context for regression detection. */
|
|
58
|
-
export declare function appendMetricsLog(sessionId: string, extra?: Partial<Omit<CompactMetricsEntry, "ts" | "sessionId" | "totalCalls" | "totalInput" | "totalOutput" | "totalCacheHit" | "avgLatency" | "cacheHitRate"
|
|
72
|
+
export declare function appendMetricsLog(sessionId: string, extra?: Partial<Omit<CompactMetricsEntry, "ts" | "sessionId" | "totalCalls" | "totalInput" | "totalOutput" | "totalCacheHit" | "avgLatency" | "cacheHitRate">>, services?: SmartCompactServices): void;
|
|
73
|
+
/**
|
|
74
|
+
* Read the last `limit` valid entries from the metrics log without loading
|
|
75
|
+
* the whole file. We start from the tail, walking backwards in 64 KB chunks
|
|
76
|
+
* until we have enough lines (`limit * 4` raw lines is a generous safety
|
|
77
|
+
* factor against corrupt entries that get filtered out). The old
|
|
78
|
+
* implementation read the entire log into memory before slicing, which on
|
|
79
|
+
* a long-lived install with a multi-megabyte log was a noticeable IO + GC
|
|
80
|
+
* hit on every dashboard render.
|
|
81
|
+
*
|
|
82
|
+
* Behavior guarantees:
|
|
83
|
+
* - At most `limit` entries returned (always sliced from the tail).
|
|
84
|
+
* - Corrupt JSON lines are dropped with a warning, NOT counted toward limit.
|
|
85
|
+
* - Returned in chronological order (oldest -> newest within the window).
|
|
86
|
+
*/
|
|
59
87
|
export declare function readMetricsLog(limit?: number): CompactMetricsEntry[];
|
|
60
88
|
export declare function buildMetricsReport(entries?: CompactMetricsEntry[]): string;
|
|
61
89
|
export declare function writeMetricsDashboard(entries?: CompactMetricsEntry[]): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/utils/cache.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/utils/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAuB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGtJ,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQnF,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAKrF,wBAAgB,mBAAmB,IAAI,MAAM,CAK5C;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AASD,wBAAgB,SAAS,CACvB,IAAI,EAAE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wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,mBAAmB,GAC3B,IAAI,CAeN"}
|
|
@@ -28,5 +28,15 @@ export declare function buildTimeline(msgs: LlmMessage[], errors: StructuredExtr
|
|
|
28
28
|
export declare function extractMainGoal(msgs: LlmMessage[]): string | null;
|
|
29
29
|
/** Extract open loops — unresolved tasks from the conversation */
|
|
30
30
|
export declare function extractOpenLoops(msgs: LlmMessage[], extraction: StructuredExtraction): OpenLoop[];
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Run all extractors over a (typically pruned) message list. Accepts an
|
|
33
|
+
* optional pre-built `ToolCallIndex` so callers that have already walked the
|
|
34
|
+
* messages (e.g. the orchestrator caching it on the RunContext) can skip the
|
|
35
|
+
* O(n) rebuild.
|
|
36
|
+
*
|
|
37
|
+
* Important: `tcIdx` must be keyed by the **same** message offsets as `msgs`.
|
|
38
|
+
* Pruning produces an index against the unpruned list; that index is not safe
|
|
39
|
+
* to pass here — build a fresh one over the pruned messages instead.
|
|
40
|
+
*/
|
|
41
|
+
export declare function extractStructured(msgs: LlmMessage[], pc: ProfileConfig, precomputedTcIdx?: ToolCallIndex): StructuredExtraction;
|
|
32
42
|
//# sourceMappingURL=extraction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/utils/extraction.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAK9G,iFAAiF;AACjF,eAAO,MAAM,WAAW,QAAW,CAAC;AAEpC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAErD;
|
|
1
|
+
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/utils/extraction.ts"],"names":[],"mappings":"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AED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,SAAK,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CA6DlJ;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAc1H;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,IAAI,CAOjE;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,oBAAoB,GAAG,QAAQ,EAAE,CAsFjG;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,gBAAgB,CAAC,EAAE,aAAa,GAAG,oBAAoB,CAiB/H"}
|
|
@@ -15,6 +15,9 @@ export interface ProjectFingerprint {
|
|
|
15
15
|
/**
|
|
16
16
|
* Find the git root for the current working directory.
|
|
17
17
|
* Returns null if not in a git repo.
|
|
18
|
+
*
|
|
19
|
+
* Implementation is delegated to `infra/git.ts` which caches per cwd so that
|
|
20
|
+
* the auto-trigger code path does not pay the execSync cost on every run.
|
|
18
21
|
*/
|
|
19
22
|
export declare function findGitRoot(cwd: string): string | null;
|
|
20
23
|
/**
|
|
@@ -35,6 +38,10 @@ export declare function deriveProjectId(cwd: string, extraction: StructuredExtra
|
|
|
35
38
|
export declare function loadProjectFingerprint(projectId: string): ProjectFingerprint | null;
|
|
36
39
|
/**
|
|
37
40
|
* Save/update project fingerprint after compaction.
|
|
41
|
+
*
|
|
42
|
+
* Atomic temp+rename via writeJsonSync prevents a crash from leaving a
|
|
43
|
+
* truncated JSON file behind. The next session would otherwise lose the
|
|
44
|
+
* sessionCount counter or worse, throw on parse.
|
|
38
45
|
*/
|
|
39
46
|
export declare function saveProjectFingerprint(projectId: string, extraction: StructuredExtraction): void;
|
|
40
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../../src/utils/fingerprint.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../../src/utils/fingerprint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAMxD,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAqDD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEtD;AAkED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA+BzG;AAoDD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAKnF;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,oBAAoB,GAC/B,IAAI,CAuBN;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI,GAAG,MAAM,CAQlF"}
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ import type { CompactConfig, ChunkSummary, LlmChunk, StructuredExtraction, Explo
|
|
|
10
10
|
* This prevents silent misconfiguration (e.g. profile: "super").
|
|
11
11
|
*/
|
|
12
12
|
export declare function validateSmartCompactConfig(sc: Record<string, unknown>): void;
|
|
13
|
+
/** Test helper — forces the next loadConfig() to re-read settings.json. */
|
|
14
|
+
export declare function resetConfigCache(): void;
|
|
13
15
|
export declare function loadConfig(): CompactConfig;
|
|
14
16
|
export declare function backupConversation(convText: string, sessionId: string): string | null;
|
|
15
17
|
export declare function getPreviousCompactionContext(branch: unknown[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAsB,YAAY,EAAE,QAAQ,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAsB,YAAY,EAAE,QAAQ,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AASxK;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAmE5E;AASD,2EAA2E;AAC3E,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC;AAED,wBAAgB,UAAU,IAAI,aAAa,CAoB1C;AAwDD,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAerF;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAQtE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,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry-id list fingerprinting for the extraction cache.
|
|
3
|
+
*
|
|
4
|
+
* The extraction cache used to write the full toCompact entry-id array to
|
|
5
|
+
* disk and then re-read it on the next run to verify that the cached
|
|
6
|
+
* extraction's "prefix" was still valid. That scales linearly with session
|
|
7
|
+
* length — a 5k-message session rewrote a 100KB JSON document on every
|
|
8
|
+
* compact, and disk-usage doubled as soon as you turned on auto-trigger.
|
|
9
|
+
*
|
|
10
|
+
* The fingerprint captures only what the cache logic actually inspects:
|
|
11
|
+
*
|
|
12
|
+
* 1. `count` — gives us an O(1) gate before doing any hashing.
|
|
13
|
+
* 2. `tail` — last K ids, cheap first-line check; if the tail differs we
|
|
14
|
+
* know the prefix differs without computing a hash.
|
|
15
|
+
* 3. `prefixHash` — SHA-256 over `ids.slice(0, count).join("\n")`. This is
|
|
16
|
+
* the authoritative prefix proof: if `currentIds.slice(0, cached.count)`
|
|
17
|
+
* hashes to `cached.prefixHash`, the cache is a valid prefix of the
|
|
18
|
+
* current run.
|
|
19
|
+
*
|
|
20
|
+
* The hash uses `\n` as a separator because pi-coding-agent entry ids are
|
|
21
|
+
* URL-safe and never contain newlines. Tail size of 16 covers the
|
|
22
|
+
* "single new exchange" case (user message + assistant + ≤14 tool turns) so
|
|
23
|
+
* the slow path (hashing) only runs when something meaningful changed.
|
|
24
|
+
*/
|
|
25
|
+
import type { EntryIdFingerprint } from "../types.ts";
|
|
26
|
+
/** Tail length; chosen to cover one "user → assistant → many tool turns" cycle. */
|
|
27
|
+
export declare const FINGERPRINT_TAIL_LEN = 16;
|
|
28
|
+
export declare function buildEntryIdFingerprint(ids: ReadonlyArray<string>): EntryIdFingerprint;
|
|
29
|
+
/** Stable SHA-256 over the first `count` ids joined by `\n`. */
|
|
30
|
+
export declare function hashIds(ids: ReadonlyArray<string>, count: number): string;
|
|
31
|
+
/**
|
|
32
|
+
* Does `cached` represent a prefix of `currentIds`?
|
|
33
|
+
*
|
|
34
|
+
* Order of checks is deliberate:
|
|
35
|
+
*
|
|
36
|
+
* 1. `cached.count > currentIds.length` → impossible to be a prefix.
|
|
37
|
+
* 2. Tail mismatch at the boundary → we don't need to hash.
|
|
38
|
+
* 3. Hash check confirms the full prefix.
|
|
39
|
+
*
|
|
40
|
+
* Returns false on missing fingerprint (caller should fall back to the
|
|
41
|
+
* legacy full-array compare).
|
|
42
|
+
*/
|
|
43
|
+
export declare function isPrefixOf(cached: EntryIdFingerprint | undefined, currentIds: ReadonlyArray<string>): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Backwards-compatible prefix check.
|
|
46
|
+
*
|
|
47
|
+
* Newer caches store a fingerprint; older caches store the full id array. We
|
|
48
|
+
* accept both so the v7.13 upgrade path doesn't invalidate every existing
|
|
49
|
+
* cache file at once — the next save rewrites the cache in the new shape.
|
|
50
|
+
*/
|
|
51
|
+
export declare function legacyPrefixMatch(legacy: ReadonlyArray<string> | undefined, currentIds: ReadonlyArray<string>): boolean;
|
|
52
|
+
//# sourceMappingURL=id-fingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id-fingerprint.d.ts","sourceRoot":"","sources":["../../src/utils/id-fingerprint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,kBAAkB,CAKtF;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAS7G;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAOvH"}
|
package/dist/utils/pruning.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Reduces compaction input by collapsing redundant message sequences.
|
|
4
4
|
*/
|
|
5
5
|
import type { LlmMessage } from "../types.ts";
|
|
6
|
+
import { type ToolCallIndex } from "./extraction.ts";
|
|
6
7
|
export interface PruningResult {
|
|
7
8
|
messages: LlmMessage[];
|
|
8
9
|
/** Original input indexes retained in `messages`; same order as `messages`. */
|
|
@@ -13,9 +14,24 @@ export interface PruningResult {
|
|
|
13
14
|
count: number;
|
|
14
15
|
reason: string;
|
|
15
16
|
}>;
|
|
17
|
+
/**
|
|
18
|
+
* ToolCallIndex computed during pruning, keyed by **input** (unpruned)
|
|
19
|
+
* message offsets. Downstream consumers that work against the pruned
|
|
20
|
+
* message list (e.g. `extractStructured`) MUST NOT reuse this map verbatim
|
|
21
|
+
* because `msgIndex` values refer to the pre-prune positions. It is still
|
|
22
|
+
* useful for callers that want a quick `toolCallId → {name, arguments}`
|
|
23
|
+
* lookup over the original list.
|
|
24
|
+
*/
|
|
25
|
+
toolCallIndex: ToolCallIndex;
|
|
16
26
|
}
|
|
17
27
|
/**
|
|
18
28
|
* Detect and collapse redundant message sequences.
|
|
29
|
+
*
|
|
30
|
+
* @param msgs Input message list (unpruned).
|
|
31
|
+
* @param tcIdx Optional pre-computed tool-call index. When the caller has
|
|
32
|
+
* already built the index (e.g. orchestrator caching it on the
|
|
33
|
+
* RunContext), passing it here avoids a second O(n) walk over
|
|
34
|
+
* every assistant message.
|
|
19
35
|
*/
|
|
20
|
-
export declare function pruneRedundant(msgs: LlmMessage[]): PruningResult;
|
|
36
|
+
export declare function pruneRedundant(msgs: LlmMessage[], precomputedTcIdx?: ToolCallIndex): PruningResult;
|
|
21
37
|
//# sourceMappingURL=pruning.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pruning.d.ts","sourceRoot":"","sources":["../../src/utils/pruning.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"pruning.d.ts","sourceRoot":"","sources":["../../src/utils/pruning.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAmC,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGtF,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD;;;;;;;OAOG;IACH,aAAa,EAAE,aAAa,CAAC;CAC9B;AAWD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,gBAAgB,CAAC,EAAE,aAAa,GAAG,aAAa,CAgJlG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-log.d.ts","sourceRoot":"","sources":["../../src/utils/session-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"session-log.d.ts","sourceRoot":"","sources":["../../src/utils/session-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA6JnE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAEhE;AAkED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,mBAAmB,EAAE,GACtC,UAAU,EAAE,GAAG,IAAI,CAuBrB"}
|
package/dist/utils/state.d.ts
CHANGED
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
import type { StructuredExtraction, OpenLoop, CompactionState, ExplorationReport } from "../types.ts";
|
|
7
7
|
/**
|
|
8
8
|
* Persist compaction state for cross-compaction tracking.
|
|
9
|
+
*
|
|
10
|
+
* Atomic temp+rename writes via writeJsonSync ensure that a crash mid-save
|
|
11
|
+
* leaves the previous valid state file untouched instead of a truncated JSON
|
|
12
|
+
* blob that would crash the next loadCompactionState parse.
|
|
9
13
|
*/
|
|
10
14
|
export declare function saveCompactionState(projectId: string, state: CompactionState): void;
|
|
11
15
|
/**
|
|
@@ -15,6 +19,11 @@ export declare function loadCompactionState(projectId: string): CompactionState
|
|
|
15
19
|
export declare function buildCompactionState(extraction: StructuredExtraction, openLoops: OpenLoop[], report: ExplorationReport | null, nextActions: string[], criticalContext: string[]): CompactionState;
|
|
16
20
|
/**
|
|
17
21
|
* Inject Open Loops section into the Markdown summary.
|
|
22
|
+
*
|
|
23
|
+
* Implementation goes through the canonical summary parser so that string
|
|
24
|
+
* variants of "## Next Steps" (different capitalization, an extra blank line,
|
|
25
|
+
* H3 instead of H2) still result in `Open Loops` being placed *before* the
|
|
26
|
+
* next-steps section. Falls back to append-at-end when the section is absent.
|
|
18
27
|
*/
|
|
19
28
|
export declare function injectOpenLoopsSection(summary: string, openLoops: OpenLoop[]): string;
|
|
20
29
|
/**
|
|
@@ -48,7 +57,15 @@ export declare function computeDelta(prev: CompactionState, current: CompactionS
|
|
|
48
57
|
*/
|
|
49
58
|
export declare function formatDeltaSection(delta: CompactionDelta): string;
|
|
50
59
|
/**
|
|
51
|
-
* Inject delta section into summary
|
|
60
|
+
* Inject delta section into summary.
|
|
61
|
+
*
|
|
62
|
+
* Placement priority:
|
|
63
|
+
* 1. Immediately after `## Open Loops` if present.
|
|
64
|
+
* 2. Immediately before `## Next Steps` otherwise.
|
|
65
|
+
* 3. Append at the end.
|
|
66
|
+
*
|
|
67
|
+
* Works on the canonical parsed form, so heading-format drift cannot misorder
|
|
68
|
+
* the delta section.
|
|
52
69
|
*/
|
|
53
70
|
export declare function injectDeltaSection(summary: string, delta: CompactionDelta): string;
|
|
54
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/utils/state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/utils/state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAe,MAAM,aAAa,CAAC;AAYnH;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CAInF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAa7E;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,oBAAoB,EAChC,SAAS,EAAE,QAAQ,EAAE,EACrB,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAChC,WAAW,EAAE,MAAM,EAAE,EACrB,eAAe,EAAE,MAAM,EAAE,GACxB,eAAe,CAgDjB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAYrF;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,oCAAoC;IACpC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,2CAA2C;IAC3C,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,qBAAqB;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2CAA2C;IAC3C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,sDAAsD;IACtD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,oBAAoB;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,GAAG,eAAe,CAmD7F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CA+BjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM,CAsBlF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAO5D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAIhE"}
|
package/dist/utils/tokens.d.ts
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ProviderCapabilities } from "../types.ts";
|
|
5
5
|
export declare function getProviderCaps(provider: string): ProviderCapabilities;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Per-(provider,model) calibration factors smoothed by EMA.
|
|
8
|
+
*
|
|
9
|
+
* Two reasons this used to be a module-level singleton and now isn't:
|
|
10
|
+
*
|
|
11
|
+
* 1. **Cross-session bleed.** Two pi sessions sharing the Node process
|
|
12
|
+
* (a sub-agent spawning the parent's extension) would otherwise mix
|
|
13
|
+
* each other's calibration drift. Per-services scoping confines drift
|
|
14
|
+
* to the run that observed it.
|
|
15
|
+
* 2. **Per-model accuracy.** A single provider can ship multiple models
|
|
16
|
+
* with wildly different tokenizers (e.g. Anthropic's claude-3-haiku
|
|
17
|
+
* vs claude-sonnet-4: same provider, ~15% ratio gap). Keying on
|
|
18
|
+
* `provider/model` keeps each model's factor honest. Callers that
|
|
19
|
+
* only have a provider string still work — they share the
|
|
20
|
+
* `provider/*` bucket.
|
|
21
|
+
*
|
|
22
|
+
* The legacy module-level Map remains as a fallback when no services
|
|
23
|
+
* container is provided (direct callers, tests, REPL). Tests can call
|
|
24
|
+
* `__resetTokenCalibrationForTests` to clear it.
|
|
25
|
+
*/
|
|
26
|
+
export declare class TokenCalibrationStore {
|
|
27
|
+
private readonly factors;
|
|
28
|
+
clear(): void;
|
|
29
|
+
get(provider?: string, model?: string): number;
|
|
30
|
+
calibrate(estimated: number, actual: number, provider?: string, model?: string): void;
|
|
31
|
+
}
|
|
32
|
+
/** @internal Test-only reset; do not call from production code. */
|
|
33
|
+
export declare function __resetTokenCalibrationForTests(): void;
|
|
34
|
+
export declare function estimateTokens(text: string, provider?: string, model?: string, calibration?: TokenCalibrationStore): number;
|
|
35
|
+
export declare function calibrateFromResponse(estimated: number, actual: number, provider?: string, model?: string, calibration?: TokenCalibrationStore): void;
|
|
8
36
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/utils/tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAiGxD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAQtE;
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/utils/tokens.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAiGxD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAQtE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD,KAAK,IAAI,IAAI;IAEb,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;IAS9C,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;CAWtF;AAQD,mEAAmE;AACnE,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,WAAW,wBAAuB,GAAG,MAAM,CAQ1H;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,WAAW,wBAAuB,GAAG,IAAI,CAEpJ"}
|
|
@@ -23,4 +23,26 @@ export declare function filterToolCalls(content: unknown): Array<{
|
|
|
23
23
|
name: string;
|
|
24
24
|
arguments: Record<string, unknown>;
|
|
25
25
|
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Best-effort runtime validator for `SmartCompactDetails` payloads that we
|
|
28
|
+
* read back from compaction entries on the branch.
|
|
29
|
+
*
|
|
30
|
+
* The branch can contain compactions written by:
|
|
31
|
+
* - an older version of this extension (different shape),
|
|
32
|
+
* - a completely different compaction extension (arbitrary shape),
|
|
33
|
+
* - a corrupted session file.
|
|
34
|
+
*
|
|
35
|
+
* Damage detection passes these straight to `new Set([...])`, so a `null` or a
|
|
36
|
+
* non-array `modifiedFiles` would crash the post-success path. We narrow the
|
|
37
|
+
* shape just enough for `detectDamage` and refuse anything that fails.
|
|
38
|
+
*/
|
|
39
|
+
import type { SmartCompactDetails } from "../types.ts";
|
|
40
|
+
export declare function isValidSmartCompactDetails(d: unknown): d is SmartCompactDetails;
|
|
41
|
+
/**
|
|
42
|
+
* Normalize an arbitrary details-ish object so it is safe to feed into damage
|
|
43
|
+
* detection regardless of provenance. Anything that fails the validator gets
|
|
44
|
+
* coerced to an empty-but-typed shape; the caller can then skip work without
|
|
45
|
+
* crashing.
|
|
46
|
+
*/
|
|
47
|
+
export declare function sanitizeSmartCompactDetails(d: unknown): SmartCompactDetails | null;
|
|
26
48
|
//# sourceMappingURL=type-guards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../../src/utils/type-guards.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yCAAyC;AACzC,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAE3E;AAED,8CAA8C;AAC9C,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAEpI;AAED,+CAA+C;AAC/C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,CAG3D;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I,mBAAmB,CA4B/E;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CAgClF"}
|
package/docs/RELEASE.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Release checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist before publishing `pi-smart-compact`.
|
|
4
|
+
|
|
5
|
+
## Prepare
|
|
6
|
+
|
|
7
|
+
1. Decide the version bump using semver.
|
|
8
|
+
2. Update version metadata:
|
|
9
|
+
- `package.json`
|
|
10
|
+
- `src/constants.ts`
|
|
11
|
+
- `CHANGELOG.md`
|
|
12
|
+
3. Make sure user-facing behavior is reflected in `README.md` or project docs.
|
|
13
|
+
|
|
14
|
+
## Validate
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bun run typecheck
|
|
18
|
+
bun test
|
|
19
|
+
bun run build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The CI `verify` job runs the same validation on pull requests.
|
|
23
|
+
|
|
24
|
+
## Publish
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm publish
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`prepublishOnly` reruns typecheck, tests, and build before publishing.
|
|
31
|
+
|
|
32
|
+
## After publishing
|
|
33
|
+
|
|
34
|
+
1. Verify the npm package page.
|
|
35
|
+
2. Create a GitHub release with highlights and compatibility notes.
|
|
36
|
+
3. Confirm Pi can install the new version:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pi install npm:pi-smart-compact
|
|
40
|
+
```
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-smart-compact",
|
|
3
|
-
"version": "7.13.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.13.2",
|
|
4
|
+
"description": "Verification-oriented smart compaction extension for Pi Coding Agent — deterministic extraction, exploration, synthesis, verification, metrics, and safety checks.",
|
|
5
|
+
"packageManager": "bun@1.3.14",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"main": "./dist/index.js",
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
@@ -37,7 +38,9 @@
|
|
|
37
38
|
"docs",
|
|
38
39
|
"README.md",
|
|
39
40
|
"LICENSE",
|
|
40
|
-
"CHANGELOG.md"
|
|
41
|
+
"CHANGELOG.md",
|
|
42
|
+
"SECURITY.md",
|
|
43
|
+
"SUPPORT.md"
|
|
41
44
|
],
|
|
42
45
|
"scripts": {
|
|
43
46
|
"build": "rm -rf dist && mkdir dist && bun build ./src/index.ts --outdir ./dist --target bun --external '@earendil-works/*' --external 'typebox' && bun x tsc --emitDeclarationOnly --outDir dist",
|
|
@@ -55,6 +58,14 @@
|
|
|
55
58
|
"@earendil-works/pi-tui": "*",
|
|
56
59
|
"typebox": "*"
|
|
57
60
|
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/node": "^22.10.0",
|
|
63
|
+
"@earendil-works/pi-ai": "^0.75.5",
|
|
64
|
+
"@earendil-works/pi-coding-agent": "^0.75.5",
|
|
65
|
+
"@earendil-works/pi-tui": "^0.75.5",
|
|
66
|
+
"typebox": "^1.1.38",
|
|
67
|
+
"typescript": "^5.6.0"
|
|
68
|
+
},
|
|
58
69
|
"publishConfig": {
|
|
59
70
|
"access": "public"
|
|
60
71
|
}
|
package/dist/core.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core EESV pipeline runner.
|
|
3
|
-
*/
|
|
4
|
-
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
5
|
-
import type { Model, Api } from "@earendil-works/pi-ai";
|
|
6
|
-
import type { CompressionProfile, PendingCompaction } from "./types.ts";
|
|
7
|
-
/** Options for runSmartCompact — avoids 10-parameter positional calls */
|
|
8
|
-
export interface SmartCompactOptions {
|
|
9
|
-
ctx: ExtensionCommandContext;
|
|
10
|
-
summaryModel: Model<Api>;
|
|
11
|
-
segModel: Model<Api>;
|
|
12
|
-
profile: CompressionProfile;
|
|
13
|
-
verbose?: boolean;
|
|
14
|
-
dryRun?: boolean;
|
|
15
|
-
pendingRef: {
|
|
16
|
-
value: PendingCompaction | null;
|
|
17
|
-
createdAt: number;
|
|
18
|
-
};
|
|
19
|
-
isRunning: {
|
|
20
|
-
value: boolean;
|
|
21
|
-
};
|
|
22
|
-
autoTriggered?: boolean;
|
|
23
|
-
userNote?: string;
|
|
24
|
-
skipCompact?: boolean;
|
|
25
|
-
/** Explicit user command may bypass adaptive context-pressure tier gate. */
|
|
26
|
-
force?: boolean;
|
|
27
|
-
/** Optional hard budget for native auto-trigger only. Manual/tool runs do not time out by default. */
|
|
28
|
-
timeoutMs?: number;
|
|
29
|
-
}
|
|
30
|
-
export declare function runSmartCompact(opts: SmartCompactOptions): Promise<void>;
|
|
31
|
-
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EACV,kBAAkB,EAAE,iBAAiB,EAEtC,MAAM,YAAY,CAAC;AAwBpB,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,uBAAuB,CAAC;IAC7B,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACrB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE;QAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,SAAS,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sGAAsG;IACtG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqiB9E"}
|