@agy-daddy/plugin-context 1.0.0 → 1.1.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.
package/agy-plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "id": "agy-daddy.context",
4
4
  "publisher": "agy-daddy",
5
- "version": "1.0.0",
5
+ "version": "1.1.0",
6
6
  "license": "MIT",
7
7
  "displayName": {
8
8
  "zh-CN": "上下文与实时速度",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agy-daddy/plugin-context",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Agy-Daddy context ring, audit panel, attachment inspector, and composer pulse capsule plugin",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "access": "public"
26
26
  },
27
27
  "scripts": {
28
- "test": "AGY_DADDY_TEST_MODE=1 node --test test/*.test.js"
28
+ "test": "node -e \"const cp=require('node:child_process'),fs=require('node:fs'),p=require('node:path');const files=fs.readdirSync('test').filter(f=>f.endsWith('.test.js')).sort().map(f=>p.join('test',f));process.exit(cp.spawnSync(process.execPath,['--test',...files],{stdio:'inherit',env:{...process.env,AGY_DADDY_TEST_MODE:'1'}}).status??1)\""
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=22.4.0"
@@ -16,7 +16,15 @@ const TEXT_EXTENSIONS = new Set([
16
16
  function uriToLocalPath(uri) {
17
17
  if (!uri || typeof uri !== 'string') return null;
18
18
  if (uri.startsWith('inline:')) return null;
19
- if (uri.startsWith('file://')) {
19
+ if (/^file:\/\//i.test(uri)) {
20
+ if (/^file:\/\/\/?[A-Za-z]:[\\/]/i.test(uri)) {
21
+ const stripped = uri.replace(/^file:\/\/\/?/i, '');
22
+ try {
23
+ return decodeURIComponent(stripped);
24
+ } catch {
25
+ return stripped;
26
+ }
27
+ }
20
28
  try {
21
29
  return decodeURIComponent(new URL(uri).pathname);
22
30
  } catch {