@phoundry/phials-plugin-sdk 1.0.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/LICENSE +21 -0
- package/README.md +3 -0
- package/command-types.generated.d.ts +288 -0
- package/events-types.generated.d.ts +195 -0
- package/file-types.generated.d.ts +239 -0
- package/manifest-schema.js +307 -0
- package/manifest-schema.ts +403 -0
- package/module-types.generated.d.ts +41 -0
- package/package.json +25 -0
- package/pane-context.generated.d.ts +71 -0
- package/phials-plugin-sdk.d.ts +11 -0
- package/plugin-types.generated.d.ts +1165 -0
- package/public-contract.generated.d.ts +329 -0
- package/shortcuts-types.generated.d.ts +113 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
// @generated from phials - do not edit
|
|
2
|
+
// Source graph: phials/scripts/lib/public-sdk-manifest.mjs
|
|
3
|
+
|
|
4
|
+
/** Values that can cross the public plugin boundary as plain data. */
|
|
5
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
6
|
+
type JsonValue =
|
|
7
|
+
| JsonPrimitive
|
|
8
|
+
| readonly JsonValue[]
|
|
9
|
+
| { readonly [key: string]: JsonValue };
|
|
10
|
+
|
|
11
|
+
type PluginFileErrorCode =
|
|
12
|
+
| "aborted"
|
|
13
|
+
| "already-exists"
|
|
14
|
+
| "conflict"
|
|
15
|
+
| "invalid-path"
|
|
16
|
+
| "is-directory"
|
|
17
|
+
| "not-directory"
|
|
18
|
+
| "not-found"
|
|
19
|
+
| "permission-denied"
|
|
20
|
+
| "unsupported"
|
|
21
|
+
| "io-error";
|
|
22
|
+
|
|
23
|
+
/** Stable operational failure exposed by public filesystem operations. */
|
|
24
|
+
declare class PluginFileError extends Error {
|
|
25
|
+
readonly name: "PluginFileError";
|
|
26
|
+
readonly code: PluginFileErrorCode;
|
|
27
|
+
readonly path?: string;
|
|
28
|
+
constructor(
|
|
29
|
+
code: PluginFileErrorCode,
|
|
30
|
+
message: string,
|
|
31
|
+
options?: { path?: string; cause?: unknown },
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface PluginFileFailure {
|
|
36
|
+
readonly code: PluginFileErrorCode;
|
|
37
|
+
readonly message: string;
|
|
38
|
+
readonly path?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type PluginPathOutcome =
|
|
42
|
+
| { readonly path: string; readonly status: "succeeded" }
|
|
43
|
+
| {
|
|
44
|
+
readonly path: string;
|
|
45
|
+
readonly status: "failed";
|
|
46
|
+
readonly failure: PluginFileFailure;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
interface PluginDirectoryReadResult {
|
|
50
|
+
readonly entries: readonly FileEntry[];
|
|
51
|
+
readonly failures: readonly PluginFileFailure[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface PluginBinaryFileSnapshot {
|
|
55
|
+
readonly content: Uint8Array;
|
|
56
|
+
readonly revision: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
type PluginBinaryWriteResult =
|
|
60
|
+
| { readonly status: "saved"; readonly revision: string }
|
|
61
|
+
| {
|
|
62
|
+
readonly status: "conflict";
|
|
63
|
+
readonly actualRevision: string | null;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
interface FolderSummary {
|
|
67
|
+
readonly path: string;
|
|
68
|
+
readonly files: number;
|
|
69
|
+
readonly folders: number;
|
|
70
|
+
readonly totalBytes: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface ClipboardAPI {
|
|
74
|
+
writeText(text: string): Promise<void>;
|
|
75
|
+
readText(): Promise<string>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface ExplorerAPI {
|
|
79
|
+
getActivePane(): PluginPaneContext | null;
|
|
80
|
+
getPane(id: string): PluginPaneContext | null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface GitInfo {
|
|
84
|
+
readonly rootPath: string;
|
|
85
|
+
readonly branch: string | null;
|
|
86
|
+
readonly detached: boolean;
|
|
87
|
+
readonly dirty: boolean;
|
|
88
|
+
readonly ahead: number;
|
|
89
|
+
readonly behind: number;
|
|
90
|
+
readonly remoteUrl: string | null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface RepositoryLanguage {
|
|
94
|
+
readonly language: string;
|
|
95
|
+
readonly bytes: number;
|
|
96
|
+
readonly share: number;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface GitAPI {
|
|
100
|
+
getInfo(path: string): Promise<GitInfo | null>;
|
|
101
|
+
getLanguages(path: string): Promise<readonly RepositoryLanguage[]>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
type WorkspaceFolderPropertyType =
|
|
105
|
+
| "text"
|
|
106
|
+
| "number"
|
|
107
|
+
| "date"
|
|
108
|
+
| "boolean"
|
|
109
|
+
| "select"
|
|
110
|
+
| "multi-select"
|
|
111
|
+
| "status"
|
|
112
|
+
| "rating"
|
|
113
|
+
| "url"
|
|
114
|
+
| "relation"
|
|
115
|
+
| "rollup"
|
|
116
|
+
| "formula";
|
|
117
|
+
|
|
118
|
+
type WorkspaceFolderPropertyValue = JsonValue;
|
|
119
|
+
|
|
120
|
+
interface WorkspaceFolderPropertyOption {
|
|
121
|
+
readonly id: string;
|
|
122
|
+
readonly name: string;
|
|
123
|
+
readonly color?: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface WorkspaceFolderPropertyDefinition {
|
|
127
|
+
readonly id: string;
|
|
128
|
+
readonly name: string;
|
|
129
|
+
readonly displayName: string;
|
|
130
|
+
readonly type: WorkspaceFolderPropertyType;
|
|
131
|
+
readonly options?: readonly WorkspaceFolderPropertyOption[];
|
|
132
|
+
readonly derived: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface WorkspaceFolderSchema {
|
|
136
|
+
readonly version: number;
|
|
137
|
+
readonly properties: readonly WorkspaceFolderPropertyDefinition[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
type WorkspaceFolderFileRef =
|
|
141
|
+
| {
|
|
142
|
+
readonly workspaceFolderId: string;
|
|
143
|
+
readonly fileId: string;
|
|
144
|
+
}
|
|
145
|
+
| { readonly path: string };
|
|
146
|
+
|
|
147
|
+
interface KnownWorkspaceFolder {
|
|
148
|
+
readonly id: string;
|
|
149
|
+
readonly rootPath: string;
|
|
150
|
+
readonly name: string;
|
|
151
|
+
readonly icon?: string;
|
|
152
|
+
readonly available: boolean;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface WorkspaceFolderPropertyWrite {
|
|
156
|
+
readonly propertyId: string;
|
|
157
|
+
readonly value: WorkspaceFolderPropertyValue | null;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface WorkspaceFoldersAPI {
|
|
161
|
+
isWorkspaceFolder(path: string): Promise<boolean>;
|
|
162
|
+
getSchema(
|
|
163
|
+
workspaceFolderIdOrPath: string,
|
|
164
|
+
): Promise<WorkspaceFolderSchema>;
|
|
165
|
+
getPropertyValue(
|
|
166
|
+
file: WorkspaceFolderFileRef,
|
|
167
|
+
propertyId: string,
|
|
168
|
+
): Promise<WorkspaceFolderPropertyValue | null>;
|
|
169
|
+
setPropertyValue(
|
|
170
|
+
file: WorkspaceFolderFileRef,
|
|
171
|
+
propertyId: string,
|
|
172
|
+
value: WorkspaceFolderPropertyValue | null,
|
|
173
|
+
): Promise<void>;
|
|
174
|
+
setPropertyValues(
|
|
175
|
+
file: WorkspaceFolderFileRef,
|
|
176
|
+
values: readonly WorkspaceFolderPropertyWrite[],
|
|
177
|
+
): Promise<void>;
|
|
178
|
+
getTags(file: WorkspaceFolderFileRef): Promise<readonly string[]>;
|
|
179
|
+
setTags(file: WorkspaceFolderFileRef, tags: readonly string[]): Promise<void>;
|
|
180
|
+
getRating(file: WorkspaceFolderFileRef): Promise<number | null>;
|
|
181
|
+
setRating(file: WorkspaceFolderFileRef, rating: number | null): Promise<void>;
|
|
182
|
+
listKnown(): Promise<readonly KnownWorkspaceFolder[]>;
|
|
183
|
+
openPage(
|
|
184
|
+
file: WorkspaceFolderFileRef,
|
|
185
|
+
options?: { focusEditor?: boolean; sourcePaneId?: string },
|
|
186
|
+
): Promise<void>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
type ModuleOpenResult =
|
|
190
|
+
| { readonly status: "created"; readonly moduleInstanceId: string }
|
|
191
|
+
| { readonly status: "focused"; readonly moduleInstanceId: string }
|
|
192
|
+
| { readonly status: "replaced"; readonly moduleInstanceId: string };
|
|
193
|
+
|
|
194
|
+
interface PluginSettingsChange {
|
|
195
|
+
readonly key: string;
|
|
196
|
+
readonly value: unknown;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
interface PluginSettingsSubscription {
|
|
200
|
+
unsubscribe(): void;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
type PluginDatabaseValue = JsonPrimitive | Uint8Array;
|
|
204
|
+
|
|
205
|
+
interface PluginDatabaseSchemaOperations {
|
|
206
|
+
createTable(table: PluginTableDefinition): Promise<void>;
|
|
207
|
+
addColumn(table: string, column: PluginColumnDefinition): Promise<void>;
|
|
208
|
+
renameColumn(
|
|
209
|
+
table: string,
|
|
210
|
+
from: string,
|
|
211
|
+
to: string,
|
|
212
|
+
): Promise<void>;
|
|
213
|
+
dropColumn(table: string, column: string): Promise<void>;
|
|
214
|
+
createIndex(table: string, index: PluginIndexDefinition): Promise<void>;
|
|
215
|
+
dropIndex(table: string, index: string): Promise<void>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
interface PluginDatabaseTransaction {
|
|
219
|
+
readonly schema: PluginDatabaseSchemaOperations;
|
|
220
|
+
query<T = Record<string, PluginDatabaseValue>>(
|
|
221
|
+
table: string,
|
|
222
|
+
sql: string,
|
|
223
|
+
params?: readonly PluginDatabaseValue[],
|
|
224
|
+
): Promise<readonly T[]>;
|
|
225
|
+
execute(
|
|
226
|
+
table: string,
|
|
227
|
+
sql: string,
|
|
228
|
+
params?: readonly PluginDatabaseValue[],
|
|
229
|
+
): Promise<DatabaseExecuteResult>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
interface PluginDatabaseMigration {
|
|
233
|
+
readonly from: number;
|
|
234
|
+
readonly to: number;
|
|
235
|
+
up(transaction: PluginDatabaseTransaction): Promise<void>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** Public closure for payloads retained under compatibility-sensitive event names. */
|
|
239
|
+
type ColumnCalculationKind =
|
|
240
|
+
| "none"
|
|
241
|
+
| "count"
|
|
242
|
+
| "count-unique"
|
|
243
|
+
| "count-files"
|
|
244
|
+
| "count-unique-files"
|
|
245
|
+
| "count-folders"
|
|
246
|
+
| "count-unique-folders"
|
|
247
|
+
| "percent-empty"
|
|
248
|
+
| "percent-not-empty"
|
|
249
|
+
| "sum"
|
|
250
|
+
| "average"
|
|
251
|
+
| "min"
|
|
252
|
+
| "max"
|
|
253
|
+
| "earliest"
|
|
254
|
+
| "latest"
|
|
255
|
+
| "range-days"
|
|
256
|
+
| "checked"
|
|
257
|
+
| "unchecked"
|
|
258
|
+
| "percent-checked";
|
|
259
|
+
|
|
260
|
+
interface DetailsViewColumnConfig {
|
|
261
|
+
readonly id: string;
|
|
262
|
+
readonly visible: boolean;
|
|
263
|
+
readonly width: number;
|
|
264
|
+
readonly order: number;
|
|
265
|
+
readonly frozen?: boolean;
|
|
266
|
+
readonly source?: "file" | "property" | "metadata";
|
|
267
|
+
readonly visibilitySource?: "default" | "auto" | "user";
|
|
268
|
+
readonly calculation?: ColumnCalculationKind;
|
|
269
|
+
readonly wrap?: boolean;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
type PagePropertyVisibility = "always" | "not-empty" | "hidden";
|
|
273
|
+
|
|
274
|
+
interface VialPageConfig {
|
|
275
|
+
readonly propertyOrder?: readonly string[];
|
|
276
|
+
readonly propertyVisibility?: Readonly<
|
|
277
|
+
Record<string, PagePropertyVisibility>
|
|
278
|
+
>;
|
|
279
|
+
readonly compactProperties?: boolean;
|
|
280
|
+
readonly fullWidth?: boolean;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
interface SavedVialView {
|
|
284
|
+
readonly id: string;
|
|
285
|
+
readonly name: string;
|
|
286
|
+
readonly icon?: string;
|
|
287
|
+
readonly viewMode: ViewMode;
|
|
288
|
+
readonly sortBy?: string;
|
|
289
|
+
readonly sortDirection?: "asc" | "desc";
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
type PropertyValue = WorkspaceFolderPropertyValue;
|
|
293
|
+
type VialCellDeltaOperation = "set" | "clear" | "pending";
|
|
294
|
+
|
|
295
|
+
interface VialCellDelta {
|
|
296
|
+
readonly vialId: string;
|
|
297
|
+
readonly vialPath: string;
|
|
298
|
+
readonly fileId: string;
|
|
299
|
+
readonly filePath: string;
|
|
300
|
+
readonly propertyId: string;
|
|
301
|
+
readonly operation: VialCellDeltaOperation;
|
|
302
|
+
readonly value: PropertyValue | null;
|
|
303
|
+
readonly mutationVersion: number;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
interface VialValueDeltaEvent {
|
|
307
|
+
readonly kind: "delta";
|
|
308
|
+
readonly sourcePaneId: string;
|
|
309
|
+
readonly cell: VialCellDelta;
|
|
310
|
+
readonly dependentDeltas: readonly VialCellDelta[];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
interface VialValueRefetchEvent {
|
|
314
|
+
readonly kind: "refetch";
|
|
315
|
+
readonly sourcePaneId: string;
|
|
316
|
+
readonly vialId: string;
|
|
317
|
+
readonly vialPath: string;
|
|
318
|
+
readonly fileIds?: readonly string[];
|
|
319
|
+
readonly filePaths?: readonly string[];
|
|
320
|
+
readonly propertyIds?: readonly string[];
|
|
321
|
+
readonly reason: "legacy" | "plugin" | "schema";
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
type VialValuesChangedEvent = VialValueDeltaEvent | VialValueRefetchEvent;
|
|
325
|
+
|
|
326
|
+
type DrivesChangedPayload = {
|
|
327
|
+
readonly reason: "mounted" | "unmounted" | "changed" | "poll";
|
|
328
|
+
readonly platform: "macos" | "windows" | "linux" | "unknown";
|
|
329
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// @generated from phials - do not edit
|
|
2
|
+
// Source graph: phials/scripts/lib/public-sdk-manifest.mjs
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Keyboard Shortcut Manager Type Definitions
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Platform identifiers */
|
|
9
|
+
type ShortcutPlatform = "mac" | "windows" | "linux";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Platform-specific shortcut definitions.
|
|
13
|
+
* Use when different platforms need different shortcuts.
|
|
14
|
+
*/
|
|
15
|
+
interface PlatformShortcuts {
|
|
16
|
+
mac?: string;
|
|
17
|
+
windows?: string;
|
|
18
|
+
linux?: string;
|
|
19
|
+
/** Fallback for unspecified platforms */
|
|
20
|
+
default?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Shortcut definition syntax:
|
|
25
|
+
* - "CmdOrCtrl+S" - Platform-dependent (Cmd on Mac, Ctrl on Win/Linux)
|
|
26
|
+
* - "Ctrl+Shift+N" - Explicit modifiers
|
|
27
|
+
* - "Delete" - Single key
|
|
28
|
+
* - { mac: "Cmd+Backspace", default: "Delete" } - Platform-specific
|
|
29
|
+
*/
|
|
30
|
+
type ShortcutDefinition = string | PlatformShortcuts;
|
|
31
|
+
|
|
32
|
+
/** Parsed shortcut for internal matching */
|
|
33
|
+
interface ParsedShortcut {
|
|
34
|
+
/** Normalized key (lowercase, e.g., 'a', 'delete', 'f1') */
|
|
35
|
+
key: string;
|
|
36
|
+
ctrl: boolean;
|
|
37
|
+
meta: boolean;
|
|
38
|
+
alt: boolean;
|
|
39
|
+
shift: boolean;
|
|
40
|
+
/** Original string representation */
|
|
41
|
+
original: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** A registered shortcut action (internal use) */
|
|
45
|
+
interface ShortcutRegistration {
|
|
46
|
+
/** Unique identifier (e.g., 'core.newTab', 'plugin.terminal.toggle') */
|
|
47
|
+
id: string;
|
|
48
|
+
|
|
49
|
+
/** Human-readable name shown in settings */
|
|
50
|
+
label: string;
|
|
51
|
+
|
|
52
|
+
/** Optional description */
|
|
53
|
+
description?: string;
|
|
54
|
+
|
|
55
|
+
/** Default shortcut(s) - up to 3 */
|
|
56
|
+
defaults?: ShortcutDefinition[];
|
|
57
|
+
|
|
58
|
+
/** Section for settings page (defaults to provider type or 'Builtin') */
|
|
59
|
+
section?: string;
|
|
60
|
+
|
|
61
|
+
/** Subsection for settings page (defaults to plugin name if from plugin) */
|
|
62
|
+
subsection?: string;
|
|
63
|
+
|
|
64
|
+
/** The action handler */
|
|
65
|
+
handler: (event: KeyboardEvent) => void | boolean | Promise<void>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Optional: only active when this returns true.
|
|
69
|
+
* Use for context-sensitive shortcuts.
|
|
70
|
+
*/
|
|
71
|
+
when?: () => boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* If true, don't call preventDefault() after handling.
|
|
75
|
+
* Useful for shortcuts that should also trigger browser behavior.
|
|
76
|
+
*/
|
|
77
|
+
allowDefault?: boolean;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Priority for conflict resolution (higher = checked first).
|
|
81
|
+
* Default is 0. Core shortcuts use 100+.
|
|
82
|
+
*/
|
|
83
|
+
priority?: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** User's custom shortcut overrides (persisted) */
|
|
87
|
+
interface ShortcutOverrides {
|
|
88
|
+
/** Action ID → array of shortcut strings (null = disabled slot) */
|
|
89
|
+
[actionId: string]: (string | null)[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Shortcut conflict info */
|
|
93
|
+
interface ShortcutConflict {
|
|
94
|
+
/** The conflicting shortcut string */
|
|
95
|
+
shortcut: string;
|
|
96
|
+
/** ID of the action that already has this shortcut */
|
|
97
|
+
existingActionId: string;
|
|
98
|
+
/** Label of the existing action */
|
|
99
|
+
existingActionLabel: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Section info for settings page organization */
|
|
103
|
+
interface ShortcutSection {
|
|
104
|
+
id: string;
|
|
105
|
+
label: string;
|
|
106
|
+
subsections: ShortcutSubsection[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface ShortcutSubsection {
|
|
110
|
+
id: string;
|
|
111
|
+
label: string;
|
|
112
|
+
shortcuts: ShortcutRegistration[];
|
|
113
|
+
}
|