proteum 2.1.0 → 2.1.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.
Files changed (83) hide show
  1. package/AGENTS.md +44 -98
  2. package/README.md +121 -7
  3. package/agents/framework/AGENTS.md +133 -886
  4. package/agents/project/AGENTS.md +70 -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/deploy/web.ts +1 -2
  15. package/cli/commands/dev.ts +96 -1
  16. package/cli/commands/doctor.ts +8 -74
  17. package/cli/commands/explain.ts +8 -186
  18. package/cli/commands/trace.ts +228 -0
  19. package/cli/compiler/artifacts/commands.ts +217 -0
  20. package/cli/compiler/artifacts/manifest.ts +35 -21
  21. package/cli/compiler/artifacts/services.ts +300 -1
  22. package/cli/compiler/client/index.ts +43 -8
  23. package/cli/compiler/common/commands.ts +175 -0
  24. package/cli/compiler/common/index.ts +1 -1
  25. package/cli/compiler/common/proteumManifest.ts +15 -114
  26. package/cli/compiler/index.ts +25 -2
  27. package/cli/compiler/server/index.ts +31 -6
  28. package/cli/paths.ts +16 -1
  29. package/cli/presentation/commands.ts +59 -5
  30. package/cli/presentation/devSession.ts +5 -0
  31. package/cli/runtime/commands.ts +60 -1
  32. package/cli/tsconfig.json +4 -1
  33. package/cli/utils/check.ts +1 -1
  34. package/client/app/component.tsx +13 -9
  35. package/client/dev/profiler/index.tsx +1511 -0
  36. package/client/dev/profiler/noop.tsx +5 -0
  37. package/client/dev/profiler/runtime.noop.ts +116 -0
  38. package/client/dev/profiler/runtime.ts +840 -0
  39. package/client/services/router/components/router.tsx +30 -2
  40. package/client/services/router/index.tsx +27 -3
  41. package/client/services/router/request/api.ts +133 -17
  42. package/commands/proteum/diagnostics.ts +11 -0
  43. package/common/dev/commands.ts +50 -0
  44. package/common/dev/diagnostics.ts +298 -0
  45. package/common/dev/profiler.ts +91 -0
  46. package/common/dev/proteumManifest.ts +135 -0
  47. package/common/dev/requestTrace.ts +109 -0
  48. package/common/env/proteumEnv.ts +284 -0
  49. package/common/router/index.ts +4 -22
  50. package/docs/dev-commands.md +86 -0
  51. package/docs/request-tracing.md +122 -0
  52. package/package.json +1 -2
  53. package/server/app/commands.ts +35 -370
  54. package/server/app/commandsManager.ts +393 -0
  55. package/server/app/container/config.ts +11 -49
  56. package/server/app/container/console/index.ts +2 -3
  57. package/server/app/container/index.ts +5 -2
  58. package/server/app/container/trace/index.ts +364 -0
  59. package/server/app/devCommands.ts +192 -0
  60. package/server/app/devDiagnostics.ts +53 -0
  61. package/server/app/index.ts +27 -4
  62. package/server/services/cron/CronTask.ts +73 -5
  63. package/server/services/cron/index.ts +34 -11
  64. package/server/services/fetch/index.ts +3 -10
  65. package/server/services/prisma/index.ts +66 -4
  66. package/server/services/router/http/index.ts +151 -0
  67. package/server/services/router/index.ts +200 -12
  68. package/server/services/router/request/api.ts +30 -1
  69. package/server/services/router/response/index.ts +83 -10
  70. package/server/services/router/response/page/document.tsx +16 -0
  71. package/server/services/router/response/page/index.tsx +27 -1
  72. package/skills/clean-project-code/SKILL.md +7 -2
  73. package/test-results/.last-run.json +4 -0
  74. package/types/aliases.d.ts +6 -0
  75. package/types/global/utils.d.ts +7 -14
  76. package/Rte.zip +0 -0
  77. package/agents/project/agents.md.zip +0 -0
  78. package/doc/TODO.md +0 -71
  79. package/doc/front/router.md +0 -27
  80. package/doc/workspace/workspace.png +0 -0
  81. package/doc/workspace/workspace2.png +0 -0
  82. package/doc/workspace/workspace_26.01.22.png +0 -0
  83. package/server/services/router/http/session.ts.old +0 -40
