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.
- package/AGENTS.md +44 -98
- package/README.md +143 -10
- package/agents/framework/AGENTS.md +146 -886
- package/agents/project/AGENTS.md +73 -127
- package/agents/project/client/AGENTS.md +22 -93
- package/agents/project/client/pages/AGENTS.md +24 -26
- package/agents/project/server/routes/AGENTS.md +10 -8
- package/agents/project/server/services/AGENTS.md +22 -159
- package/agents/project/tests/AGENTS.md +11 -8
- package/cli/app/config.ts +7 -20
- package/cli/bin.js +8 -0
- package/cli/commands/command.ts +243 -0
- package/cli/commands/commandLocalRunner.js +198 -0
- package/cli/commands/create.ts +5 -0
- package/cli/commands/deploy/web.ts +1 -2
- package/cli/commands/dev.ts +98 -2
- package/cli/commands/doctor.ts +8 -74
- package/cli/commands/explain.ts +8 -186
- package/cli/commands/init.ts +2 -94
- package/cli/commands/trace.ts +228 -0
- package/cli/compiler/artifacts/commands.ts +217 -0
- package/cli/compiler/artifacts/manifest.ts +35 -21
- package/cli/compiler/artifacts/services.ts +300 -1
- package/cli/compiler/client/index.ts +43 -8
- package/cli/compiler/common/commands.ts +175 -0
- package/cli/compiler/common/index.ts +1 -1
- package/cli/compiler/common/proteumManifest.ts +15 -114
- package/cli/compiler/index.ts +25 -2
- package/cli/compiler/server/index.ts +31 -6
- package/cli/index.ts +1 -4
- package/cli/paths.ts +16 -1
- package/cli/presentation/commands.ts +104 -14
- package/cli/presentation/devSession.ts +22 -3
- package/cli/presentation/proteum_logo_400x400_square_icon.txt +400 -0
- package/cli/runtime/commands.ts +121 -4
- package/cli/scaffold/index.ts +720 -0
- package/cli/scaffold/templates.ts +344 -0
- package/cli/scaffold/types.ts +26 -0
- package/cli/tsconfig.json +4 -1
- package/cli/utils/check.ts +1 -1
- package/client/app/component.tsx +13 -9
- package/client/dev/profiler/index.tsx +2511 -0
- package/client/dev/profiler/noop.tsx +5 -0
- package/client/dev/profiler/runtime.noop.ts +116 -0
- package/client/dev/profiler/runtime.ts +840 -0
- package/client/services/router/components/router.tsx +30 -2
- package/client/services/router/index.tsx +27 -3
- package/client/services/router/request/api.ts +133 -17
- package/commands/proteum/diagnostics.ts +11 -0
- package/common/dev/commands.ts +50 -0
- package/common/dev/diagnostics.ts +298 -0
- package/common/dev/profiler.ts +92 -0
- package/common/dev/proteumManifest.ts +135 -0
- package/common/dev/requestTrace.ts +115 -0
- package/common/env/proteumEnv.ts +284 -0
- package/common/router/index.ts +4 -22
- package/docs/dev-commands.md +93 -0
- package/docs/diagnostics.md +88 -0
- package/docs/request-tracing.md +132 -0
- package/eslint.js +11 -6
- package/package.json +3 -3
- package/server/app/commands.ts +35 -370
- package/server/app/commandsManager.ts +393 -0
- package/server/app/container/config.ts +11 -49
- package/server/app/container/console/index.ts +2 -3
- package/server/app/container/index.ts +5 -2
- package/server/app/container/trace/index.ts +364 -0
- package/server/app/devCommands.ts +192 -0
- package/server/app/devDiagnostics.ts +53 -0
- package/server/app/index.ts +29 -6
- 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/cron/CronTask.ts +73 -5
- package/server/services/cron/index.ts +34 -11
- package/server/services/fetch/index.ts +3 -10
- package/server/services/prisma/index.ts +66 -4
- package/server/services/router/http/index.ts +173 -6
- package/server/services/router/index.ts +200 -12
- package/server/services/router/request/api.ts +30 -1
- package/server/services/router/response/index.ts +83 -10
- package/server/services/router/response/page/document.tsx +16 -0
- package/server/services/router/response/page/index.tsx +27 -1
- package/skills/clean-project-code/SKILL.md +7 -2
- package/test-results/.last-run.json +4 -0
- package/types/aliases.d.ts +6 -0
- package/types/global/utils.d.ts +7 -14
- package/Rte.zip +0 -0
- package/agents/project/agents.md.zip +0 -0
- package/doc/TODO.md +0 -71
- package/doc/front/router.md +0 -27
- package/doc/workspace/workspace.png +0 -0
- package/doc/workspace/workspace2.png +0 -0
- package/doc/workspace/workspace_26.01.22.png +0 -0
- package/server/services/router/http/session.ts.old +0 -40
|
@@ -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;
|