@wahack/pi-coding-agent 15.11.6 → 15.11.8

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@wahack/pi-coding-agent",
4
- "version": "15.11.6",
4
+ "version": "15.11.8",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -75,9 +75,7 @@
75
75
  "turndown-plugin-gfm": "^1.0.2",
76
76
  "zod": "^3.24.0"
77
77
  },
78
- "optionalDependencies": {
79
- "@huggingface/transformers": "^4.2.0"
80
- },
78
+ "optionalDependencies": {},
81
79
  "devDependencies": {
82
80
  "@types/bun": "^1.3.14"
83
81
  },
@@ -107,7 +107,7 @@ import {
107
107
  relativePathWithinRoot,
108
108
  Snowflake,
109
109
  } from "@oh-my-pi/pi-utils";
110
- import { snapcompactCompact } from "@oh-my-pi/snapcompact";
110
+ import { compact } from "@oh-my-pi/snapcompact";
111
111
  import { type AsyncJob, type AsyncJobDeliveryState, AsyncJobManager } from "../async";
112
112
  import { classifyDifficulty } from "../auto-thinking/classifier";
113
113
  import { reset as resetCapabilities } from "../capability";
@@ -6333,7 +6333,7 @@ export class AgentSession {
6333
6333
  details = compactionPrep.details;
6334
6334
  preserveData = compactionPrep.preserveData;
6335
6335
  } else if (snapcompactReady) {
6336
- const snapcompactResult = await snapcompactCompact(preparation, { convertToLlm, model: this.model });
6336
+ const snapcompactResult = await compact(preparation, { convertToLlm, model: this.model });
6337
6337
  summary = snapcompactResult.summary;
6338
6338
  shortSummary = snapcompactResult.shortSummary;
6339
6339
  firstKeptEntryId = snapcompactResult.firstKeptEntryId;
@@ -7847,7 +7847,7 @@ export class AgentSession {
7847
7847
  } else if (action === "snapcompact") {
7848
7848
  // Local, deterministic: render discarded history onto PNG frames.
7849
7849
  // No model candidates, no API key, no retry loop.
7850
- const snapcompactResult = await snapcompactCompact(preparation, { convertToLlm, model: this.model });
7850
+ const snapcompactResult = await compact(preparation, { convertToLlm, model: this.model });
7851
7851
  summary = snapcompactResult.summary;
7852
7852
  shortSummary = snapcompactResult.shortSummary;
7853
7853
  firstKeptEntryId = snapcompactResult.firstKeptEntryId;
@@ -27,7 +27,7 @@ import {
27
27
  Snowflake,
28
28
  toError,
29
29
  } from "@oh-my-pi/pi-utils";
30
- import { getPreservedSnapcompactArchive, snapcompactImages } from "@oh-my-pi/snapcompact";
30
+ import { getPreservedArchive, images } from "@oh-my-pi/snapcompact";
31
31
  import { ArtifactManager } from "./artifacts";
32
32
  import {
33
33
  type BlobPutOptions,
@@ -712,7 +712,7 @@ export function buildSessionContext(
712
712
  // the component can report them.
713
713
  for (const entry of path) {
714
714
  if (entry.type === "compaction") {
715
- const snapcompactArchive = getPreservedSnapcompactArchive(entry.preserveData);
715
+ const snapcompactArchive = getPreservedArchive(entry.preserveData);
716
716
  messages.push(
717
717
  createCompactionSummaryMessage(
718
718
  entry.summary,
@@ -720,7 +720,7 @@ export function buildSessionContext(
720
720
  entry.timestamp,
721
721
  entry.shortSummary,
722
722
  undefined,
723
- snapcompactArchive ? snapcompactImages(snapcompactArchive) : undefined,
723
+ snapcompactArchive ? images(snapcompactArchive) : undefined,
724
724
  ),
725
725
  );
726
726
  } else {
@@ -744,7 +744,7 @@ export function buildSessionContext(
744
744
 
745
745
  // Emit summary first; re-attach any archived snapcompact frames so the
746
746
  // model can keep reading the archived history after every context rebuild.
747
- const snapcompactArchive = getPreservedSnapcompactArchive(compaction.preserveData);
747
+ const snapcompactArchive = getPreservedArchive(compaction.preserveData);
748
748
  messages.push(
749
749
  createCompactionSummaryMessage(
750
750
  compaction.summary,
@@ -752,7 +752,7 @@ export function buildSessionContext(
752
752
  compaction.timestamp,
753
753
  compaction.shortSummary,
754
754
  providerPayload,
755
- snapcompactArchive ? snapcompactImages(snapcompactArchive) : undefined,
755
+ snapcompactArchive ? images(snapcompactArchive) : undefined,
756
756
  ),
757
757
  );
758
758
 
@@ -1,7 +1,20 @@
1
- import type { DeviceType } from "@huggingface/transformers";
2
1
  import { $env } from "@oh-my-pi/pi-utils";
3
2
 
4
- export type TinyModelDevice = DeviceType;
3
+ /** Device type for local tiny models (mirrors transformers.js DeviceType). */
4
+ export type TinyModelDevice =
5
+ | "auto"
6
+ | "gpu"
7
+ | "cpu"
8
+ | "wasm"
9
+ | "webgpu"
10
+ | "cuda"
11
+ | "dml"
12
+ | "coreml"
13
+ | "webnn"
14
+ | "webnn-npu"
15
+ | "webnn-gpu"
16
+ | "webnn-cpu";
17
+ import { $env } from "@oh-my-pi/pi-utils";
5
18
 
6
19
  export interface TinyModelDevicePreference {
7
20
  device: TinyModelDevice;
package/src/tiny/dtype.ts CHANGED
@@ -1,8 +1,22 @@
1
- import type { DataType } from "@huggingface/transformers";
2
1
  import { $env } from "@oh-my-pi/pi-utils";
3
2
 
4
- /** ONNX quantization / precision for local tiny models (transformers.js `dtype`). */
5
- export type TinyModelDtype = DataType;
3
+ /** ONNX quantization / precision for local tiny models (mirrors transformers.js DataType). */
4
+ export type TinyModelDtype =
5
+ | "auto"
6
+ | "fp32"
7
+ | "fp16"
8
+ | "q8"
9
+ | "int8"
10
+ | "uint8"
11
+ | "q4"
12
+ | "bnb4"
13
+ | "q4f16"
14
+ | "q2"
15
+ | "q2f16"
16
+ | "q1"
17
+ | "q1f16";
18
+ import { $env } from "@oh-my-pi/pi-utils";
19
+
6
20
 
7
21
  const DTYPE_VALUES: Record<TinyModelDtype, true> = {
8
22
  auto: true,