proteum 2.1.1 → 2.1.3-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 +28 -6
- package/agents/framework/AGENTS.md +14 -1
- package/agents/project/AGENTS.md +3 -0
- package/cli/commands/command.ts +8 -0
- package/cli/commands/create.ts +5 -0
- package/cli/commands/dev.ts +2 -1
- package/cli/commands/init.ts +2 -94
- package/cli/commands/session.ts +254 -0
- package/cli/commands/sessionLocalRunner.js +188 -0
- package/cli/commands/trace.ts +8 -0
- package/cli/index.ts +1 -4
- package/cli/presentation/commands.ts +72 -10
- package/cli/presentation/devSession.ts +17 -3
- package/cli/presentation/proteum_logo_400x400_square_icon.txt +400 -0
- package/cli/runtime/commands.ts +89 -3
- package/cli/scaffold/index.ts +720 -0
- package/cli/scaffold/templates.ts +344 -0
- package/cli/scaffold/types.ts +26 -0
- package/client/dev/profiler/index.tsx +1410 -235
- package/common/dev/profiler.ts +1 -0
- package/common/dev/requestTrace.ts +10 -0
- package/common/dev/session.ts +24 -0
- package/docs/dev-commands.md +7 -0
- package/docs/diagnostics.md +88 -0
- package/docs/request-tracing.md +10 -0
- package/eslint.js +11 -6
- package/package.json +3 -2
- package/server/app/container/trace/index.ts +48 -0
- package/server/app/index.ts +2 -2
- package/server/index.ts +0 -1
- package/server/services/auth/index.ts +525 -61
- package/server/services/auth/router/index.ts +106 -7
- package/server/services/router/http/index.ts +108 -6
- package/server/services/router/response/index.ts +1 -0
package/cli/runtime/commands.ts
CHANGED
|
@@ -9,15 +9,71 @@ class InitCommand extends ProteumCommand {
|
|
|
9
9
|
|
|
10
10
|
public static usage = buildUsage('init');
|
|
11
11
|
|
|
12
|
-
public
|
|
12
|
+
public name = Option.String('--name', { description: 'Human-readable app name.' });
|
|
13
|
+
public description = Option.String('--description', { description: 'App description used in identity.yaml and package.json.' });
|
|
14
|
+
public identifier = Option.String('--identifier', { description: 'Application class and identity identifier.' });
|
|
15
|
+
public port = Option.String('--port', { description: 'Default local router port used in .env.' });
|
|
16
|
+
public url = Option.String('--url', { description: 'Default absolute URL used in .env.' });
|
|
17
|
+
public proteumVersion = Option.String('--proteum-version', {
|
|
18
|
+
description: 'Override the Proteum dependency written to package.json.',
|
|
19
|
+
});
|
|
20
|
+
public install = Option.Boolean('--install', false, { description: 'Run npm install after scaffolding.' });
|
|
21
|
+
public dryRun = Option.Boolean('--dry-run', false, { description: 'Print the scaffold plan without writing files.' });
|
|
22
|
+
public json = Option.Boolean('--json', false, { description: 'Print machine-readable scaffold output.' });
|
|
23
|
+
public force = Option.Boolean('--force', false, { description: 'Allow writing into a non-empty target directory.' });
|
|
24
|
+
public args = Option.Rest();
|
|
13
25
|
|
|
14
26
|
public async execute() {
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
const [directory = ''] = this.args;
|
|
28
|
+
|
|
29
|
+
this.setCliArgs({
|
|
30
|
+
directory,
|
|
31
|
+
name: this.name ?? '',
|
|
32
|
+
description: this.description ?? '',
|
|
33
|
+
identifier: this.identifier ?? '',
|
|
34
|
+
port: this.port ?? '',
|
|
35
|
+
url: this.url ?? '',
|
|
36
|
+
proteumVersion: this.proteumVersion ?? '',
|
|
37
|
+
install: this.install,
|
|
38
|
+
dryRun: this.dryRun,
|
|
39
|
+
json: this.json,
|
|
40
|
+
force: this.force,
|
|
41
|
+
});
|
|
17
42
|
await runCommandModule(() => import('../commands/init'));
|
|
18
43
|
}
|
|
19
44
|
}
|
|
20
45
|
|
|
46
|
+
class CreateCommand extends ProteumCommand {
|
|
47
|
+
public static paths = [['create']];
|
|
48
|
+
|
|
49
|
+
public static usage = buildUsage('create');
|
|
50
|
+
|
|
51
|
+
public route = Option.String('--route', { description: 'Explicit URL path used for page or route scaffolds.' });
|
|
52
|
+
public method = Option.String('--method', { description: 'Method name used for controller or command scaffolds.' });
|
|
53
|
+
public httpMethod = Option.String('--http-method', { description: 'HTTP verb used for route scaffolds.' });
|
|
54
|
+
public json = Option.Boolean('--json', false, { description: 'Print machine-readable scaffold output.' });
|
|
55
|
+
public dryRun = Option.Boolean('--dry-run', false, { description: 'Print the scaffold plan without writing files.' });
|
|
56
|
+
public force = Option.Boolean('--force', false, { description: 'Allow overwriting generated target files.' });
|
|
57
|
+
public args = Option.Rest();
|
|
58
|
+
|
|
59
|
+
public async execute() {
|
|
60
|
+
const [kind = '', target = ''] = this.args;
|
|
61
|
+
|
|
62
|
+
this.setCliArgs({
|
|
63
|
+
kind,
|
|
64
|
+
target,
|
|
65
|
+
route: this.route ?? '',
|
|
66
|
+
method: this.method ?? '',
|
|
67
|
+
httpMethod: this.httpMethod ?? '',
|
|
68
|
+
json: this.json,
|
|
69
|
+
dryRun: this.dryRun,
|
|
70
|
+
force: this.force,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
await runCommandModule(() => import('../commands/create'));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
21
77
|
class DevCommand extends ProteumCommand {
|
|
22
78
|
public static paths = [['dev']];
|
|
23
79
|
|
|
@@ -240,8 +296,35 @@ class CommandCommand extends ProteumCommand {
|
|
|
240
296
|
}
|
|
241
297
|
}
|
|
242
298
|
|
|
299
|
+
class SessionCommand extends ProteumCommand {
|
|
300
|
+
public static paths = [['session']];
|
|
301
|
+
|
|
302
|
+
public static usage = buildUsage('session');
|
|
303
|
+
|
|
304
|
+
public role = Option.String('--role', { description: 'Require the resolved user to have the given role.' });
|
|
305
|
+
public port = Option.String('--port', { description: 'Target an existing dev server on the given port.' });
|
|
306
|
+
public url = Option.String('--url', { description: 'Target an existing dev server at the given base URL.' });
|
|
307
|
+
public json = Option.Boolean('--json', false, { description: 'Print JSON output.' });
|
|
308
|
+
public args = Option.Rest();
|
|
309
|
+
|
|
310
|
+
public async execute() {
|
|
311
|
+
const [email = ''] = this.args;
|
|
312
|
+
|
|
313
|
+
this.setCliArgs({
|
|
314
|
+
email,
|
|
315
|
+
role: this.role ?? '',
|
|
316
|
+
port: this.port ?? '',
|
|
317
|
+
url: this.url ?? '',
|
|
318
|
+
json: this.json,
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
await runCommandModule(() => import('../commands/session'));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
243
325
|
export const registeredCommands = {
|
|
244
326
|
init: InitCommand,
|
|
327
|
+
create: CreateCommand,
|
|
245
328
|
dev: DevCommand,
|
|
246
329
|
refresh: RefreshCommand,
|
|
247
330
|
build: BuildCommand,
|
|
@@ -252,6 +335,7 @@ export const registeredCommands = {
|
|
|
252
335
|
explain: ExplainCommand,
|
|
253
336
|
trace: TraceCommand,
|
|
254
337
|
command: CommandCommand,
|
|
338
|
+
session: SessionCommand,
|
|
255
339
|
} as const;
|
|
256
340
|
|
|
257
341
|
export const createCli = (version: string) => {
|
|
@@ -265,6 +349,7 @@ export const createCli = (version: string) => {
|
|
|
265
349
|
clipanion.register(Builtins.VersionCommand);
|
|
266
350
|
clipanion.register(Builtins.DefinitionsCommand);
|
|
267
351
|
clipanion.register(InitCommand);
|
|
352
|
+
clipanion.register(CreateCommand);
|
|
268
353
|
clipanion.register(DevCommand);
|
|
269
354
|
clipanion.register(RefreshCommand);
|
|
270
355
|
clipanion.register(BuildCommand);
|
|
@@ -275,6 +360,7 @@ export const createCli = (version: string) => {
|
|
|
275
360
|
clipanion.register(ExplainCommand);
|
|
276
361
|
clipanion.register(TraceCommand);
|
|
277
362
|
clipanion.register(CommandCommand);
|
|
363
|
+
clipanion.register(SessionCommand);
|
|
278
364
|
|
|
279
365
|
return clipanion;
|
|
280
366
|
};
|