@guren/server 2.23.3 → 2.25.0

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 (72) hide show
  1. package/dist/DailyFileChannel-CTTPA0EF.js +114 -0
  2. package/dist/{DocsViewerServiceProvider-DWnlXx_y.js → DocsViewerServiceProvider-CIRNHQ2I.js} +2 -2
  3. package/dist/{authorization-0mCGUFoI.js → Gate-YOt54xGF.js} +2 -217
  4. package/dist/{Job-BVvaY-7p.js → Job-COMzBNOL.js} +3 -10
  5. package/dist/McpServiceProvider-B-LioPSz.js +43 -0
  6. package/dist/Resource-BdYd4J9a.js +1035 -0
  7. package/dist/{loopback-guard-DT9gHF0F.js → ServiceProvider-DDW3MqQJ.js} +10 -68
  8. package/dist/agent/audit-file.d.ts +3 -0
  9. package/dist/agent/audit-sink.d.ts +16 -0
  10. package/dist/agent/call-budget.d.ts +22 -0
  11. package/dist/agent/events.d.ts +6 -6
  12. package/dist/api-token-BbgDEd6j.js +298 -0
  13. package/dist/audit-file-DocumbCr.js +29 -0
  14. package/dist/auth/index.js +2 -1
  15. package/dist/auth/oauth/index.d.ts +7 -0
  16. package/dist/{auth-Jp_MB8Il.js → auth-vFeem6uM.js} +8 -298
  17. package/dist/authorization/index.js +2 -1
  18. package/dist/authorization-BLhwA2Yh.js +217 -0
  19. package/dist/broadcasting/index.js +1 -1
  20. package/dist/{broadcasting-DVfG2vgN.js → broadcasting-BUBCPCnu.js} +1 -1
  21. package/dist/config/define.d.ts +49 -0
  22. package/dist/config/env-reads.d.ts +12 -0
  23. package/dist/config/env.d.ts +122 -0
  24. package/dist/container/Container.d.ts +13 -2
  25. package/dist/container/ServiceProvider.d.ts +7 -0
  26. package/dist/container/bindings.d.ts +8 -0
  27. package/dist/{default-application-Chbrul_m.js → default-application-D5ezhhiV.js} +18 -1
  28. package/dist/encryption/index.js +1 -1
  29. package/dist/{encryption-BRjZnshr.js → encryption-D1dxfMqD.js} +1 -1
  30. package/dist/{endpoint-BXipU2Jj.js → endpoint-CTIzcagh.js} +1 -1
  31. package/dist/{endpoint-Dsw3Acvq.js → endpoint-Coq0K_6I.js} +1 -1
  32. package/dist/events/index.js +1 -1
  33. package/dist/{events-CaJKZ2qk.js → events-c94CdUFc.js} +1 -1
  34. package/dist/http/Application.d.ts +22 -0
  35. package/dist/http/vite-manifest.d.ts +5 -1
  36. package/dist/i18n/index.js +1 -1
  37. package/dist/i18n/injected-translations.d.ts +8 -0
  38. package/dist/i18n/loaders/JsonLoader.d.ts +3 -2
  39. package/dist/{i18n-DRo1g0AN.js → i18n-DqcRD4qL.js} +4 -3
  40. package/dist/index.d.ts +11 -0
  41. package/dist/index.js +525 -1075
  42. package/dist/inertia-defaults-BjrcT7za.js +30 -0
  43. package/dist/internal/request.d.ts +4 -3
  44. package/dist/internal/request.js +2 -1
  45. package/dist/internal/testing.d.ts +17 -0
  46. package/dist/internal/testing.js +6 -0
  47. package/dist/lambda/index.js +1 -1
  48. package/dist/logging/index.js +2 -1
  49. package/dist/{logging-CXotojgW.js → logging-YbKmbAd7.js} +3 -113
  50. package/dist/loopback-guard-CG8xB4v0.js +68 -0
  51. package/dist/mail/index.js +1 -1
  52. package/dist/{mail-zMjQimaJ.js → mail-uRBrUl9q.js} +3 -2
  53. package/dist/mcp/McpServiceProvider.d.ts +21 -4
  54. package/dist/mcp/endpoint.d.ts +3 -3
  55. package/dist/mcp/index.d.ts +0 -2
  56. package/dist/mcp/index.js +2 -2
  57. package/dist/mvc/Controller.d.ts +11 -1
  58. package/dist/mvc/Router.d.ts +6 -0
  59. package/dist/mvc/inertia/InertiaEngine.d.ts +2 -0
  60. package/dist/mvc/validated-input.d.ts +55 -0
  61. package/dist/notifications/index.js +1 -1
  62. package/dist/{notifications-BLid0Y6M.js → notifications-LHuujttf.js} +2 -2
  63. package/dist/providers/ConfigServiceProvider.d.ts +19 -0
  64. package/dist/queue/index.js +2 -2
  65. package/dist/{queue-IdJjqbyJ.js → queue-BiBn5Sff.js} +1 -1
  66. package/dist/resolve-optional-ax6gPWTp.js +9 -0
  67. package/dist/runtime/index.js +2 -1
  68. package/dist/validated-input-D84J8wcC.js +25 -0
  69. package/dist/{vite-manifest-DeWRFXTm.js → vite-manifest-C5kqRoBV.js} +7 -32
  70. package/package.json +6 -3
  71. package/dist/McpServiceProvider-BvJRcDOm.js +0 -458
  72. package/dist/mcp/create-mcp-server.d.ts +0 -180
