pi-openai-toolkit 0.23.2 → 0.24.1
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/LICENSE +21 -21
- package/NOTICE +83 -83
- package/README.md +4 -15
- package/README.zh.md +4 -15
- package/config.schema.json +264 -278
- package/docs/configuration.md +304 -306
- package/docs/internals.md +34 -120
- package/package.json +123 -136
- package/src/compact-client.ts +412 -412
- package/src/compaction-projection.ts +35 -35
- package/src/config/legacy.ts +469 -519
- package/src/config/migration.ts +115 -103
- package/src/config/notifications.ts +46 -36
- package/src/config/policy.ts +115 -116
- package/src/config/v2.ts +1128 -1167
- package/src/config.ts +320 -310
- package/src/debug.ts +238 -238
- package/src/deferred-tool-carryover.ts +282 -282
- package/src/details-store.ts +151 -151
- package/src/extension-runtime.ts +1095 -1919
- package/src/image-generation/extension.ts +189 -189
- package/src/image-generation/protocol.ts +579 -579
- package/src/image-generation/types.ts +300 -300
- package/src/native-fallback.ts +140 -152
- package/src/payload-rewrite.ts +515 -515
- package/src/pi-context-hook.ts +117 -117
- package/src/remote-v2-client.ts +811 -811
- package/src/request-context-cache.ts +155 -155
- package/src/responses-headers.ts +180 -180
- package/src/retired-remote-windows.ts +35 -0
- package/src/runtime.ts +875 -865
- package/src/serializer.ts +882 -882
- package/src/supported-environment.ts +27 -27
- package/src/types.ts +541 -565
- package/src/web-search/alpha-client.ts +876 -876
- package/src/web-search/extension.ts +530 -530
- package/src/web-search/payload.ts +299 -299
- package/src/web-search/prompt.ts +60 -60
- package/src/web-search/types.ts +166 -166
- package/tsconfig.check.json +50 -50
- package/src/context-management/codex-provider.ts +0 -270
- package/src/context-management/history-notes.ts +0 -357
- package/src/context-management/manual-compact.ts +0 -247
- package/src/context-management/messages.ts +0 -238
- package/src/context-management/namespace-tools.ts +0 -426
- package/src/context-management/responses-tools.ts +0 -238
- package/src/context-management/scoped-compaction.ts +0 -89
- package/src/context-management/tool-contract.ts +0 -62
- package/src/context-management/tools.ts +0 -371
- package/src/context-management/types.ts +0 -168
- package/src/context-management/window-budget.ts +0 -83
- package/src/context-management/window-bulk.ts +0 -155
- package/src/context-management/window-manager.ts +0 -912
- package/src/context-management/window-request.ts +0 -125
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
NativeCompactionDetails,
|
|
3
|
-
NativeCompactionInputProvenance,
|
|
4
|
-
} from "./types";
|
|
5
|
-
|
|
6
|
-
/** The configured Pi context-hook projector is unavailable or failed. */
|
|
7
|
-
export const COMPACTION_PROJECTION_UNAVAILABLE = "no-supported-projection-seam" as const;
|
|
8
|
-
/** The current session context could not be read before projection. */
|
|
9
|
-
export const COMPACTION_SESSION_CONTEXT_UNAVAILABLE = "session-context-unavailable" as const;
|
|
10
|
-
/** A projected recursive context did not contain the current compaction summary. */
|
|
11
|
-
export const COMPACTION_PROJECTED_CONTEXT_UNAVAILABLE = "projected-compaction-context-unavailable" as const;
|
|
12
|
-
/** The latest opaque checkpoint was created with no or a different input marker. */
|
|
13
|
-
export const COMPACTION_CHECKPOINT_PROVENANCE_UNAVAILABLE = "unverified-compaction-checkpoint" as const;
|
|
14
|
-
|
|
15
|
-
/** Persisted edits changed input already sealed inside an opaque checkpoint. */
|
|
16
|
-
export const COMPACTION_CHECKPOINT_CONTEXT_EDITED = "checkpoint-context-edited" as const;
|
|
17
|
-
|
|
18
|
-
export type UnprojectedCompactionReason =
|
|
19
|
-
| typeof COMPACTION_CHECKPOINT_CONTEXT_EDITED
|
|
20
|
-
| typeof COMPACTION_PROJECTION_UNAVAILABLE
|
|
21
|
-
| typeof COMPACTION_SESSION_CONTEXT_UNAVAILABLE
|
|
22
|
-
| typeof COMPACTION_CHECKPOINT_PROVENANCE_UNAVAILABLE
|
|
23
|
-
| typeof COMPACTION_PROJECTED_CONTEXT_UNAVAILABLE;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* A Remote V2 checkpoint is safe for the current replay chain only when its
|
|
27
|
-
* marker matches the configured input source. Structural persistence validation
|
|
28
|
-
* intentionally remains more permissive for old session files.
|
|
29
|
-
*/
|
|
30
|
-
export function hasVerifiedCompactionInputProvenance(
|
|
31
|
-
details: Pick<NativeCompactionDetails, "inputProvenance"> | undefined,
|
|
32
|
-
expected: NativeCompactionInputProvenance,
|
|
33
|
-
): boolean {
|
|
34
|
-
return details?.inputProvenance === expected;
|
|
35
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
NativeCompactionDetails,
|
|
3
|
+
NativeCompactionInputProvenance,
|
|
4
|
+
} from "./types";
|
|
5
|
+
|
|
6
|
+
/** The configured Pi context-hook projector is unavailable or failed. */
|
|
7
|
+
export const COMPACTION_PROJECTION_UNAVAILABLE = "no-supported-projection-seam" as const;
|
|
8
|
+
/** The current session context could not be read before projection. */
|
|
9
|
+
export const COMPACTION_SESSION_CONTEXT_UNAVAILABLE = "session-context-unavailable" as const;
|
|
10
|
+
/** A projected recursive context did not contain the current compaction summary. */
|
|
11
|
+
export const COMPACTION_PROJECTED_CONTEXT_UNAVAILABLE = "projected-compaction-context-unavailable" as const;
|
|
12
|
+
/** The latest opaque checkpoint was created with no or a different input marker. */
|
|
13
|
+
export const COMPACTION_CHECKPOINT_PROVENANCE_UNAVAILABLE = "unverified-compaction-checkpoint" as const;
|
|
14
|
+
|
|
15
|
+
/** Persisted edits changed input already sealed inside an opaque checkpoint. */
|
|
16
|
+
export const COMPACTION_CHECKPOINT_CONTEXT_EDITED = "checkpoint-context-edited" as const;
|
|
17
|
+
|
|
18
|
+
export type UnprojectedCompactionReason =
|
|
19
|
+
| typeof COMPACTION_CHECKPOINT_CONTEXT_EDITED
|
|
20
|
+
| typeof COMPACTION_PROJECTION_UNAVAILABLE
|
|
21
|
+
| typeof COMPACTION_SESSION_CONTEXT_UNAVAILABLE
|
|
22
|
+
| typeof COMPACTION_CHECKPOINT_PROVENANCE_UNAVAILABLE
|
|
23
|
+
| typeof COMPACTION_PROJECTED_CONTEXT_UNAVAILABLE;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A Remote V2 checkpoint is safe for the current replay chain only when its
|
|
27
|
+
* marker matches the configured input source. Structural persistence validation
|
|
28
|
+
* intentionally remains more permissive for old session files.
|
|
29
|
+
*/
|
|
30
|
+
export function hasVerifiedCompactionInputProvenance(
|
|
31
|
+
details: Pick<NativeCompactionDetails, "inputProvenance"> | undefined,
|
|
32
|
+
expected: NativeCompactionInputProvenance,
|
|
33
|
+
): boolean {
|
|
34
|
+
return details?.inputProvenance === expected;
|
|
35
|
+
}
|