@cortexkit/pi-magic-context 0.30.0 → 0.30.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/dist/index.js CHANGED
@@ -156467,11 +156467,9 @@ function compareSemverCore(a, b) {
156467
156467
 
156468
156468
  // ../plugin/src/shared/announcement.ts
156469
156469
  init_data_path();
156470
- var ANNOUNCEMENT_VERSION = "0.30.0";
156470
+ var ANNOUNCEMENT_VERSION = "0.30.1";
156471
156471
  var ANNOUNCEMENT_FEATURES = [
156472
- "Setup and doctor now recognize an OpenCode Desktop install that has no CLI on PATH, instead of reporting OpenCode as not installed (#196). Desktop-only users continue setup with manual model entry.",
156473
- "TUI sidebar badge color follows your theme again (#198): it uses the theme background like sibling badges, with a fallback so the label can't disappear on transparent themes.",
156474
- "doctor clears a stale plugin cache more reliably (#199): it compares against the plugin's latest published version and preserves the cache when offline."
156472
+ "Local embeddings work on OpenCode Desktop again (#195): /ctx-embed no longer fails with 'Unsupported device: cpu' on the Desktop app."
156475
156473
  ];
156476
156474
  var ANNOUNCEMENT_FOOTER = "Join us on Discord: https://discord.gg/F2uWxjGnU";
156477
156475
  var STATE_FILENAME = "last_announced_version";
@@ -173220,8 +173218,8 @@ async function injectWasmOrtForElectron() {
173220
173218
  try {
173221
173219
  const { createRequire: createRequireFn } = await import("node:module");
173222
173220
  const requireFn = createRequireFn(import.meta.url);
173223
- const pkgPath = requireFn.resolve("onnxruntime-web/package.json");
173224
- const distDir = join10(dirname5(pkgPath), "dist");
173221
+ const mainEntry = requireFn.resolve("onnxruntime-web");
173222
+ const distDir = dirname5(mainEntry);
173225
173223
  const wasmPathsPrefix = `${pathToFileURL(distDir).href}/`;
173226
173224
  if (ortWeb.env?.wasm) {
173227
173225
  ortWeb.env.wasm.wasmPaths = wasmPathsPrefix;
@@ -173342,7 +173340,7 @@ class LocalEmbeddingProvider {
173342
173340
  if (this.disposing) {
173343
173341
  return;
173344
173342
  }
173345
- await injectWasmOrtForElectron();
173343
+ const injectedWasmOrt = await injectWasmOrtForElectron();
173346
173344
  const transformersSpec = "@huggingface/transformers";
173347
173345
  const transformersModule = await import(transformersSpec);
173348
173346
  const env = transformersModule.env;
@@ -173372,7 +173370,8 @@ class LocalEmbeddingProvider {
173372
173370
  for (let attempt = 1;attempt <= MAX_ATTEMPTS; attempt++) {
173373
173371
  try {
173374
173372
  const pipeline = await withQuietConsole(() => createPipeline("feature-extraction", this.model, {
173375
- dtype: "fp32"
173373
+ dtype: "fp32",
173374
+ ...injectedWasmOrt ? { device: "auto" } : {}
173376
173375
  }));
173377
173376
  if (this.disposing) {
173378
173377
  await pipeline.dispose?.();
@@ -199800,7 +199799,7 @@ function formatThresholdPercent(value) {
199800
199799
  // package.json
199801
199800
  var package_default = {
199802
199801
  name: "@cortexkit/pi-magic-context",
199803
- version: "0.30.0",
199802
+ version: "0.30.1",
199804
199803
  type: "module",
199805
199804
  description: "Pi coding agent extension for Magic Context — cross-session memory and context management",
199806
199805
  main: "dist/index.js",
@@ -160859,8 +160859,8 @@ async function injectWasmOrtForElectron() {
160859
160859
  try {
160860
160860
  const { createRequire: createRequireFn } = await import("node:module");
160861
160861
  const requireFn = createRequireFn(import.meta.url);
160862
- const pkgPath = requireFn.resolve("onnxruntime-web/package.json");
160863
- const distDir = join5(dirname5(pkgPath), "dist");
160862
+ const mainEntry = requireFn.resolve("onnxruntime-web");
160863
+ const distDir = dirname5(mainEntry);
160864
160864
  const wasmPathsPrefix = `${pathToFileURL(distDir).href}/`;
160865
160865
  if (ortWeb.env?.wasm) {
160866
160866
  ortWeb.env.wasm.wasmPaths = wasmPathsPrefix;
@@ -160981,7 +160981,7 @@ class LocalEmbeddingProvider {
160981
160981
  if (this.disposing) {
160982
160982
  return;
160983
160983
  }
160984
- await injectWasmOrtForElectron();
160984
+ const injectedWasmOrt = await injectWasmOrtForElectron();
160985
160985
  const transformersSpec = "@huggingface/transformers";
160986
160986
  const transformersModule = await import(transformersSpec);
160987
160987
  const env = transformersModule.env;
@@ -161011,7 +161011,8 @@ class LocalEmbeddingProvider {
161011
161011
  for (let attempt = 1;attempt <= MAX_ATTEMPTS; attempt++) {
161012
161012
  try {
161013
161013
  const pipeline = await withQuietConsole(() => createPipeline("feature-extraction", this.model, {
161014
- dtype: "fp32"
161014
+ dtype: "fp32",
161015
+ ...injectedWasmOrt ? { device: "auto" } : {}
161015
161016
  }));
161016
161017
  if (this.disposing) {
161017
161018
  await pipeline.dispose?.();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-magic-context",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "type": "module",
5
5
  "description": "Pi coding agent extension for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",