remnote-mcp-server 0.14.2 → 0.16.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 (53) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +74 -30
  3. package/dist/cli.d.ts +2 -1
  4. package/dist/cli.js +9 -2
  5. package/dist/cli.js.map +1 -1
  6. package/dist/config.d.ts +14 -2
  7. package/dist/config.js +210 -10
  8. package/dist/config.js.map +1 -1
  9. package/dist/daemon.d.ts +61 -0
  10. package/dist/daemon.js +735 -0
  11. package/dist/daemon.js.map +1 -0
  12. package/dist/index.js +8 -10
  13. package/dist/index.js.map +1 -1
  14. package/dist/remnote-cli/cli.js +8 -1
  15. package/dist/remnote-cli/cli.js.map +1 -1
  16. package/dist/remnote-cli/client/mcp-server-client.d.ts +1 -0
  17. package/dist/remnote-cli/client/mcp-server-client.js +14 -5
  18. package/dist/remnote-cli/client/mcp-server-client.js.map +1 -1
  19. package/dist/remnote-cli/commands/content-input.d.ts +0 -12
  20. package/dist/remnote-cli/commands/content-input.js +0 -20
  21. package/dist/remnote-cli/commands/content-input.js.map +1 -1
  22. package/dist/remnote-cli/commands/create.js +6 -3
  23. package/dist/remnote-cli/commands/create.js.map +1 -1
  24. package/dist/remnote-cli/commands/journal.js +3 -0
  25. package/dist/remnote-cli/commands/journal.js.map +1 -1
  26. package/dist/remnote-cli/commands/read.js +37 -5
  27. package/dist/remnote-cli/commands/read.js.map +1 -1
  28. package/dist/remnote-cli/commands/search.d.ts +1 -0
  29. package/dist/remnote-cli/commands/search.js +111 -11
  30. package/dist/remnote-cli/commands/search.js.map +1 -1
  31. package/dist/remnote-cli/commands/update.js +5 -24
  32. package/dist/remnote-cli/commands/update.js.map +1 -1
  33. package/dist/remnote-cli/commands/write-actions.d.ts +6 -0
  34. package/dist/remnote-cli/commands/write-actions.js +229 -0
  35. package/dist/remnote-cli/commands/write-actions.js.map +1 -0
  36. package/dist/schemas/remnote-schemas.d.ts +105 -18
  37. package/dist/schemas/remnote-schemas.js +179 -60
  38. package/dist/schemas/remnote-schemas.js.map +1 -1
  39. package/dist/shutdown.d.ts +15 -0
  40. package/dist/shutdown.js +59 -0
  41. package/dist/shutdown.js.map +1 -0
  42. package/dist/tools/index.d.ts +3722 -173
  43. package/dist/tools/index.js +595 -66
  44. package/dist/tools/index.js.map +1 -1
  45. package/dist/websocket-server.d.ts +2 -1
  46. package/dist/websocket-server.js +6 -2
  47. package/dist/websocket-server.js.map +1 -1
  48. package/mcpb/remnote-local/manifest.json +40 -26
  49. package/mcpb/remnote-local/package.json +1 -1
  50. package/mcpb/remnote-local/remnote-local.mcpb +0 -0
  51. package/mcpb/remnote-local/server/fallback-tools.generated.js +477 -0
  52. package/mcpb/remnote-local/server/index.js +11 -124
  53. package/package.json +5 -3