@@ -0,0 +1,284 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import dotenv from 'dotenv';
4
+
5
+ export type TProteumEnvName = 'local' | 'server';
6
+ export type TProteumEnvProfile = 'dev' | 'testing' | 'prod';
7
+ export type TProteumTraceCapture = 'summary' | 'resolve' | 'deep';
8
+ export type TProteumRequiredEnvVariable = {
9
+ key: TProteumRequiredEnvVariableKey;
10
+ possibleValues: string[];
11
+ provided: boolean;
12
+ };
13
+ export type TProteumEnvInspection = {
14
+ loadedVariableKeys: string[];
15
+ requiredVariables: TProteumRequiredEnvVariable[];
16
+ };
17
+
18
+ export type TProteumEnvConfig = {
19
+ name: TProteumEnvName;
20
+ profile: TProteumEnvProfile;
21
+ router: {
22
+ port: number;
23
+ currentDomain: string;
24
+ };
25
+ trace: {
26
+ enable: boolean;
27
+ requestsLimit: number;
28
+ eventsLimit: number;
29
+ capture: TProteumTraceCapture;
30
+ persistOnError: boolean;
31
+ };
32
+ };
33
+
34
+ export type TProteumLoadedEnvConfig = TProteumEnvConfig & { version: string };
35
+
36
+ const dotenvFileNames = ['.env'];
37
+ const requiredProteumEnvVariableKeys = ['ENV_NAME', 'ENV_PROFILE', 'PORT', 'URL'] as const;
38
+ const optionalProteumEnvVariablePrefixes = ['TRACE_'] as const;
39
+
40
+ export type TProteumRequiredEnvVariableKey = (typeof requiredProteumEnvVariableKeys)[number];
41
+
42
+ const requiredProteumEnvVariablePossibleValues: Record<TProteumRequiredEnvVariableKey, string[]> = {
43
+ ENV_NAME: ['local', 'server'],
44
+ ENV_PROFILE: ['dev', 'testing', 'prod'],
45
+ PORT: ['integer between 1 and 65535'],
46
+ URL: ['absolute URL'],
47
+ };
48
+
49
+ const envDefinitionHint = (appDir: string) => `Define it in process.env or ${appDir}/.env.`;
50
+ const isProvidedEnvValue = (value: string | undefined) => typeof value === 'string' && value.trim() !== '';
51
+
52
+ const formatRequiredEnvVariableStatus = (variable: TProteumRequiredEnvVariable) =>
53
+ `- ${variable.key} possibleValues=${variable.possibleValues.join(' | ')} provided=${variable.provided ? 'yes' : 'no'}`;
54
+
55
+ const createProteumEnvError = ({
56
+ appDir,
57
+ message,
58
+ }: {
59
+ appDir: string;
60
+ message: string;
61
+ }) => {
62
+ const inspection = inspectProteumEnv(appDir);
63
+
64
+ return new Error(
65
+ [message, envDefinitionHint(appDir), '', 'Required env variables:', ...inspection.requiredVariables.map(formatRequiredEnvVariableStatus)].join(
66
+ '\n',
67
+ ),
68
+ );
69
+ };
70
+
71
+ const parseBooleanEnvValue = ({
72
+ key,
73
+ value,
74
+ appDir,
75
+ }: {
76
+ key: string;
77
+ value: string | undefined;
78
+ appDir: string;
79
+ }) => {
80
+ if (value === undefined || value === '') return undefined;
81
+
82
+ const normalized = value.trim().toLowerCase();
83
+ if (['1', 'true', 'yes', 'on'].includes(normalized)) return true;
84
+ if (['0', 'false', 'no', 'off'].includes(normalized)) return false;
85
+
86
+ throw createProteumEnvError({
87
+ appDir,
88
+ message: `Invalid boolean value for ${key}: "${value}". Expected one of: 1, 0, true, false, yes, no, on, off.`,
89
+ });
90
+ };
91
+
92
+ const parseIntegerEnvValue = ({
93
+ key,
94
+ value,
95
+ appDir,
96
+ min = 1,
97
+ }: {
98
+ key: string;
99
+ value: string;
100
+ appDir: string;
101
+ min?: number;
102
+ }) => {
103
+ const parsed = Number.parseInt(value, 10);
104
+ if (Number.isNaN(parsed) || parsed < min) {
105
+ throw createProteumEnvError({
106
+ appDir,
107
+ message: `Invalid integer value for ${key}: "${value}". Expected an integer greater than or equal to ${min}.`,
108
+ });
109
+ }
110
+
111
+ return parsed;
112
+ };
113
+
114
+ const getRequiredEnvValue = ({ key, appDir }: { key: TProteumRequiredEnvVariableKey; appDir: string }) => {
115
+ const value = process.env[key]?.trim();
116
+ if (value) return value;
117
+
118
+ throw createProteumEnvError({
119
+ appDir,
120
+ message: `Missing required Proteum env variable "${key}".`,
121
+ });
122
+ };
123
+
124
+ const parseEnvName = (value: string, appDir: string): TProteumEnvName => {
125
+ if (value === 'local' || value === 'server') return value;
126
+ throw createProteumEnvError({
127
+ appDir,
128
+ message: `Invalid ENV_NAME "${value}". Expected "local" or "server".`,
129
+ });
130
+ };
131
+
132
+ const parseEnvProfile = (value: string, appDir: string): TProteumEnvProfile => {
133
+ if (value === 'dev' || value === 'testing' || value === 'prod') return value;
134
+ throw createProteumEnvError({
135
+ appDir,
136
+ message: `Invalid ENV_PROFILE "${value}". Expected "dev", "testing", or "prod".`,
137
+ });
138
+ };
139
+
140
+ const parseTraceCapture = ({
141
+ value,
142
+ appDir,
143
+ }: {
144
+ value: string | undefined;
145
+ appDir: string;
146
+ }): TProteumTraceCapture | undefined => {
147
+ if (value === undefined || value === '') return undefined;
148
+ if (value === 'summary' || value === 'resolve' || value === 'deep') return value;
149
+
150
+ throw createProteumEnvError({
151
+ appDir,
152
+ message: `Invalid TRACE_CAPTURE "${value}". Expected "summary", "resolve", or "deep".`,
153
+ });
154
+ };
155
+
156
+ const parseAbsoluteUrl = ({
157
+ key,
158
+ value,
159
+ appDir,
160
+ }: {
161
+ key: string;
162
+ value: string;
163
+ appDir: string;
164
+ }) => {
165
+ let url: URL;
166
+
167
+ try {
168
+ url = new URL(value);
169
+ } catch {
170
+ throw createProteumEnvError({
171
+ appDir,
172
+ message: `Invalid absolute URL for ${key}: "${value}". Expected an absolute http:// or https:// URL.`,
173
+ });
174
+ }
175
+
176
+ if (url.protocol !== 'http:' && url.protocol !== 'https:') {
177
+ throw createProteumEnvError({
178
+ appDir,
179
+ message: `Invalid absolute URL for ${key}: "${value}". Expected an absolute http:// or https:// URL.`,
180
+ });
181
+ }
182
+
183
+ return value;
184
+ };
185
+
186
+ export const loadOptionalProteumDotenv = (appDir: string) => {
187
+ for (const filename of dotenvFileNames) {
188
+ const filepath = path.join(appDir, filename);
189
+ if (!fs.existsSync(filepath)) continue;
190
+ dotenv.config({ path: filepath, quiet: true });
191
+ }
192
+ };
193
+
194
+ export const getLoadedProteumEnvVariableKeys = () =>
195
+ Object.keys(process.env)
196
+ .filter(
197
+ (key) =>
198
+ requiredProteumEnvVariableKeys.includes(key as TProteumRequiredEnvVariableKey) ||
199
+ optionalProteumEnvVariablePrefixes.some((prefix) => key.startsWith(prefix)),
200
+ )
201
+ .sort((a, b) => a.localeCompare(b));
202
+
203
+ export const inspectProteumEnv = (appDir: string): TProteumEnvInspection => {
204
+ loadOptionalProteumDotenv(appDir);
205
+
206
+ return {
207
+ loadedVariableKeys: getLoadedProteumEnvVariableKeys(),
208
+ requiredVariables: requiredProteumEnvVariableKeys.map((key) => ({
209
+ key,
210
+ possibleValues: [...requiredProteumEnvVariablePossibleValues[key]],
211
+ provided: isProvidedEnvValue(process.env[key]),
212
+ })),
213
+ };
214
+ };
215
+
216
+ export const parseProteumEnvConfig = ({
217
+ appDir,
218
+ routerPortOverride,
219
+ }: {
220
+ appDir: string;
221
+ routerPortOverride?: number;
222
+ }): TProteumEnvConfig => {
223
+ loadOptionalProteumDotenv(appDir);
224
+
225
+ const name = parseEnvName(getRequiredEnvValue({ key: 'ENV_NAME', appDir }), appDir);
226
+ const profile = parseEnvProfile(getRequiredEnvValue({ key: 'ENV_PROFILE', appDir }), appDir);
227
+ const configuredRouterPort = parseIntegerEnvValue({
228
+ key: 'PORT',
229
+ value: getRequiredEnvValue({ key: 'PORT', appDir }),
230
+ appDir,
231
+ });
232
+ const currentDomain = parseAbsoluteUrl({
233
+ key: 'URL',
234
+ value: getRequiredEnvValue({ key: 'URL', appDir }),
235
+ appDir,
236
+ });
237
+
238
+ const traceEnable = parseBooleanEnvValue({
239
+ key: 'TRACE_ENABLE',
240
+ value: process.env.TRACE_ENABLE,
241
+ appDir,
242
+ });
243
+ const tracePersistOnError = parseBooleanEnvValue({
244
+ key: 'TRACE_PERSIST_ON_ERROR',
245
+ value: process.env.TRACE_PERSIST_ON_ERROR,
246
+ appDir,
247
+ });
248
+ const traceRequestsLimit = process.env.TRACE_REQUESTS_LIMIT?.trim();
249
+ const traceEventsLimit = process.env.TRACE_EVENTS_LIMIT?.trim();
250
+ const traceCapture = parseTraceCapture({
251
+ value: process.env.TRACE_CAPTURE?.trim(),
252
+ appDir,
253
+ });
254
+
255
+ return {
256
+ name,
257
+ profile,
258
+ router: {
259
+ port: routerPortOverride === undefined ? configuredRouterPort : routerPortOverride,
260
+ currentDomain,
261
+ },
262
+ trace: {
263
+ enable: traceEnable ?? profile === 'dev',
264
+ requestsLimit:
265
+ traceRequestsLimit === undefined || traceRequestsLimit === ''
266
+ ? 200
267
+ : parseIntegerEnvValue({
268
+ key: 'TRACE_REQUESTS_LIMIT',
269
+ value: traceRequestsLimit,
270
+ appDir,
271
+ }),
272
+ eventsLimit:
273
+ traceEventsLimit === undefined || traceEventsLimit === ''
274
+ ? 800
275
+ : parseIntegerEnvValue({
276
+ key: 'TRACE_EVENTS_LIMIT',
277
+ value: traceEventsLimit,
278
+ appDir,
279
+ }),
280
+ capture: traceCapture ?? 'resolve',
281
+ persistOnError: tracePersistOnError ?? profile === 'dev',
282
+ },
283
+ };
284
+ };
@@ -106,8 +106,6 @@ export type TRouteModule<TRegisteredRoute = any> = {
106
106
  __register: TAppArrowFunction<TRegisteredRoute>;
107
107
  };