@@ -1,180 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- /**
3
- * Options the `.guren/*.gen.ts` generators are called with. `cwd` is the project
4
- * they resolve output paths against; nothing changes `process.cwd()`, which is
5
- * process-wide and shared by concurrent requests.
6
- */
7
- export interface CodegenOptions {
8
- cwd: string;
9
- force?: boolean;
10
- }
11
- /** What every scaffolder takes; `cwd` names the project, for the same reason. */
12
- export interface ScaffoldOptions {
13
- force?: boolean;
14
- cwd?: string;
15
- }
16
- /**
17
- * What a generator reports back. An empty `outputPath` means it found nothing to
18
- * describe and wrote no file; `skipped` explains that when "nothing to describe"
19
- * would be wrong. `definitions` stays opaque — this package only carries it from
20
- * one CLI call to the next, so mirroring the CLI's shapes would need syncing.
21
- */
22
- export interface CodegenResult {
23
- outputPath?: string;
24
- definitions?: unknown[];
25
- skipped?: {
26
- message: string;
27
- } | null;
28
- /** Non-fatal diagnostics for whoever asked for the run; the artifact was still written. */
29
- warnings?: string[];
30
- }
31
- /**
32
- * CLI functions the MCP server wraps, injected at runtime because
33
- * `@guren/server` cannot depend on `@guren/cli`.
34
- */
35
- export interface GurenCliApi {
36
- generateContext(opts: {
37
- cwd: string;
38
- }): Promise<{
39
- framework: {
40
- name: string;
41
- version: string;
42
- };
43
- models: Array<{
44
- className: string;
45
- }>;
46
- routes: Array<unknown>;
47
- /** Why `routes` is empty, when it is empty because the load failed. */
48
- routesError?: string;
49
- pages: string[];
50
- controllers: string[];
51
- resources: string[];
52
- events: string[];
53
- jobs: string[];
54
- middleware: string[];
55
- listeners: string[];
56
- validators: string[];
57
- }>;
58
- renderContextMarkdown(ctx: unknown): string;
59
- generateEntityContext(entity: string, opts: {
60
- cwd: string;
61
- module?: string;
62
- live?: boolean;
63
- repo?: string;
64
- }): Promise<unknown>;
65
- renderEntityContextMarkdown(ctx: unknown): string;
66
- runCheck(opts: {
67
- cwd: string;
68
- }): Promise<{
69
- cwd: string;
70
- checks: Array<{
71
- key: string;
72
- title: string;
73
- status: string;
74
- message: string;
75
- suggestion?: string;
76
- }>;
77
- passCount: number;
78
- warnCount: number;
79
- failCount: number;
80
- }>;
81
- /** Absent on a @guren/cli older than `guren gate`; the tool says so instead of throwing. */
82
- runGate?(opts: {
83
- cwd: string;
84
- changed?: boolean;
85
- deps?: boolean;
86
- }): Promise<{
87
- cwd: string;
88
- ok: boolean;
89
- changed: boolean;
90
- stages: Array<{
91
- name: string;
92
- status: string;
93
- durationMs: number;
94
- findings: string[];
95
- reason?: string;
96
- }>;
97
- }>;
98
- listModels(opts: {
99
- appRoot: string;
100
- }): Promise<Array<{
101
- className: string;
102
- filePath: string;
103
- tableName?: string;
104
- relationships: Array<{
105
- name: string;
106
- type: string;
107
- relatedModel?: string;
108
- }>;
109
- usesAuth: boolean;
110
- hasSoftDeletes: boolean;
111
- }>>;
112
- generateGuidelines(opts: {
113
- cwd: string;
114
- }): Promise<string>;
115
- runDoctor(opts: {
116
- cwd: string;
117
- }): Promise<unknown>;
118
- suggestNextSteps(opts: {
119
- cwd: string;
120
- }): Promise<unknown>;
121
- makeFeature(name: string, opts: ScaffoldOptions & {
122
- fields?: string;
123
- withTest?: boolean;
124
- }): Promise<string[]>;
125
- makeController(name: string, opts: ScaffoldOptions): Promise<string | string[]>;
126
- makeModel(name: string, opts: ScaffoldOptions): Promise<string | string[]>;
127
- makeView(name: string, opts: ScaffoldOptions): Promise<string | string[]>;
128
- makeTest(name: string, opts: ScaffoldOptions): Promise<string | string[]>;
129
- makeRoute(name: string, opts: ScaffoldOptions): Promise<string | string[]>;
130
- generateRouteTypes(opts: CodegenOptions): Promise<CodegenResult | void>;
131
- generatePageTypes(opts: CodegenOptions): Promise<CodegenResult | void>;
132
- generateDataTypes(opts: CodegenOptions): Promise<CodegenResult | void>;
133
- generateChannelTypes(opts: CodegenOptions): Promise<CodegenResult | void>;
134
- /**
135
- * Takes the route manifest `generateRouteTypes` returns. `resources` is what
136
- * `generateDataTypes` extracted — without it every `resource` response hint
137
- * is "unknown Resource" and the client's `json()` stays untyped.
138
- */
139
- generateApiClientTypes(definitions: unknown[], opts: CodegenOptions & {
140
- resources?: unknown[];
141
- }): Promise<CodegenResult | void>;
142
- /**
143
- * Agent tools derived from the route manifest (RFC 0016), so it runs after
144
- * `generateRouteTypes` and `generateDataTypes`. Optional: `@guren/cli` is
145
- * resolved from the app and an older one simply generates no agent manifest.
146
- */
147
- generateAgentTypes?(definitions: unknown[], opts: CodegenOptions & {
148
- resources?: unknown[];
149
- }): Promise<CodegenResult | void>;
150
- /**
151
- * Route-dependent context generation in a fresh process. Optional because
152
- * `@guren/cli` is resolved from the app at runtime and may predate it.
153
- */
154
- createFreshContextApi?: () => Pick<GurenCliApi, 'generateContext' | 'generateEntityContext'>;
155
- /**
156
- * Spelled exactly as `@guren/cli` exports it — this interface describes that
157
- * module namespace, so a camelCase name here would read `undefined` off every
158
- * real CLI. Optional for the runtime-resolution reason above, and read for it:
159
- * an older CLI emits routes with no `agent` field, which looks like no tools.
160
- */
161
- CONTEXT_ROUTE_FEATURES?: readonly string[];
162
- /**
163
- * Every route as a context route, without the rest of the project context.
164
- * Optional; `guren_agent_surface` falls back to `generateContext`.
165
- */
166
- loadContextRoutes?(cwd: string, routesFile?: string, loadErrors?: string[]): Promise<unknown[]>;
167
- /** The OKF docs relation graph (RFC 0005). Optional, like the above. */
168
- buildDocsGraphReport?(options: {
169
- cwd?: string;
170
- entity?: string;
171
- path?: string;
172
- }): Promise<unknown>;
173
- renderDocsGraphMarkdown?(report: unknown): string;
174
- }
175
- export interface CreateMcpServerOptions {
176
- cwd: string;
177
- cli: GurenCliApi;
178
- version?: string;
179
- }
180
- export declare function createMcpServer(options: CreateMcpServerOptions): McpServer;