@t-req/core 0.1.0 → 0.2.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/README.md +204 -14
- package/dist/client.d.ts +0 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/config/engine-options.d.ts +50 -0
- package/dist/config/engine-options.d.ts.map +1 -0
- package/dist/config/index.d.ts +7 -3
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +9 -2
- package/dist/config/index.js.map +23 -5
- package/dist/config/jsonc.d.ts +18 -0
- package/dist/config/jsonc.d.ts.map +1 -0
- package/dist/config/load.d.ts +13 -2
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/merge.d.ts +31 -5
- package/dist/config/merge.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +59 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/substitution.d.ts +25 -0
- package/dist/config/substitution.d.ts.map +1 -0
- package/dist/config/types.d.ts +74 -6
- package/dist/config/types.d.ts.map +1 -1
- package/dist/cookies/persistence.d.ts +48 -0
- package/dist/cookies/persistence.d.ts.map +1 -0
- package/dist/cookies/persistence.js +4 -0
- package/dist/cookies/persistence.js.map +10 -0
- package/dist/cookies.js +5 -5
- package/dist/cookies.js.map +2 -2
- package/dist/engine/engine.d.ts +3 -4
- package/dist/engine/engine.d.ts.map +1 -1
- package/dist/engine/index.js +4 -4
- package/dist/engine/index.js.map +4 -4
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +21 -7
- package/dist/interpolate.d.ts.map +1 -1
- package/dist/plugin/define.d.ts +65 -0
- package/dist/plugin/define.d.ts.map +1 -0
- package/dist/plugin/index.d.ts +7 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +8 -0
- package/dist/plugin/index.js.map +22 -0
- package/dist/plugin/loader.d.ts +69 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugin/manager.d.ts +186 -0
- package/dist/plugin/manager.d.ts.map +1 -0
- package/dist/plugin/permissions.d.ts +33 -0
- package/dist/plugin/permissions.d.ts.map +1 -0
- package/dist/plugin/subprocess.d.ts +100 -0
- package/dist/plugin/subprocess.d.ts.map +1 -0
- package/dist/plugin/types.d.ts +668 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/resolver/command.d.ts +19 -0
- package/dist/resolver/command.d.ts.map +1 -0
- package/dist/resolver/index.d.ts +2 -0
- package/dist/resolver/index.d.ts.map +1 -0
- package/dist/resolver/index.js +5 -0
- package/dist/resolver/index.js.map +10 -0
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/index.js.map +2 -2
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/server-client.d.ts +50 -0
- package/dist/server-client.d.ts.map +1 -0
- package/dist/server-metadata.d.ts +13 -0
- package/dist/server-metadata.d.ts.map +1 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +20 -5
|
@@ -0,0 +1,668 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { EngineEvent } from '../runtime/types';
|
|
3
|
+
import type { ParsedRequest } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Permissions that plugins can request and users can restrict.
|
|
6
|
+
*/
|
|
7
|
+
export type PluginPermission = 'secrets' | 'network' | 'filesystem' | 'env' | 'subprocess' | 'enterprise';
|
|
8
|
+
/**
|
|
9
|
+
* Enterprise context provided by @t-req/enterprise package.
|
|
10
|
+
* Contains organization, user, and session information for enterprise features.
|
|
11
|
+
*/
|
|
12
|
+
export interface EnterpriseContext {
|
|
13
|
+
org: {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
plan: 'team' | 'enterprise';
|
|
17
|
+
};
|
|
18
|
+
user: {
|
|
19
|
+
id: string;
|
|
20
|
+
email: string;
|
|
21
|
+
roles: string[];
|
|
22
|
+
permissions: string[];
|
|
23
|
+
};
|
|
24
|
+
team?: {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
28
|
+
session: {
|
|
29
|
+
id: string;
|
|
30
|
+
startedAt: Date;
|
|
31
|
+
source: 'web' | 'desktop' | 'cli' | 'api';
|
|
32
|
+
token?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Events emitted by the plugin system.
|
|
37
|
+
* All plugin event types are prefixed with 'plugin' for easy discrimination.
|
|
38
|
+
*/
|
|
39
|
+
export type PluginEvent = {
|
|
40
|
+
type: 'pluginLoaded';
|
|
41
|
+
name: string;
|
|
42
|
+
version?: string;
|
|
43
|
+
source: 'npm' | 'file' | 'inline' | 'subprocess';
|
|
44
|
+
} | {
|
|
45
|
+
type: 'pluginInitialized';
|
|
46
|
+
name: string;
|
|
47
|
+
durationMs: number;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'pluginHookStarted';
|
|
50
|
+
name: string;
|
|
51
|
+
hook: string;
|
|
52
|
+
ctx: HookContext;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'pluginHookFinished';
|
|
55
|
+
name: string;
|
|
56
|
+
hook: string;
|
|
57
|
+
durationMs: number;
|
|
58
|
+
modified: boolean;
|
|
59
|
+
ctx: HookContext;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'pluginResolverCalled';
|
|
62
|
+
name: string;
|
|
63
|
+
resolver: string;
|
|
64
|
+
durationMs: number;
|
|
65
|
+
} | {
|
|
66
|
+
type: 'pluginError';
|
|
67
|
+
name: string;
|
|
68
|
+
stage: 'load' | 'setup' | 'hook' | 'resolver' | 'teardown';
|
|
69
|
+
hook?: string;
|
|
70
|
+
message: string;
|
|
71
|
+
recoverable: boolean;
|
|
72
|
+
} | {
|
|
73
|
+
type: 'pluginTeardown';
|
|
74
|
+
name: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Combined event type for unified event handling.
|
|
78
|
+
* Consumers can discriminate by checking if type starts with 'plugin'.
|
|
79
|
+
*/
|
|
80
|
+
export type CombinedEvent = EngineEvent | PluginEvent;
|
|
81
|
+
/**
|
|
82
|
+
* Event sink that accepts both engine and plugin events.
|
|
83
|
+
*/
|
|
84
|
+
export type CombinedEventSink = (event: CombinedEvent) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Signal to retry a request from response.after or error hooks.
|
|
87
|
+
*/
|
|
88
|
+
export interface RetrySignal {
|
|
89
|
+
/** Delay before retry in milliseconds */
|
|
90
|
+
delayMs: number;
|
|
91
|
+
/** Optional reason for logging/debugging */
|
|
92
|
+
reason?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Context available to all hooks.
|
|
96
|
+
*/
|
|
97
|
+
export interface HookContext {
|
|
98
|
+
/** Current retry attempt (0 for first try) */
|
|
99
|
+
retries: number;
|
|
100
|
+
/** Maximum retries allowed */
|
|
101
|
+
maxRetries: number;
|
|
102
|
+
/** Current session state */
|
|
103
|
+
session: SessionState;
|
|
104
|
+
/** All resolved variables */
|
|
105
|
+
variables: Record<string, unknown>;
|
|
106
|
+
/** Resolved configuration */
|
|
107
|
+
config: ResolvedPluginConfig;
|
|
108
|
+
/** Project root directory */
|
|
109
|
+
projectRoot: string;
|
|
110
|
+
/** Enterprise context (populated by @t-req/enterprise, undefined in OSS) */
|
|
111
|
+
enterprise?: EnterpriseContext;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Session state for the current execution.
|
|
115
|
+
*/
|
|
116
|
+
export interface SessionState {
|
|
117
|
+
/** Unique session ID */
|
|
118
|
+
id: string;
|
|
119
|
+
/** Session-scoped variables that persist across requests */
|
|
120
|
+
variables: Record<string, unknown>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Resolved plugin configuration (subset of ResolvedConfig).
|
|
124
|
+
*/
|
|
125
|
+
export interface ResolvedPluginConfig {
|
|
126
|
+
projectRoot: string;
|
|
127
|
+
variables: Record<string, unknown>;
|
|
128
|
+
security: {
|
|
129
|
+
allowExternalFiles: boolean;
|
|
130
|
+
allowPluginsOutsideProject: boolean;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Timing breakdown for request execution.
|
|
135
|
+
*/
|
|
136
|
+
export interface TimingInfo {
|
|
137
|
+
/** Total time from start to finish in ms */
|
|
138
|
+
total: number;
|
|
139
|
+
/** DNS lookup time in ms */
|
|
140
|
+
dns?: number;
|
|
141
|
+
/** TLS handshake time in ms */
|
|
142
|
+
tls?: number;
|
|
143
|
+
/** Time to first byte in ms */
|
|
144
|
+
ttfb?: number;
|
|
145
|
+
/** Time to download response in ms */
|
|
146
|
+
download?: number;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Parsed HTTP file representation.
|
|
150
|
+
*/
|
|
151
|
+
export interface ParsedHttpFile {
|
|
152
|
+
/** File path */
|
|
153
|
+
path: string;
|
|
154
|
+
/** Parsed requests from the file */
|
|
155
|
+
requests: ParsedRequest[];
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Input for parse.after hook.
|
|
159
|
+
*/
|
|
160
|
+
export interface ParseInput {
|
|
161
|
+
/** Parsed file data */
|
|
162
|
+
file: ParsedHttpFile;
|
|
163
|
+
/** File path */
|
|
164
|
+
path: string;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Output for parse.after hook.
|
|
168
|
+
*/
|
|
169
|
+
export interface ParseOutput {
|
|
170
|
+
/** Mutable - modify parsed file */
|
|
171
|
+
file: ParsedHttpFile;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Request object before variable interpolation.
|
|
175
|
+
*/
|
|
176
|
+
export interface ExecuteRequestInput {
|
|
177
|
+
method: string;
|
|
178
|
+
url: string;
|
|
179
|
+
headers: Record<string, string>;
|
|
180
|
+
body?: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Input for request.before hook.
|
|
184
|
+
*/
|
|
185
|
+
export interface RequestInput {
|
|
186
|
+
/** Request before interpolation */
|
|
187
|
+
request: ExecuteRequestInput;
|
|
188
|
+
/** Variables available for interpolation */
|
|
189
|
+
variables: Record<string, unknown>;
|
|
190
|
+
/** Hook context */
|
|
191
|
+
ctx: HookContext;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Output for request.before hook.
|
|
195
|
+
*/
|
|
196
|
+
export interface RequestOutput {
|
|
197
|
+
/** Mutable - modify request */
|
|
198
|
+
request: ExecuteRequestInput;
|
|
199
|
+
/** Set to true to skip this request */
|
|
200
|
+
skip?: boolean;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Request object after variable interpolation (ready for signing).
|
|
204
|
+
*/
|
|
205
|
+
export interface CompiledRequest {
|
|
206
|
+
method: string;
|
|
207
|
+
/** Final URL with variables interpolated */
|
|
208
|
+
url: string;
|
|
209
|
+
/** All headers with variables interpolated */
|
|
210
|
+
headers: Record<string, string>;
|
|
211
|
+
/** Body with variables interpolated (can be any valid body type) */
|
|
212
|
+
body?: string | Buffer | ArrayBuffer | FormData | URLSearchParams;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Input for request.compiled hook.
|
|
216
|
+
*/
|
|
217
|
+
export interface CompiledInput {
|
|
218
|
+
/** Request after interpolation */
|
|
219
|
+
request: CompiledRequest;
|
|
220
|
+
/** Variables used for interpolation */
|
|
221
|
+
variables: Record<string, unknown>;
|
|
222
|
+
/** Hook context */
|
|
223
|
+
ctx: HookContext;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Output for request.compiled hook.
|
|
227
|
+
*/
|
|
228
|
+
export interface CompiledOutput {
|
|
229
|
+
/** Mutable - modify compiled request (for signing, final header additions) */
|
|
230
|
+
request: CompiledRequest;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Input for request.after hook (read-only observation before fetch).
|
|
234
|
+
*/
|
|
235
|
+
export interface RequestAfterInput {
|
|
236
|
+
/** Read-only snapshot of final request */
|
|
237
|
+
request: CompiledRequest;
|
|
238
|
+
/** Hook context */
|
|
239
|
+
ctx: HookContext;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Input for response.after hook.
|
|
243
|
+
*/
|
|
244
|
+
export interface ResponseInput {
|
|
245
|
+
/** Original request */
|
|
246
|
+
request: CompiledRequest;
|
|
247
|
+
/** Response object (immutable, stream-based) */
|
|
248
|
+
response: Response;
|
|
249
|
+
/** Timing information */
|
|
250
|
+
timing: TimingInfo;
|
|
251
|
+
/** Hook context */
|
|
252
|
+
ctx: HookContext;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Output for response.after hook.
|
|
256
|
+
* All response modifications are expressed via these fields.
|
|
257
|
+
*/
|
|
258
|
+
export interface ResponseOutput {
|
|
259
|
+
/** Override status code */
|
|
260
|
+
status?: number;
|
|
261
|
+
/** Override status text */
|
|
262
|
+
statusText?: string;
|
|
263
|
+
/** Override/add headers (shallow merge) */
|
|
264
|
+
headers?: Record<string, string>;
|
|
265
|
+
/** Override body (if you read input.response body, you MUST set this) */
|
|
266
|
+
body?: string | Buffer | ReadableStream;
|
|
267
|
+
/** Signal retry */
|
|
268
|
+
retry?: RetrySignal;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Input for error hook.
|
|
272
|
+
*/
|
|
273
|
+
export interface ErrorInput {
|
|
274
|
+
/** Original request */
|
|
275
|
+
request: CompiledRequest;
|
|
276
|
+
/** Error that occurred */
|
|
277
|
+
error: Error & {
|
|
278
|
+
code?: string;
|
|
279
|
+
};
|
|
280
|
+
/** Hook context */
|
|
281
|
+
ctx: HookContext;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Output for error hook.
|
|
285
|
+
*/
|
|
286
|
+
export interface ErrorOutput {
|
|
287
|
+
/** Mutable - can wrap error */
|
|
288
|
+
error: Error;
|
|
289
|
+
/** Signal retry */
|
|
290
|
+
retry?: RetrySignal;
|
|
291
|
+
/** Don't throw the error */
|
|
292
|
+
suppress?: boolean;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* All available plugin hooks.
|
|
296
|
+
*/
|
|
297
|
+
export interface PluginHooks {
|
|
298
|
+
/**
|
|
299
|
+
* Called after parsing a .http file.
|
|
300
|
+
* Allows transforming the AST.
|
|
301
|
+
*/
|
|
302
|
+
'parse.after'?: (input: ParseInput, output: ParseOutput) => Promise<void> | void;
|
|
303
|
+
/**
|
|
304
|
+
* Called before variable interpolation.
|
|
305
|
+
* Allows early request modification (add headers, change URL).
|
|
306
|
+
*/
|
|
307
|
+
'request.before'?: (input: RequestInput, output: RequestOutput) => Promise<void> | void;
|
|
308
|
+
/**
|
|
309
|
+
* Called after variable interpolation.
|
|
310
|
+
* Allows final request modification (signing).
|
|
311
|
+
*/
|
|
312
|
+
'request.compiled'?: (input: CompiledInput, output: CompiledOutput) => Promise<void> | void;
|
|
313
|
+
/**
|
|
314
|
+
* Called immediately before fetch.
|
|
315
|
+
* Read-only observation for logging, metrics, audit.
|
|
316
|
+
*/
|
|
317
|
+
'request.after'?: (input: RequestAfterInput) => Promise<void> | void;
|
|
318
|
+
/**
|
|
319
|
+
* Called after receiving response.
|
|
320
|
+
* Allows response processing and retry signaling.
|
|
321
|
+
*/
|
|
322
|
+
'response.after'?: (input: ResponseInput, output: ResponseOutput) => Promise<void> | void;
|
|
323
|
+
/**
|
|
324
|
+
* Called when an error occurs.
|
|
325
|
+
* Allows error handling and retry signaling.
|
|
326
|
+
*/
|
|
327
|
+
error?: (input: ErrorInput, output: ErrorOutput) => Promise<void> | void;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Context provided to plugin commands.
|
|
331
|
+
*/
|
|
332
|
+
export interface CommandContext {
|
|
333
|
+
/** Command arguments */
|
|
334
|
+
args: string[];
|
|
335
|
+
/** Command flags */
|
|
336
|
+
flags: Record<string, string | boolean>;
|
|
337
|
+
/** Read a file as text */
|
|
338
|
+
readFile: (path: string) => Promise<string>;
|
|
339
|
+
/** Write content to a file */
|
|
340
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
341
|
+
/** Write requests to an .http file */
|
|
342
|
+
writeHttpFile: (name: string, requests: RequestDefinition[]) => Promise<void>;
|
|
343
|
+
/** Parse a collection of .http files */
|
|
344
|
+
parseCollection: (path?: string) => Promise<Collection>;
|
|
345
|
+
/** Parse a single .http file */
|
|
346
|
+
parseHttpFile: (path: string) => Promise<ParsedHttpFile>;
|
|
347
|
+
/** Run a request from a file */
|
|
348
|
+
run: (path: string, variables?: Record<string, unknown>) => Promise<Response>;
|
|
349
|
+
/** Log a message */
|
|
350
|
+
log: (message: string) => void;
|
|
351
|
+
/** Log a warning */
|
|
352
|
+
warn: (message: string) => void;
|
|
353
|
+
/** Log an error */
|
|
354
|
+
error: (message: string) => void;
|
|
355
|
+
/** Display tabular data */
|
|
356
|
+
table: (data: unknown[]) => void;
|
|
357
|
+
/** Output JSON */
|
|
358
|
+
json: (data: unknown) => void;
|
|
359
|
+
/** Exit with code */
|
|
360
|
+
exit: (code?: number) => never;
|
|
361
|
+
/** Resolved configuration */
|
|
362
|
+
config: ResolvedPluginConfig;
|
|
363
|
+
/** Current working directory */
|
|
364
|
+
cwd: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Request definition for writeHttpFile.
|
|
368
|
+
*/
|
|
369
|
+
export interface RequestDefinition {
|
|
370
|
+
name?: string;
|
|
371
|
+
method: string;
|
|
372
|
+
url: string;
|
|
373
|
+
headers?: Record<string, string>;
|
|
374
|
+
body?: string;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Collection of parsed .http files.
|
|
378
|
+
*/
|
|
379
|
+
export interface Collection {
|
|
380
|
+
files: ParsedHttpFile[];
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Command handler function.
|
|
384
|
+
*/
|
|
385
|
+
export type CommandHandler = (ctx: CommandContext) => Promise<void> | void;
|
|
386
|
+
/**
|
|
387
|
+
* Request/response pair for middleware.
|
|
388
|
+
*/
|
|
389
|
+
export interface MiddlewareRequest {
|
|
390
|
+
method: string;
|
|
391
|
+
url: string;
|
|
392
|
+
headers: Record<string, string>;
|
|
393
|
+
body?: Buffer | string;
|
|
394
|
+
}
|
|
395
|
+
export interface MiddlewareResponse {
|
|
396
|
+
statusCode: number;
|
|
397
|
+
headers: Record<string, string>;
|
|
398
|
+
setHeader: (name: string, value: string) => void;
|
|
399
|
+
end: (body?: string | Buffer) => void;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Middleware function for treq serve.
|
|
403
|
+
*/
|
|
404
|
+
export type MiddlewareFunction = (req: MiddlewareRequest, res: MiddlewareResponse, next: () => Promise<void>) => Promise<void> | void;
|
|
405
|
+
/**
|
|
406
|
+
* Schema type for tool arguments.
|
|
407
|
+
* Compatible with Zod schemas.
|
|
408
|
+
*/
|
|
409
|
+
export type ToolSchema<T = unknown> = z.ZodType<T>;
|
|
410
|
+
/**
|
|
411
|
+
* Tool context for execute function.
|
|
412
|
+
*/
|
|
413
|
+
export interface ToolContext {
|
|
414
|
+
/** Response from the request (if available) */
|
|
415
|
+
response?: Response;
|
|
416
|
+
/** Hook context */
|
|
417
|
+
ctx: HookContext;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Tool definition with Zod schema support.
|
|
421
|
+
*/
|
|
422
|
+
export interface ToolDefinition<TArgs = Record<string, unknown>> {
|
|
423
|
+
/** Tool description */
|
|
424
|
+
description: string;
|
|
425
|
+
/** Argument schemas */
|
|
426
|
+
args: z.ZodType<TArgs>;
|
|
427
|
+
/** Execute function */
|
|
428
|
+
execute: (args: TArgs, ctx: ToolContext) => Promise<string> | string;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Context provided to plugin setup function.
|
|
432
|
+
*/
|
|
433
|
+
export interface PluginContext {
|
|
434
|
+
/** Project root directory */
|
|
435
|
+
projectRoot: string;
|
|
436
|
+
/** Resolved configuration */
|
|
437
|
+
config: ResolvedPluginConfig;
|
|
438
|
+
/** Logger */
|
|
439
|
+
log: {
|
|
440
|
+
debug: (message: string) => void;
|
|
441
|
+
info: (message: string) => void;
|
|
442
|
+
warn: (message: string) => void;
|
|
443
|
+
error: (message: string) => void;
|
|
444
|
+
};
|
|
445
|
+
/** Secrets API (requires 'secrets' permission) */
|
|
446
|
+
secrets?: {
|
|
447
|
+
get: (key: string) => Promise<string | undefined>;
|
|
448
|
+
};
|
|
449
|
+
/** Fetch function (requires 'network' permission) */
|
|
450
|
+
fetch?: typeof fetch;
|
|
451
|
+
/** File system API (requires 'filesystem' permission) */
|
|
452
|
+
fs?: {
|
|
453
|
+
readFile: (path: string) => Promise<string>;
|
|
454
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
455
|
+
};
|
|
456
|
+
/** Environment variables (requires 'env' permission) */
|
|
457
|
+
env?: Record<string, string | undefined>;
|
|
458
|
+
/** Spawn function (requires 'subprocess' permission) */
|
|
459
|
+
spawn?: (command: string, args: string[]) => Promise<{
|
|
460
|
+
stdout: string;
|
|
461
|
+
stderr: string;
|
|
462
|
+
}>;
|
|
463
|
+
/** Enterprise context (requires 'enterprise' permission) */
|
|
464
|
+
enterprise?: EnterpriseContext;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Resolver function provided by plugins.
|
|
468
|
+
* Receives resolver context for permission-gated operations.
|
|
469
|
+
*/
|
|
470
|
+
export type PluginResolver = (...args: string[]) => string | Promise<string>;
|
|
471
|
+
/**
|
|
472
|
+
* Resolver with context access.
|
|
473
|
+
*/
|
|
474
|
+
export interface ResolverWithContext {
|
|
475
|
+
/** Resolver function */
|
|
476
|
+
resolve: (...args: string[]) => string | Promise<string>;
|
|
477
|
+
/** Required permissions */
|
|
478
|
+
permissions?: PluginPermission[];
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Main plugin interface.
|
|
482
|
+
* Plugins are functions that return this interface or the interface directly.
|
|
483
|
+
*/
|
|
484
|
+
export interface TreqPlugin {
|
|
485
|
+
/** Plugin name (unique identifier) */
|
|
486
|
+
name: string;
|
|
487
|
+
/**
|
|
488
|
+
* Instance ID for multiple instances of the same plugin.
|
|
489
|
+
* Plugins are identified as `${name}#${instanceId}`.
|
|
490
|
+
* @default 'default'
|
|
491
|
+
*/
|
|
492
|
+
instanceId?: string;
|
|
493
|
+
/** Plugin version */
|
|
494
|
+
version?: string;
|
|
495
|
+
/** Required permissions */
|
|
496
|
+
permissions?: PluginPermission[];
|
|
497
|
+
/** Custom resolvers for variable interpolation */
|
|
498
|
+
resolvers?: Record<string, PluginResolver>;
|
|
499
|
+
/** Lifecycle hooks */
|
|
500
|
+
hooks?: PluginHooks;
|
|
501
|
+
/**
|
|
502
|
+
* Event subscription (fire-and-forget observation).
|
|
503
|
+
* Receives engine events for analytics, logging, etc.
|
|
504
|
+
*/
|
|
505
|
+
event?: (input: {
|
|
506
|
+
event: EngineEvent;
|
|
507
|
+
}) => Promise<void> | void;
|
|
508
|
+
/** CLI commands */
|
|
509
|
+
commands?: Record<string, CommandHandler>;
|
|
510
|
+
/** Server middleware (for treq serve) */
|
|
511
|
+
middleware?: MiddlewareFunction[];
|
|
512
|
+
/** Custom tools with schemas */
|
|
513
|
+
tools?: Record<string, ToolDefinition>;
|
|
514
|
+
/** Initialize plugin with context */
|
|
515
|
+
setup?: (ctx: PluginContext) => Promise<void> | void;
|
|
516
|
+
/** Cleanup resources */
|
|
517
|
+
teardown?: () => Promise<void> | void;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Plugin factory function type.
|
|
521
|
+
*/
|
|
522
|
+
export type PluginFactory<TOptions = void> = TOptions extends void ? () => TreqPlugin : (options: TOptions) => TreqPlugin;
|
|
523
|
+
/**
|
|
524
|
+
* Plugin reference in config (string for npm/file, tuple for npm with options).
|
|
525
|
+
*/
|
|
526
|
+
export type PluginConfigRef = string | [string, Record<string, unknown>] | TreqPlugin | SubprocessPluginConfig;
|
|
527
|
+
/**
|
|
528
|
+
* Configuration for subprocess plugins.
|
|
529
|
+
*/
|
|
530
|
+
export interface SubprocessPluginConfig {
|
|
531
|
+
/** Command to spawn [executable, ...args] */
|
|
532
|
+
command: string[];
|
|
533
|
+
/** Plugin-specific config (sent in init) */
|
|
534
|
+
config?: unknown;
|
|
535
|
+
/** Per-request timeout in ms */
|
|
536
|
+
timeoutMs?: number;
|
|
537
|
+
/** Init timeout in ms */
|
|
538
|
+
startupTimeoutMs?: number;
|
|
539
|
+
/** Auto-restart limit */
|
|
540
|
+
maxRestarts?: number;
|
|
541
|
+
/** Shutdown grace period in ms */
|
|
542
|
+
gracePeriodMs?: number;
|
|
543
|
+
/** Additional environment variables */
|
|
544
|
+
env?: Record<string, string>;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Plugin permissions configuration.
|
|
548
|
+
*/
|
|
549
|
+
export interface PluginPermissionsConfig {
|
|
550
|
+
/** Default permissions for plugins without explicit config */
|
|
551
|
+
default?: PluginPermission[];
|
|
552
|
+
/** Per-plugin permission overrides */
|
|
553
|
+
[pluginName: string]: PluginPermission[] | undefined;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Init request from t-req to plugin.
|
|
557
|
+
*/
|
|
558
|
+
export interface SubprocessInitRequest {
|
|
559
|
+
id: string;
|
|
560
|
+
type: 'init';
|
|
561
|
+
protocolVersion: number;
|
|
562
|
+
config: unknown;
|
|
563
|
+
projectRoot: string;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Resolver request from t-req to plugin.
|
|
567
|
+
*/
|
|
568
|
+
export interface SubprocessResolverRequest {
|
|
569
|
+
id: string;
|
|
570
|
+
type: 'resolver';
|
|
571
|
+
name: string;
|
|
572
|
+
args: string[];
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Hook request from t-req to plugin.
|
|
576
|
+
*/
|
|
577
|
+
export interface SubprocessHookRequest {
|
|
578
|
+
id: string;
|
|
579
|
+
type: 'hook';
|
|
580
|
+
name: keyof PluginHooks;
|
|
581
|
+
input: Record<string, unknown>;
|
|
582
|
+
output: Record<string, unknown>;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Event notification from t-req to plugin (no response expected).
|
|
586
|
+
*/
|
|
587
|
+
export interface SubprocessEventNotification {
|
|
588
|
+
type: 'event';
|
|
589
|
+
event: EngineEvent;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Shutdown request from t-req to plugin.
|
|
593
|
+
*/
|
|
594
|
+
export interface SubprocessShutdownRequest {
|
|
595
|
+
type: 'shutdown';
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* All subprocess request types.
|
|
599
|
+
*/
|
|
600
|
+
export type SubprocessRequest = SubprocessInitRequest | SubprocessResolverRequest | SubprocessHookRequest | SubprocessEventNotification | SubprocessShutdownRequest;
|
|
601
|
+
/**
|
|
602
|
+
* Init response from plugin to t-req.
|
|
603
|
+
*/
|
|
604
|
+
export interface SubprocessInitResponse {
|
|
605
|
+
id: string;
|
|
606
|
+
type: 'response';
|
|
607
|
+
result: {
|
|
608
|
+
name: string;
|
|
609
|
+
version?: string;
|
|
610
|
+
protocolVersion: number;
|
|
611
|
+
capabilities: ('hooks' | 'resolvers' | 'commands')[];
|
|
612
|
+
hooks?: string[];
|
|
613
|
+
resolvers?: string[];
|
|
614
|
+
commands?: string[];
|
|
615
|
+
permissions?: PluginPermission[];
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Resolver response from plugin to t-req.
|
|
620
|
+
*/
|
|
621
|
+
export interface SubprocessResolverResponse {
|
|
622
|
+
id: string;
|
|
623
|
+
type: 'response';
|
|
624
|
+
result: {
|
|
625
|
+
value: string;
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Hook response from plugin to t-req.
|
|
630
|
+
*/
|
|
631
|
+
export interface SubprocessHookResponse {
|
|
632
|
+
id: string;
|
|
633
|
+
type: 'response';
|
|
634
|
+
result: {
|
|
635
|
+
output: Record<string, unknown>;
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Error response from plugin to t-req.
|
|
640
|
+
*/
|
|
641
|
+
export interface SubprocessErrorResponse {
|
|
642
|
+
id: string;
|
|
643
|
+
type: 'error';
|
|
644
|
+
error: {
|
|
645
|
+
message: string;
|
|
646
|
+
code?: string;
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* All subprocess response types.
|
|
651
|
+
*/
|
|
652
|
+
export type SubprocessResponse = SubprocessInitResponse | SubprocessResolverResponse | SubprocessHookResponse | SubprocessErrorResponse;
|
|
653
|
+
/**
|
|
654
|
+
* Internal representation of a loaded plugin.
|
|
655
|
+
*/
|
|
656
|
+
export interface LoadedPlugin {
|
|
657
|
+
/** Plugin definition */
|
|
658
|
+
plugin: TreqPlugin;
|
|
659
|
+
/** Unique identifier: name#instanceId */
|
|
660
|
+
id: string;
|
|
661
|
+
/** Source type */
|
|
662
|
+
source: 'npm' | 'file' | 'inline' | 'subprocess';
|
|
663
|
+
/** Granted permissions */
|
|
664
|
+
permissions: PluginPermission[];
|
|
665
|
+
/** Setup has been called */
|
|
666
|
+
initialized: boolean;
|
|
667
|
+
}
|
|
668
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAM9C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,SAAS,GACT,YAAY,GACZ,KAAK,GACL,YAAY,GAC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