108
108
 
109
- export type TDomainsList = { [endpointId: string]: string } & { current: string };
110
-
111
109
  export const defaultOptions: Pick<TRouteOptions, 'priority'> = { priority: 0 };
112
110
 
113
111
  /*----------------------------------
@@ -116,31 +114,15 @@ export const defaultOptions: Pick<TRouteOptions, 'priority'> = { priority: 0 };
116
114
  export const buildUrl = (
117
115
  path: string,
118
116
  params: { [key: string]: any },
119
- domains: { [alias: string]: string },
117
+ currentDomain: string,
120
118
  absolute: boolean,
121
119
  ) => {
122
120
  let prefix: string = '';
123
121
 
124
122
  // Relative to domain
125
- if (path[0] === '/' && absolute) prefix = domains.current;
126
- // Other domains of the project
127
- else if (path[0] === '@') {
128
- // Extract domain ID from path
129
- let domainId: string;
130
- let slackPos = path.indexOf('/');
131
- if (slackPos === -1) slackPos = path.length;
132
- domainId = path.substring(1, slackPos);
133
- path = path.substring(slackPos);
134
-
135
- // Get domain
136
- const domain = domains[domainId];
137
- if (domain === undefined) throw new Error('Unknown API endpoint ID: ' + domainId);
138
-
139
- // Return full url
140
- prefix = domain;
141
-
142
- // Absolute URL
143
- }
123
+ if (path[0] === '/' && absolute) prefix = currentDomain;
124
+ else if (path[0] === '@')
125
+ throw new Error(`Proteum no longer supports Router.url() domain aliases. Use a root-relative path or absolute URL instead: "${path}".`);
144
126
 
145
127
  // Path parapeters
146
128
  const searchParams = new URLSearchParams();
@@ -0,0 +1,86 @@
1
+ ## Dev Commands
2
+
3
+ Proteum supports a dev-only internal command surface for testing, debugging, and one-off server-side execution that should not be exposed as a normal controller or route.
4
+
5
+ ### Source Contract
6
+
7
+ - command files live under `./commands/**/*.ts`
8
+ - each file default-exports a class extending `Commands` from `@server/app/commands`
9
+ - every method with a body becomes a runnable command
10
+ - the command path is `file/path/methodName`
11
+ - `export const commandPath = 'Custom/path'` can override the file-derived base path
12
+
13
+ Example:
14
+
15
+ ```ts
16
+ import { Commands } from '@server/app/commands';
17
+
18
+ export default class DiagnosticsCommands extends Commands {
19
+ public async ping() {
20
+ return {
21
+ app: this.app.identity.identifier,
22
+ env: this.app.env.profile,
23
+ };
24
+ }
25
+ }
26
+ ```
27
+
28
+ The example above is available as `diagnostics/ping`.
29
+
30
+ When `./commands` exists, Proteum also creates `./commands/tsconfig.json` plus a generated command typing surface under `.proteum/server/commands.d.ts`.
31
+
32
+ - command files inherit the server alias project
33
+ - `extends Commands` works without importing your app class
34
+ - `@/server/index` remains available inside `/commands` as a generated command-only app type alias
35
+
36
+ ### CLI
37
+
38
+ Run a command locally:
39
+
40
+ ```bash
41
+ proteum command proteum/diagnostics/ping
42
+ ```
43
+
44
+ Local mode does this:
45
+
46
+ 1. refreshes `.proteum` artifacts
47
+ 2. picks a temporary local port
48
+ 3. builds the dev server output
49
+ 4. starts a temporary local dev server
50
+ 5. runs the command through the dev-only command endpoint
51
+ 6. prints the result and exits
52
+
53
+ Run a command against an existing dev instance:
54
+
55
+ ```bash
56
+ proteum command proteum/diagnostics/ping --port 3101
57
+ proteum command proteum/diagnostics/ping --url http://127.0.0.1:3101
58
+ ```
59
+
60
+ Use `--port` or `--url` when you want to reuse an existing `proteum dev` instance instead of building and starting a temporary local one.
61
+
62
+ ### Profiler
63
+
64
+ In `proteum dev`, the bottom profiler exposes a `Commands` tab.
65
+
66
+ - it lists every generated command path
67
+ - it shows the backing class, method, scope, and source location
68
+ - clicking `Run now` executes the command through the running dev server
69
+ - the last result or error stays attached to that command row in the panel
70
+
71
+ ### HTTP Endpoints
72
+
73
+ The CLI remote mode and the profiler use the same dev-only endpoints:
74
+
75
+ - `GET /__proteum/commands`
76
+ - `POST /__proteum/commands/run`
77
+
78
+ These endpoints exist only in dev mode and are not available in production.
79
+
80
+ ### Built-In Command
81
+
82
+ Proteum ships one framework command by default:
83
+
84
+ - `proteum/diagnostics/ping`
85
+
86
+ It returns the current app identifier, active env profile, and discovered root services so every dev app has a real command surface available immediately.
@@ -0,0 +1,122 @@
1
+ # Request Tracing
2
+
3
+ Proteum ships with a dev-only in-memory request trace buffer so routing, controller execution, SSR, and render behavior can be inspected without attaching a debugger or scattering temporary logs through the runtime.
4
+
5
+ ## Scope
6
+
7
+ - tracing is available only when the app runs with `profile: dev`
8
+ - traces are exposed through `proteum trace` and the dev-only `__proteum/trace` HTTP endpoints
9
+ - production requests are not traced by this feature
10
+
11
+ ## Main Commands
12
+
13
+ ```bash
14
+ proteum trace requests
15
+ proteum trace latest
16
+ proteum trace show <requestId>
17
+ proteum trace arm --capture deep
18
+ proteum trace export <requestId>
19
+ proteum trace latest --url http://127.0.0.1:3010
20
+ ```
21
+
22
+ Before reproducing a bug or starting a new test pass:
23
+
24
+ - read the default port from `PORT` or `./.proteum/manifest.json`
25
+ - check whether a dev server is already running on that port
26
+ - if it is, inspect `proteum trace requests`, `proteum trace latest`, and `proteum trace show <requestId>` first so you can capture past errors and their context
27
+
28
+ Typical debugging flow:
29
+
30
+ ```bash
31
+ proteum trace arm --capture deep --port 3103
32
+ # reproduce the failing request once
33
+ proteum trace requests --port 3103
34
+ proteum trace show <requestId> --port 3103
35
+ ```
36
+
37
+ Use `--url http://host:port` when the dev server is reachable on a non-standard host and `--port` is not enough.
38
+
39
+ ## What Gets Recorded
40
+
41
+ Depending on capture mode, traces can include:
42
+
43
+ - request start, finish, user identity, status code, and duration
44
+ - direct controller route matches
45
+ - route resolution start, match, and deep-mode skip reasons
46
+ - controller start and result shape
47
+ - created router/context keys
48
+ - setup output keys and page data summaries
49
+ - SSR payload shape and serialized byte size
50
+ - render start/end timings and document output sizes
51
+ - normalized request errors
52
+
53
+ ## Capture Modes
54
+
55
+ - `summary`: smallest capture, focused on request lifecycle and high-signal events
56
+ - `resolve`: adds route matching, controller, setup, and context milestones
57
+ - `deep`: adds route skip reasons and deeper summarized payload inspection for one request
58
+
59
+ Use `deep` selectively. It is for one-off investigation, not continuous capture.
60
+
61
+ ## Configuration
62
+
63
+ Set trace behavior with env vars:
64
+
65
+ ```bash
66
+ export TRACE_ENABLE=true
67
+ export TRACE_REQUESTS_LIMIT=200
68
+ export TRACE_EVENTS_LIMIT=800
69
+ export TRACE_CAPTURE=resolve
70
+ export TRACE_PERSIST_ON_ERROR=true
71
+ ```
72
+
73
+ Notes:
74
+
75
+ - `enable` and `persistOnError` still remain dev-only in the current runtime
76
+ - `capture` defaults to `resolve`
77
+ - `requestsLimit` defaults to `200`
78
+ - `eventsLimit` defaults to `800`
79
+ - `proteum dev` removes auto-persisted crash traces from `var/traces/` when the dev session stops
80
+ - explicit `proteum trace export` files under `var/traces/exports/` are left in place
81
+
82
+ ## Memory Model
83
+
84
+ Traces are kept in memory per Node process.
85
+
86
+ - requests are stored in a ring buffer capped by `requestsLimit`
87
+ - the oldest request traces are evicted first
88
+ - each request is capped by `eventsLimit`
89
+ - once the event cap is reached, extra events are dropped and counted in `droppedEvents`
90
+ - payloads are summarized rather than stored as raw objects
91
+
92
+ Current summarization rules:
93
+
94
+ - arrays keep at most 10 sampled items
95
+ - objects keep at most 20 keys per level
96
+ - deep capture stops at depth 3
97
+ - long strings are truncated
98
+
99
+ ## Redaction
100
+
101
+ Sensitive values are redacted before they enter the trace store.
102
+
103
+ This includes keys such as:
104
+
105
+ - `cookie`
106
+ - `authorization`
107
+ - `password`
108
+ - token-like fields such as `accessToken`, `refreshToken`, `apiKey`, `jwt`, and similar names
109
+ - `rawBody`
110
+
111
+ The goal is to make traces useful for debugging without turning the dev server into a secret dump.
112
+
113
+ ## Dev HTTP Endpoints
114
+
115
+ These endpoints back the CLI:
116
+
117
+ - `GET /__proteum/trace/requests`
118
+ - `GET /__proteum/trace/latest`
119
+ - `GET /__proteum/trace/requests/:id`
120
+ - `POST /__proteum/trace/arm`
121
+
122
+ The CLI should be the primary interface. Use the HTTP endpoints when you need direct machine access from another local dev tool.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "proteum",
3
3
  "description": "LLM-first Opinionated Typescript Framework for web applications.",
4
- "version": "2.1.0",
4
+ "version": "2.1.1",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/proteum.git",
7
7
  "license": "MIT",
@@ -70,7 +70,6 @@
70
70
  "preact-render-to-string": "^6.6.1",
71
71
  "prompts": "^2.4.2",
72
72
  "replace-once": "^1.0.0",
73
- "request": "^2.88.2",
74
73
  "responsive-loader": "^3.1.2",
75
74
  "serialize-javascript": "^6.0.2",
76
75
  "sharp": "^0.34.3",