@industry-theme/principal-view-panels 0.6.6 → 0.6.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.
@@ -7,7 +7,7 @@
7
7
  * This adapter bridges the synchronous FileSystemAdapter interface used by
8
8
  * ConfigurationLoader and LibraryLoader with the async panel context.
9
9
  */
10
- import type { FileSystemAdapter } from '@principal-ai/repository-abstraction';
10
+ import type { FileSystemAdapter, FileStats } from '@principal-ai/repository-abstraction';
11
11
  /**
12
12
  * File entry from the fileTree slice
13
13
  */
@@ -50,20 +50,26 @@ export declare class PanelFileSystemAdapter implements FileSystemAdapter {
50
50
  * Clear the file content cache
51
51
  */
52
52
  clearCache(): void;
53
- exists(path: string): boolean;
54
- readFile(path: string): string;
55
- writeFile(_path: string, _content: string): void;
56
- deleteFile(_path: string): void;
57
- readBinaryFile(_path: string): Uint8Array;
58
- writeBinaryFile(_path: string, _content: Uint8Array): void;
59
- createDir(_path: string): void;
60
- readDir(path: string): string[];
61
- deleteDir(_path: string): void;
62
- isDirectory(path: string): boolean;
53
+ exists(path: string): Promise<boolean>;
54
+ readFile(path: string): Promise<string>;
55
+ writeFile(_path: string, _content: string): Promise<void>;
56
+ deleteFile(_path: string): Promise<void>;
57
+ readBinaryFile(_path: string): Promise<Uint8Array>;
58
+ writeBinaryFile(_path: string, _content: Uint8Array): Promise<void>;
59
+ createDir(_path: string): Promise<void>;
60
+ readDir(path: string): Promise<string[]>;
61
+ deleteDir(_path: string): Promise<void>;
62
+ rename(_from: string, _to: string): Promise<void>;
63
+ stat(_path: string): Promise<FileStats>;
64
+ isDirectory(path: string): Promise<boolean>;
63
65
  join(...paths: string[]): string;
64
66
  relative(from: string, to: string): string;
65
67
  dirname(path: string): string;
66
68
  isAbsolute(path: string): boolean;
69
+ basename(path: string, ext?: string): string;
70
+ extname(path: string): string;
71
+ normalize(path: string): string;
72
+ homedir(): string;
67
73
  normalizeRepositoryPath(_inputPath: string): string;
68
74
  findProjectRoot(_inputPath: string): string;
69
75
  getRepositoryName(repositoryPath: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"PanelFileSystemAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/PanelFileSystemAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,oCAAoC;IACpC,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,qBAAa,sBAAuB,YAAW,iBAAiB;IAC9D,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,gBAAgB,CAAkC;gBAE9C,OAAO,EAAE,6BAA6B;IAKlD;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAInD;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIrC;;OAEG;IACH,UAAU,IAAI,IAAI;IAQlB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAgB7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAc9B,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIhD,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI/B,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAIzC,eAAe,CA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AG,OAAO,CAAC,IAAI,CAAC;IAIjD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIvC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYjD,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAOhC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;IAc1C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAK7B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIjC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;IAS5C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAM7B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI/B,OAAO,IAAI,MAAM;IAIjB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAKnD,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAI3C,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM;IASjD,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,cAAc;IAmBtB;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;IAY9C;;OAEG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;CAG1C"}
@@ -62858,7 +62858,7 @@ class PanelFileSystemAdapter {
62858
62858
  // ============================================================================
62859
62859
  // FileSystemAdapter Implementation
62860
62860
  // ============================================================================
62861
- exists(path) {
62861
+ async exists(path) {
62862
62862
  const normalized = this.normalizePath(path);
62863
62863
  const relativePath = this.toRelativePath(normalized);
62864
62864
  const fileExists = this.fileTreeFiles.some((f) => {
@@ -62868,7 +62868,7 @@ class PanelFileSystemAdapter {
62868
62868
  if (fileExists) return true;
62869
62869
  return this.isDirectory(path);
62870
62870
  }
62871
- readFile(path) {
62871
+ async readFile(path) {
62872
62872
  const normalized = this.normalizePath(path);
62873
62873
  const content = this.fileContentCache.get(normalized);
62874
62874
  if (content === void 0) {
@@ -62878,22 +62878,22 @@ class PanelFileSystemAdapter {
62878
62878
  }
62879
62879
  return content;
62880
62880
  }
62881
- writeFile(_path, _content) {
62881
+ async writeFile(_path, _content) {
62882
62882
  throw new Error("PanelFileSystemAdapter does not support writeFile. Use panel actions instead.");
62883
62883
  }
62884
- deleteFile(_path) {
62884
+ async deleteFile(_path) {
62885
62885
  throw new Error("PanelFileSystemAdapter does not support deleteFile. Use panel actions instead.");
62886
62886
  }
62887
- readBinaryFile(_path) {
62887
+ async readBinaryFile(_path) {
62888
62888
  throw new Error("PanelFileSystemAdapter does not support readBinaryFile.");
62889
62889
  }
62890
- writeBinaryFile(_path, _content) {
62890
+ async writeBinaryFile(_path, _content) {
62891
62891
  throw new Error("PanelFileSystemAdapter does not support writeBinaryFile.");
62892
62892
  }
62893
- createDir(_path) {
62893
+ async createDir(_path) {
62894
62894
  throw new Error("PanelFileSystemAdapter does not support createDir. Use panel actions instead.");
62895
62895
  }
62896
- readDir(path) {
62896
+ async readDir(path) {
62897
62897
  const normalized = this.normalizePath(path);
62898
62898
  const relativePath = this.toRelativePath(normalized);
62899
62899
  const prefix = relativePath ? `${relativePath}/` : "";
@@ -62912,10 +62912,16 @@ class PanelFileSystemAdapter {
62912
62912
  }
62913
62913
  return Array.from(items);
62914
62914
  }
62915
- deleteDir(_path) {
62915
+ async deleteDir(_path) {
62916
62916
  throw new Error("PanelFileSystemAdapter does not support deleteDir. Use panel actions instead.");
62917
62917
  }
62918
- isDirectory(path) {
62918
+ async rename(_from, _to) {
62919
+ throw new Error("PanelFileSystemAdapter does not support rename. Use panel actions instead.");
62920
+ }
62921
+ async stat(_path) {
62922
+ throw new Error("PanelFileSystemAdapter does not support stat.");
62923
+ }
62924
+ async isDirectory(path) {
62919
62925
  const normalized = this.normalizePath(path);
62920
62926
  const relativePath = this.toRelativePath(normalized);
62921
62927
  const prefix = relativePath ? `${relativePath}/` : "";
@@ -62945,6 +62951,25 @@ class PanelFileSystemAdapter {
62945
62951
  isAbsolute(path) {
62946
62952
  return path.startsWith("/");
62947
62953
  }
62954
+ basename(path, ext) {
62955
+ const segments = path.split("/");
62956
+ let base = segments[segments.length - 1] || "";
62957
+ if (ext && base.endsWith(ext)) {
62958
+ base = base.slice(0, -ext.length);
62959
+ }
62960
+ return base;
62961
+ }
62962
+ extname(path) {
62963
+ const base = this.basename(path);
62964
+ const lastDot = base.lastIndexOf(".");
62965
+ return lastDot > 0 ? base.slice(lastDot) : "";
62966
+ }
62967
+ normalize(path) {
62968
+ return this.normalizePath(path);
62969
+ }
62970
+ homedir() {
62971
+ return "/";
62972
+ }
62948
62973
  normalizeRepositoryPath(_inputPath) {
62949
62974
  return this.basePath;
62950
62975
  }