proteum 2.1.0 → 2.1.2

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.
Files changed (95) hide show
  1. package/AGENTS.md +44 -98
  2. package/README.md +143 -10
  3. package/agents/framework/AGENTS.md +146 -886
  4. package/agents/project/AGENTS.md +73 -127
  5. package/agents/project/client/AGENTS.md +22 -93
  6. package/agents/project/client/pages/AGENTS.md +24 -26
  7. package/agents/project/server/routes/AGENTS.md +10 -8
  8. package/agents/project/server/services/AGENTS.md +22 -159
  9. package/agents/project/tests/AGENTS.md +11 -8
  10. package/cli/app/config.ts +7 -20
  11. package/cli/bin.js +8 -0
  12. package/cli/commands/command.ts +243 -0
  13. package/cli/commands/commandLocalRunner.js +198 -0
  14. package/cli/commands/create.ts +5 -0
  15. package/cli/commands/deploy/web.ts +1 -2
  16. package/cli/commands/dev.ts +98 -2
  17. package/cli/commands/doctor.ts +8 -74
  18. package/cli/commands/explain.ts +8 -186
  19. package/cli/commands/init.ts +2 -94
  20. package/cli/commands/trace.ts +228 -0
  21. package/cli/compiler/artifacts/commands.ts +217 -0
  22. package/cli/compiler/artifacts/manifest.ts +35 -21
  23. package/cli/compiler/artifacts/services.ts +300 -1
  24. package/cli/compiler/client/index.ts +43 -8
  25. package/cli/compiler/common/commands.ts +175 -0
  26. package/cli/compiler/common/index.ts +1 -1
  27. package/cli/compiler/common/proteumManifest.ts +15 -114
  28. package/cli/compiler/index.ts +25 -2
  29. package/cli/compiler/server/index.ts +31 -6
  30. package/cli/index.ts +1 -4
  31. package/cli/paths.ts +16 -1
  32. package/cli/presentation/commands.ts +104 -14
  33. package/cli/presentation/devSession.ts +22 -3
  34. package/cli/presentation/proteum_logo_400x400_square_icon.txt +400 -0
  35. package/cli/runtime/commands.ts +121 -4
  36. package/cli/scaffold/index.ts +720 -0
  37. package/cli/scaffold/templates.ts +344 -0
  38. package/cli/scaffold/types.ts +26 -0
  39. package/cli/tsconfig.json +4 -1
  40. package/cli/utils/check.ts +1 -1
  41. package/client/app/component.tsx +13 -9
  42. package/client/dev/profiler/index.tsx +2511 -0
  43. package/client/dev/profiler/noop.tsx +5 -0
  44. package/client/dev/profiler/runtime.noop.ts +116 -0
  45. package/client/dev/profiler/runtime.ts +840 -0
  46. package/client/services/router/components/router.tsx +30 -2
  47. package/client/services/router/index.tsx +27 -3
  48. package/client/services/router/request/api.ts +133 -17
  49. package/commands/proteum/diagnostics.ts +11 -0
  50. package/common/dev/commands.ts +50 -0
  51. package/common/dev/diagnostics.ts +298 -0
  52. package/common/dev/profiler.ts +92 -0
  53. package/common/dev/proteumManifest.ts +135 -0
  54. package/common/dev/requestTrace.ts +115 -0
  55. package/common/env/proteumEnv.ts +284 -0
  56. package/common/router/index.ts +4 -22
  57. package/docs/dev-commands.md +93 -0
  58. package/docs/diagnostics.md +88 -0
  59. package/docs/request-tracing.md +132 -0
  60. package/eslint.js +11 -6
  61. package/package.json +3 -3
  62. package/server/app/commands.ts +35 -370
  63. package/server/app/commandsManager.ts +393 -0
  64. package/server/app/container/config.ts +11 -49
  65. package/server/app/container/console/index.ts +2 -3
  66. package/server/app/container/index.ts +5 -2
  67. package/server/app/container/trace/index.ts +364 -0
  68. package/server/app/devCommands.ts +192 -0
  69. package/server/app/devDiagnostics.ts +53 -0
  70. package/server/app/index.ts +29 -6
  71. package/server/index.ts +0 -1
  72. package/server/services/auth/index.ts +525 -61
  73. package/server/services/auth/router/index.ts +106 -7
  74. package/server/services/cron/CronTask.ts +73 -5
  75. package/server/services/cron/index.ts +34 -11
  76. package/server/services/fetch/index.ts +3 -10
  77. package/server/services/prisma/index.ts +66 -4
  78. package/server/services/router/http/index.ts +173 -6
  79. package/server/services/router/index.ts +200 -12
  80. package/server/services/router/request/api.ts +30 -1
  81. package/server/services/router/response/index.ts +83 -10
  82. package/server/services/router/response/page/document.tsx +16 -0
  83. package/server/services/router/response/page/index.tsx +27 -1
  84. package/skills/clean-project-code/SKILL.md +7 -2
  85. package/test-results/.last-run.json +4 -0
  86. package/types/aliases.d.ts +6 -0
  87. package/types/global/utils.d.ts +7 -14
  88. package/Rte.zip +0 -0
  89. package/agents/project/agents.md.zip +0 -0
  90. package/doc/TODO.md +0 -71
  91. package/doc/front/router.md +0 -27
  92. package/doc/workspace/workspace.png +0 -0
  93. package/doc/workspace/workspace2.png +0 -0
  94. package/doc/workspace/workspace_26.01.22.png +0 -0
  95. package/server/services/router/http/session.ts.old +0 -40
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ export default function DevProfilerNoop() {
4
+ return null;
5
+ }
@@ -0,0 +1,116 @@
1
+ import type {
2
+ TProfilerCronTask,
3
+ TProfilerNavigationSession,
4
+ TProfilerPanel,
5
+ TProfilerSessionTraceKind,
6
+ TProfilerUiState,
7
+ } from '@common/dev/profiler';
8
+ import type { TDevCommandDefinition, TDevCommandExecution } from '@common/dev/commands';
9
+ import type { TDoctorResponse } from '@common/dev/diagnostics';
10
+ import type { TProteumManifest } from '@common/dev/proteumManifest';
11
+
12
+ type TProfilerState = {
13
+ activePanel: TProfilerPanel;
14
+ commands: {
15
+ commands: TDevCommandDefinition[];
16
+ errorMessage?: string;
17
+ executions: { [path: string]: TDevCommandExecution };
18
+ lastLoadedAt?: string;
19
+ status: 'idle' | 'loading' | 'ready' | 'error';
20
+ };
21
+ cron: {
22
+ automaticExecution: boolean;
23
+ errorMessage?: string;
24
+ lastLoadedAt?: string;
25
+ status: 'idle' | 'loading' | 'ready' | 'error';
26
+ tasks: TProfilerCronTask[];
27
+ };
28
+ doctor: {
29
+ errorMessage?: string;
30
+ lastLoadedAt?: string;
31
+ response?: TDoctorResponse;
32
+ status: 'idle' | 'loading' | 'ready' | 'error';
33
+ };
34
+ explain: {
35
+ errorMessage?: string;
36
+ lastLoadedAt?: string;
37
+ manifest?: TProteumManifest;
38
+ status: 'idle' | 'loading' | 'ready' | 'error';
39
+ };
40
+ currentSessionId?: string;
41
+ selectedSessionId?: string;
42
+ sessions: TProfilerNavigationSession[];
43
+ uiState: TProfilerUiState;
44
+ };
45
+
46
+ const noopState: TProfilerState = {
47
+ activePanel: 'summary',
48
+ commands: {
49
+ commands: [],
50
+ executions: {},
51
+ status: 'idle',
52
+ },
53
+ cron: {
54
+ automaticExecution: false,
55
+ status: 'idle',
56
+ tasks: [],
57
+ },
58
+ doctor: {
59
+ status: 'idle',
60
+ },
61
+ explain: {
62
+ status: 'idle',
63
+ },
64
+ sessions: [],
65
+ uiState: 'minimized',
66
+ };
67
+
68
+ export const profilerRuntime = {
69
+ subscribe: (_listener: () => void) => () => undefined,
70
+ getState: () => noopState,
71
+ setUiState: (_nextState: TProfilerUiState) => undefined,
72
+ openPanel: (_panel: TProfilerPanel) => undefined,
73
+ selectSession: (_sessionId: string) => undefined,
74
+ refreshCommands: async () => undefined,
75
+ runCommand: async (_path: string) => undefined,
76
+ refreshCronTasks: async () => undefined,
77
+ runCronTask: async (_name: string) => undefined,
78
+ refreshDoctor: async () => undefined,
79
+ refreshExplain: async () => undefined,
80
+ ensureInitialSession: (_input: { path: string; requestId?: string; url: string }) => undefined,
81
+ markInitialHydrated: (_meta: { chunkId?: string; title?: string }) => undefined,
82
+ startNavigationSession: (_input: { path: string; url: string }) => undefined as string | undefined,
83
+ completeResolveStep: (_meta: { chunkId?: string; routeLabel?: string; sessionId?: string }) => undefined,
84
+ startChunkStep: (_chunkId: string, _sessionId?: string) => undefined as string | undefined,
85
+ finishStep: (
86
+ _stepId: string | undefined,
87
+ _status: 'completed' | 'error' = 'completed',
88
+ _errorMessage?: string,
89
+ ) => undefined,
90
+ startRenderStep: (_sessionId?: string) => undefined as string | undefined,
91
+ finishNavigation: (_meta: { chunkId?: string; routeLabel?: string; sessionId?: string; title?: string }) => undefined,
92
+ failNavigation: (_message: string, _sessionId?: string) => undefined,
93
+ startTrace: (
94
+ _kind: TProfilerSessionTraceKind,
95
+ _input: {
96
+ fetcherIds?: string[];
97
+ label: string;
98
+ method: string;
99
+ path: string;
100
+ requestId?: string;
101
+ sessionId?: string;
102
+ },
103
+ ) => undefined as { sessionId: string; traceId: string } | undefined,
104
+ completeTrace: (
105
+ _traceId: string | undefined,
106
+ _meta: { durationMs?: number; errorMessage?: string; status?: 'completed' | 'error' },
107
+ ) => undefined,
108
+ attachTraceByRequestId: async (
109
+ _sessionId: string | undefined,
110
+ _traceId: string | undefined,
111
+ _requestId: string | undefined,
112
+ ) => undefined,
113
+ getRequestHeaders: (_origin: string) => ({}),
114
+ };
115
+
116
+ export const readProfilerTraceRequestId = (_response: Response) => undefined;