@@ -3,55 +3,142 @@ export declare const CreateNoteSchema: z.ZodObject<{
3
3
  title: z.ZodOptional<z.ZodString>;
4
4
  content: z.ZodOptional<z.ZodString>;
5
5
  parentId: z.ZodOptional<z.ZodString>;
6
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
- }, z.core.$strip>;
6
+ tagRemIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ asDocument: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strict>;
8
9
  export declare const SearchSchema: z.ZodObject<{
9
- query: z.ZodString;
10
- limit: z.ZodDefault<z.ZodNumber>;
11
- includeContent: z.ZodDefault<z.ZodEnum<{
10
+ contentMode: z.ZodDefault<z.ZodEnum<{
12
11
  none: "none";
13
12
  markdown: "markdown";
14
13
  structured: "structured";
15
14
  }>>;
15
+ view: z.ZodDefault<z.ZodEnum<{
16
+ compact: "compact";
17
+ standard: "standard";
18
+ full: "full";
19
+ }>>;
20
+ ancestorDepth: z.ZodDefault<z.ZodNumber>;
16
21
  depth: z.ZodDefault<z.ZodNumber>;
17
22
  childLimit: z.ZodDefault<z.ZodNumber>;
18
23
  maxContentLength: z.ZodDefault<z.ZodNumber>;
19
- }, z.core.$strip>;
20
- export declare const SearchByTagSchema: z.ZodObject<{
21
- tag: z.ZodString;
24
+ query: z.ZodString;
22
25
  limit: z.ZodDefault<z.ZodNumber>;
23
- includeContent: z.ZodDefault<z.ZodEnum<{
26
+ cursor: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strict>;
28
+ export declare const SearchByTagSchema: z.ZodObject<{
29
+ contentMode: z.ZodDefault<z.ZodEnum<{
24
30
  none: "none";
25
31
  markdown: "markdown";
26
32
  structured: "structured";
27
33
  }>>;
34
+ view: z.ZodDefault<z.ZodEnum<{
35
+ compact: "compact";
36
+ standard: "standard";
37
+ full: "full";
38
+ }>>;
39
+ ancestorDepth: z.ZodDefault<z.ZodNumber>;
28
40
  depth: z.ZodDefault<z.ZodNumber>;
29
41
  childLimit: z.ZodDefault<z.ZodNumber>;
30
42
  maxContentLength: z.ZodDefault<z.ZodNumber>;
31
- }, z.core.$strip>;
43
+ tagRemId: z.ZodString;
44
+ resultMode: z.ZodDefault<z.ZodEnum<{
45
+ context: "context";
46
+ tagged: "tagged";
47
+ }>>;
48
+ limit: z.ZodDefault<z.ZodNumber>;
49
+ cursor: z.ZodOptional<z.ZodString>;
50
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
51
+ }, z.core.$strict>;
32
52
  export declare const ReadNoteSchema: z.ZodObject<{
33
53
  remId: z.ZodString;
34
54
  depth: z.ZodDefault<z.ZodNumber>;
35
- includeContent: z.ZodDefault<z.ZodEnum<{
55
+ contentMode: z.ZodDefault<z.ZodEnum<{
36
56
  none: "none";
37
57
  markdown: "markdown";
38
58
  structured: "structured";
39
59
  }>>;
60
+ view: z.ZodDefault<z.ZodEnum<{
61
+ compact: "compact";
62
+ standard: "standard";
63
+ full: "full";
64
+ }>>;
65
+ ancestorDepth: z.ZodDefault<z.ZodNumber>;
40
66
  childLimit: z.ZodDefault<z.ZodNumber>;
41
67
  maxContentLength: z.ZodDefault<z.ZodNumber>;
42
- }, z.core.$strip>;
68
+ }, z.core.$strict>;
69
+ export declare const ListChildrenSchema: z.ZodObject<{
70
+ parentRemId: z.ZodString;
71
+ limit: z.ZodDefault<z.ZodNumber>;
72
+ cursor: z.ZodOptional<z.ZodString>;
73
+ view: z.ZodDefault<z.ZodEnum<{
74
+ compact: "compact";
75
+ standard: "standard";
76
+ full: "full";
77
+ }>>;
78
+ ancestorDepth: z.ZodDefault<z.ZodNumber>;
79
+ }, z.core.$strict>;
80
+ export declare const InsertChildrenPositionSchema: z.ZodEnum<{
81
+ before: "before";
82
+ after: "after";
83
+ first: "first";
84
+ last: "last";
85
+ }>;
86
+ export declare const MoveNoteSchema: z.ZodObject<{
87
+ remId: z.ZodString;
88
+ newParentRemId: z.ZodString;
89
+ position: z.ZodDefault<z.ZodEnum<{
90
+ before: "before";
91
+ after: "after";
92
+ first: "first";
93
+ last: "last";
94
+ }>>;
95
+ siblingRemId: z.ZodOptional<z.ZodString>;
96
+ dryRun: z.ZodDefault<z.ZodBoolean>;
97
+ expectedOldParentRemId: z.ZodOptional<z.ZodString>;
98
+ ancestorDepth: z.ZodDefault<z.ZodNumber>;
99
+ }, z.core.$strict>;
43
100
  export declare const UpdateNoteSchema: z.ZodObject<{
44
101
  remId: z.ZodString;
45
102
  title: z.ZodOptional<z.ZodString>;
46
- appendContent: z.ZodOptional<z.ZodString>;
47
- replaceContent: z.ZodOptional<z.ZodString>;
48
- addTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
49
- removeTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
- }, z.core.$strip>;
103
+ }, z.core.$strict>;
104
+ export declare const SetDocumentStatusSchema: z.ZodObject<{
105
+ remId: z.ZodString;
106
+ isDocument: z.ZodBoolean;
107
+ dryRun: z.ZodDefault<z.ZodBoolean>;
108
+ expectedOldRemType: z.ZodOptional<z.ZodEnum<{
109
+ document: "document";
110
+ dailyDocument: "dailyDocument";
111
+ concept: "concept";
112
+ descriptor: "descriptor";
113
+ portal: "portal";
114
+ text: "text";
115
+ }>>;
116
+ }, z.core.$strict>;
117
+ export declare const InsertChildrenSchema: z.ZodObject<{
118
+ parentRemId: z.ZodString;
119
+ content: z.ZodString;
120
+ position: z.ZodEnum<{
121
+ before: "before";
122
+ after: "after";
123
+ first: "first";
124
+ last: "last";
125
+ }>;
126
+ siblingRemId: z.ZodOptional<z.ZodString>;
127
+ }, z.core.$strict>;
128
+ export declare const ReplaceChildrenSchema: z.ZodObject<{
129
+ parentRemId: z.ZodString;
130
+ content: z.ZodString;
131
+ }, z.core.$strict>;
132
+ export declare const UpdateTagsSchema: z.ZodObject<{
133
+ remId: z.ZodString;
134
+ addTagRemIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
135
+ removeTagRemIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
136
+ }, z.core.$strict>;
51
137
  export declare const AppendJournalSchema: z.ZodObject<{
52
138
  content: z.ZodString;
53
139
  timestamp: z.ZodDefault<z.ZodBoolean>;
54
- }, z.core.$strip>;
140
+ tagRemIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
141
+ }, z.core.$strict>;
55
142
  export declare const ReadTableSchema: z.ZodObject<{
56
143
  tableRemId: z.ZodOptional<z.ZodString>;
57
144
  tableTitle: z.ZodOptional<z.ZodString>;
@@ -1,28 +1,32 @@
1
1
  import { z } from 'zod';
2
- export const CreateNoteSchema = z
3
- .object({
4
- title: z.string().optional().describe('The title of the note'),
5
- content: z.string().optional().describe('Content as child bullets (markdown supported)'),
6
- parentId: z.string().optional().describe('Parent Rem ID'),
7
- tags: z.array(z.string()).optional().describe('Tags to apply'),
8
- })
9
- .refine((value) => value.title !== undefined || value.content !== undefined, {
10
- message: 'create_note requires either title or content',
11
- });
12
- export const SearchSchema = z.object({
13
- query: z.string().describe('Search query text'),
14
- limit: z.number().int().min(1).max(150).default(50).describe('Maximum results'),
15
- includeContent: z
16
- .enum(['none', 'markdown', 'structured'])
17
- .default('none')
18
- .describe('Content rendering mode: "none" omits content, "markdown" renders child subtree, "structured" returns nested child objects with remIds'),
2
+ const ContentModeSchema = z.enum(['none', 'markdown', 'structured']);
3
+ const ViewSchema = z.enum(['compact', 'standard', 'full']);
4
+ const RemClassificationSchema = z.enum([
5
+ 'document',
6
+ 'dailyDocument',
7
+ 'concept',
8
+ 'descriptor',
9
+ 'portal',
10
+ 'text',
11
+ ]);
12
+ const AncestorDepthSchema = z
13
+ .number()
14
+ .int()
15
+ .min(0)
16
+ .max(20)
17
+ .default(0)
18
+ .describe('Number of parent Rems to include, direct parent first');
19
+ const SearchContentShape = {
20
+ contentMode: ContentModeSchema.default('none').describe('Content rendering mode: "none" omits content, "markdown" renders child subtree, "structured" returns nested child objects with remIds'),
21
+ view: ViewSchema.default('standard').describe('Output detail level: compact, standard, or full'),
22
+ ancestorDepth: AncestorDepthSchema,
19
23
  depth: z
20
24
  .number()
21
25
  .int()
22
26
  .min(0)
23
27
  .max(10)
24
28
  .default(1)
25
- .describe('Depth of child hierarchy to render (when includeContent is markdown or structured)'),
29
+ .describe('Depth of child hierarchy to render when contentMode is markdown or structured'),
26
30
  childLimit: z
27
31
  .number()
28
32
  .int()
@@ -37,43 +41,68 @@ export const SearchSchema = z.object({
37
41
  .max(200000)
38
42
  .default(3000)
39
43
  .describe('Maximum character length for rendered content'),
44
+ };
45
+ export const CreateNoteSchema = z
46
+ .object({
47
+ title: z.string().optional().describe('The title of the note'),
48
+ content: z.string().optional().describe('Content as child bullets (markdown supported)'),
49
+ parentId: z.string().optional().describe('Parent Rem ID'),
50
+ tagRemIds: z.array(z.string()).optional().describe('Exact tag Rem IDs to apply'),
51
+ asDocument: z
52
+ .boolean()
53
+ .optional()
54
+ .describe('Mark the created title/root Rem as a document without changing card status'),
55
+ })
56
+ .strict()
57
+ .refine((value) => value.title !== undefined || value.content !== undefined, {
58
+ message: 'create_note requires either title or content',
40
59
  });
41
- export const SearchByTagSchema = z.object({
42
- tag: z.string().min(1).describe('Tag name to search (with or without # prefix)'),
60
+ export const SearchSchema = z
61
+ .object({
62
+ query: z.string().describe('Search query text'),
43
63
  limit: z.number().int().min(1).max(150).default(50).describe('Maximum results'),
44
- includeContent: z
45
- .enum(['none', 'markdown', 'structured'])
46
- .default('none')
47
- .describe('Content rendering mode: "none" omits content, "markdown" renders child subtree, "structured" returns nested child objects with remIds'),
48
- depth: z
49
- .number()
50
- .int()
51
- .min(0)
52
- .max(10)
53
- .default(1)
54
- .describe('Depth of child hierarchy to render (when includeContent is markdown or structured)'),
55
- childLimit: z
64
+ cursor: z
65
+ .string()
66
+ .optional()
67
+ .describe('Opaque cursor returned by a previous remnote_search page'),
68
+ ...SearchContentShape,
69
+ })
70
+ .strict();
71
+ export const SearchByTagSchema = z
72
+ .object({
73
+ tagRemId: z.string().min(1).describe('Exact tag Rem ID to search'),
74
+ resultMode: z
75
+ .enum(['context', 'tagged'])
76
+ .default('context')
77
+ .describe('"context" returns resolved ancestor context targets with matchedRems; "tagged" returns directly tagged Rems with context metadata'),
78
+ limit: z.number().int().min(1).max(150).default(50).describe('Maximum results'),
79
+ cursor: z
80
+ .string()
81
+ .optional()
82
+ .describe('Opaque cursor returned by a previous remnote_search_by_tag page'),
83
+ timeoutMs: z
56
84
  .number()
57
85
  .int()
58
86
  .min(1)
59
- .max(500)
60
- .default(20)
61
- .describe('Maximum children per level in rendered content'),
62
- maxContentLength: z
87
+ .max(60000)
88
+ .optional()
89
+ .describe('Per-call bridge wait timeout in milliseconds (default: 15000, max: 60000)'),
90
+ ...SearchContentShape,
91
+ })
92
+ .strict();
93
+ export const ReadNoteSchema = z
94
+ .object({
95
+ remId: z.string().describe('The Rem ID to read'),
96
+ depth: z
63
97
  .number()
64
98
  .int()
65
- .min(100)
66
- .max(200000)
67
- .default(3000)
68
- .describe('Maximum character length for rendered content'),
69
- });
70
- export const ReadNoteSchema = z.object({
71
- remId: z.string().describe('The Rem ID to read'),
72
- depth: z.number().int().min(0).max(10).default(5).describe('Depth of child hierarchy to render'),
73
- includeContent: z
74
- .enum(['none', 'markdown', 'structured'])
75
- .default('markdown')
76
- .describe('Content rendering mode: "none" omits content, "markdown" renders child subtree, "structured" returns nested child objects with remIds'),
99
+ .min(0)
100
+ .max(10)
101
+ .default(5)
102
+ .describe('Depth of child hierarchy to render'),
103
+ contentMode: ContentModeSchema.default('markdown').describe('Content rendering mode: "none" omits content, "markdown" renders child subtree, "structured" returns nested child objects with remIds'),
104
+ view: ViewSchema.default('standard').describe('Output detail level: compact, standard, or full'),
105
+ ancestorDepth: AncestorDepthSchema,
77
106
  childLimit: z
78
107
  .number()
79
108
  .int()
@@ -88,27 +117,117 @@ export const ReadNoteSchema = z.object({
88
117
  .max(200000)
89
118
  .default(100000)
90
119
  .describe('Maximum character length for rendered content'),
120
+ })
121
+ .strict();
122
+ export const ListChildrenSchema = z
123
+ .object({
124
+ parentRemId: z.string().min(1).describe('Parent Rem ID whose direct children should be listed'),
125
+ limit: z.number().int().min(1).max(150).default(50).describe('Maximum direct children'),
126
+ cursor: z
127
+ .string()
128
+ .optional()
129
+ .describe('Opaque cursor returned by a previous remnote_list_children page'),
130
+ view: ViewSchema.default('compact').describe('Output detail level for child metadata: compact, standard, or full'),
131
+ ancestorDepth: AncestorDepthSchema,
132
+ })
133
+ .strict();
134
+ export const InsertChildrenPositionSchema = z.enum(['first', 'last', 'before', 'after']);
135
+ export const MoveNoteSchema = z
136
+ .object({
137
+ remId: z.string().min(1).describe('Rem ID to move'),
138
+ newParentRemId: z.string().min(1).describe('New parent Rem ID'),
139
+ position: InsertChildrenPositionSchema.default('last').describe('Where to place the moved Rem under the new parent'),
140
+ siblingRemId: z.string().optional().describe('Sibling Rem ID required for before/after'),
141
+ dryRun: z.boolean().default(true).describe('Preview the move without mutating RemNote'),
142
+ expectedOldParentRemId: z
143
+ .string()
144
+ .optional()
145
+ .describe('Reject if the Rem current direct parent is different from this Rem ID'),
146
+ ancestorDepth: AncestorDepthSchema,
147
+ })
148
+ .strict()
149
+ .superRefine((value, ctx) => {
150
+ if ((value.position === 'before' || value.position === 'after') && !value.siblingRemId) {
151
+ ctx.addIssue({
152
+ code: z.ZodIssueCode.custom,
153
+ message: `siblingRemId is required when position is ${value.position}`,
154
+ path: ['siblingRemId'],
155
+ });
156
+ }
157
+ if ((value.position === 'first' || value.position === 'last') && value.siblingRemId) {
158
+ ctx.addIssue({
159
+ code: z.ZodIssueCode.custom,
160
+ message: `siblingRemId must not be provided when position is ${value.position}`,
161
+ path: ['siblingRemId'],
162
+ });
163
+ }
91
164
  });
92
165
  export const UpdateNoteSchema = z
93
166
  .object({
94
167
  remId: z.string().describe('The Rem ID to update'),
95
168
  title: z.string().optional().describe('New title'),
96
- appendContent: z.string().optional().describe('Content to append as children'),
97
- replaceContent: z
98
- .string()
99
- .optional()
100
- .describe('Content to replace direct children (empty string clears children)'),
101
- addTags: z.array(z.string()).optional().describe('Tags to add'),
102
- removeTags: z.array(z.string()).optional().describe('Tags to remove'),
103
169
  })
104
- .refine((value) => !(value.appendContent !== undefined && value.replaceContent !== undefined), {
105
- message: 'appendContent and replaceContent cannot be used together',
106
- path: ['replaceContent'],
170
+ .strict()
171
+ .refine((value) => value.title !== undefined, {
172
+ message: 'remnote_update_note requires title',
173
+ path: ['title'],
107
174
  });
108
- export const AppendJournalSchema = z.object({
175
+ export const SetDocumentStatusSchema = z
176
+ .object({
177
+ remId: z.string().min(1).describe('The Rem ID whose document status should change'),
178
+ isDocument: z.boolean().describe('Whether the Rem should be marked as a document'),
179
+ dryRun: z.boolean().default(true).describe('Preview the change without mutating RemNote'),
180
+ expectedOldRemType: RemClassificationSchema.optional().describe('Reject if the current bridge remType differs from this stale-context guard'),
181
+ })
182
+ .strict();
183
+ export const InsertChildrenSchema = z
184
+ .object({
185
+ parentRemId: z.string().describe('Parent Rem ID that will receive the new children'),
186
+ content: z.string().describe('Markdown content to insert as child Rems'),
187
+ position: InsertChildrenPositionSchema.describe('Where to insert the new child Rems'),
188
+ siblingRemId: z.string().optional().describe('Sibling Rem ID required for before/after'),
189
+ })
190
+ .strict()
191
+ .superRefine((value, ctx) => {
192
+ if ((value.position === 'before' || value.position === 'after') && !value.siblingRemId) {
193
+ ctx.addIssue({
194
+ code: z.ZodIssueCode.custom,
195
+ message: `siblingRemId is required when position is ${value.position}`,
196
+ path: ['siblingRemId'],
197
+ });
198
+ }
199
+ if ((value.position === 'first' || value.position === 'last') && value.siblingRemId) {
200
+ ctx.addIssue({
201
+ code: z.ZodIssueCode.custom,
202
+ message: `siblingRemId must not be provided when position is ${value.position}`,
203
+ path: ['siblingRemId'],
204
+ });
205
+ }
206
+ });
207
+ export const ReplaceChildrenSchema = z
208
+ .object({
209
+ parentRemId: z.string().describe('Parent Rem ID whose direct children will be replaced'),
210
+ content: z.string().describe('Markdown content to use as replacement children'),
211
+ })
212
+ .strict();
213
+ export const UpdateTagsSchema = z
214
+ .object({
215
+ remId: z.string().describe('The Rem ID whose tags should change'),
216
+ addTagRemIds: z.array(z.string()).optional().describe('Exact tag Rem IDs to add'),
217
+ removeTagRemIds: z.array(z.string()).optional().describe('Exact tag Rem IDs to remove'),
218
+ })
219
+ .strict()
220
+ .refine((value) => Boolean(value.addTagRemIds?.length || value.removeTagRemIds?.length), {
221
+ message: 'remnote_update_tags requires addTagRemIds or removeTagRemIds',
222
+ path: ['addTagRemIds'],
223
+ });
224
+ export const AppendJournalSchema = z
225
+ .object({
109
226
  content: z.string().describe("Content to append to today's daily document"),
110
227
  timestamp: z.boolean().default(true).describe('Include timestamp'),
111
- });
228
+ tagRemIds: z.array(z.string()).optional().describe('Exact tag Rem IDs to apply'),
229
+ })
230
+ .strict();
112
231
  export const ReadTableSchema = z
113
232
  .object({
114
233
  tableRemId: z.string().min(1).optional().describe('Table Rem ID'),
@@ -1 +1 @@
1
- {"version":3,"file":"remnote-schemas.js","sourceRoot":"","sources":["../../src/schemas/remnote-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,C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andlerOptions {
7
+ logger: Pick<Logger, 'info' | 'warn' | 'error'>;
8
+ httpServer: StoppableServer;
9
+ wsServer: StoppableServer;
10
+ timeoutMs?: number;
11
+ exit?: (code: number) => never | void;
12
+ }
13
+ export type ShutdownHandler = (signal?: NodeJS.Signals) => Promise<void>;
14
+ export declare function createShutdownHandler({ logger, httpServer, wsServer, timeoutMs, exit, }: ShutdownHandlerOptions): ShutdownHandler;
15
+ export {};
@@ -0,0 +1,59 @@
1
+ export const DEFAULT_SHUTDOWN_TIMEOUT_MS = 5000;
2
+ export function createShutdownHandler({ logger, httpServer, wsServer, timeoutMs = DEFAULT_SHUTDOWN_TIMEOUT_MS, exit = process.exit, }) {
3
+ let shutdownStarted = false;
4
+ let exitRequested = false;
5
+ const exitOnce = (code) => {
6
+ if (exitRequested) {
7
+ return;
8
+ }
9
+ exitRequested = true;
10
+ exit(code);
11
+ };
12
+ return async (signal) => {
13
+ if (shutdownStarted) {
14
+ logger.warn({ signal }, 'Shutdown already in progress; forcing exit');
15
+ exitOnce(1);
16
+ return;
17
+ }
18
+ shutdownStarted = true;
19
+ if (signal) {
20
+ logger.info({ signal }, 'Shutting down');
21
+ }
22
+ else {
23
+ logger.info('Shutting down');
24
+ }
25
+ let timeout;
26
+ const timeoutPromise = new Promise((resolve) => {
27
+ timeout = setTimeout(() => resolve('timeout'), timeoutMs);
28
+ timeout.unref();
29
+ });
30
+ const cleanupPromise = (async () => {
31
+ await httpServer.stop();
32
+ await wsServer.stop();
33
+ return 'stopped';
34
+ })();
35
+ cleanupPromise.catch(() => {
36
+ // The main race handles immediate failures; this suppresses late rejections after timeout exit.
37
+ });
38
+ try {
39
+ const result = await Promise.race([cleanupPromise, timeoutPromise]);
40
+ if (timeout) {
41
+ clearTimeout(timeout);
42
+ }
43
+ if (result === 'timeout') {
44
+ logger.error({ timeoutMs }, 'Shutdown timed out; forcing exit');
45
+ exitOnce(1);
46
+ return;
47
+ }
48
+ exitOnce(0);
49
+ }
50
+ catch (error) {
51
+ if (timeout) {
52
+ clearTimeout(timeout);
53
+ }
54
+ logger.error({ err: error }, 'Shutdown failed; forcing exit');
55
+ exitOnce(1);
56
+ }
57
+ };
58
+ }
59
+ //# sourceMappingURL=shutdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shutdown.js","sourceRoot":"","sources":["../src/shutdown.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAgBhD,MAAM,UAAU,qBAAqB,CAAC,EACpC,MAAM,EACN,UAAU,EACV,QAAQ,EACR,SAAS,GAAG,2BAA2B,EACvC,IAAI,GAAG,OAAO,CAAC,IAAI,GACI;IACvB,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,IAAI,aAAa,GAAG,KAAK,CAAC;IAE1B,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE;QAChC,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO;QACT,CAAC;QACD,aAAa,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,CAAC,CAAC;IAEF,OAAO,KAAK,EAAE,MAAuB,EAAE,EAAE;QACvC,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,4CAA4C,CAAC,CAAC;YACtE,QAAQ,CAAC,CAAC,CAAC,CAAC;YACZ,OAAO;QACT,CAAC;QAED,eAAe,GAAG,IAAI,CAAC;QACvB,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,eAAe,CAAC,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC/B,CAAC;QAED,IAAI,OAAmC,CAAC;QACxC,MAAM,cAAc,GAAG,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;YACxD,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,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