portercode 0.1.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 (112) hide show
  1. package/LICENSE +123 -0
  2. package/NOTICE +45 -0
  3. package/README.md +178 -0
  4. package/dist/auth/index.d.ts +103 -0
  5. package/dist/bus/bus-event.d.ts +10 -0
  6. package/dist/bus/global.d.ts +7 -0
  7. package/dist/bus/index.d.ts +26 -0
  8. package/dist/cli/auth.d.ts +11 -0
  9. package/dist/cli/index.d.ts +1 -0
  10. package/dist/cli/ui.d.ts +26 -0
  11. package/dist/command/index.d.ts +54 -0
  12. package/dist/config/config.d.ts +6756 -0
  13. package/dist/config/index.d.ts +2 -0
  14. package/dist/config/markdown.d.ts +415 -0
  15. package/dist/constants/index.d.ts +9 -0
  16. package/dist/diff/engine.d.ts +15 -0
  17. package/dist/diff/index.d.ts +8 -0
  18. package/dist/diff/types.d.ts +66 -0
  19. package/dist/file/ignore.d.ts +7 -0
  20. package/dist/flag/index.d.ts +19 -0
  21. package/dist/gateway/bridge.d.ts +11 -0
  22. package/dist/gateway/handlers/llm.d.ts +7 -0
  23. package/dist/gateway/handlers/permission.d.ts +15 -0
  24. package/dist/gateway/handlers/session.d.ts +7 -0
  25. package/dist/gateway/handlers/system.d.ts +7 -0
  26. package/dist/gateway/handlers/tool.d.ts +7 -0
  27. package/dist/gateway/index.d.ts +17 -0
  28. package/dist/gateway/protocol.d.ts +159 -0
  29. package/dist/gateway/router.d.ts +7 -0
  30. package/dist/gateway/server.d.ts +24 -0
  31. package/dist/global/index.d.ts +11 -0
  32. package/dist/index.d.ts +2 -0
  33. package/dist/index.js +2 -0
  34. package/dist/permission/index.d.ts +2 -0
  35. package/dist/permission/permission.d.ts +172 -0
  36. package/dist/permission/types.d.ts +109 -0
  37. package/dist/project/index.d.ts +3 -0
  38. package/dist/project/instance.d.ts +33 -0
  39. package/dist/project/project.d.ts +82 -0
  40. package/dist/project/state.d.ts +4 -0
  41. package/dist/prompt/index.d.ts +5 -0
  42. package/dist/prompt/system.d.ts +24 -0
  43. package/dist/provider/index.d.ts +3 -0
  44. package/dist/provider/models.d.ts +17 -0
  45. package/dist/provider/provider.d.ts +844 -0
  46. package/dist/provider/types.d.ts +328 -0
  47. package/dist/session/context-optimization.d.ts +160 -0
  48. package/dist/session/index.d.ts +4 -0
  49. package/dist/session/llm.d.ts +29 -0
  50. package/dist/session/session.d.ts +400 -0
  51. package/dist/session/types.d.ts +544 -0
  52. package/dist/snapshot/index.d.ts +40 -0
  53. package/dist/storage/index.d.ts +1 -0
  54. package/dist/storage/storage.d.ts +34 -0
  55. package/dist/tool/bash.d.ts +19 -0
  56. package/dist/tool/edit.d.ts +21 -0
  57. package/dist/tool/glob.d.ts +15 -0
  58. package/dist/tool/grep.d.ts +20 -0
  59. package/dist/tool/image.d.ts +23 -0
  60. package/dist/tool/index.d.ts +11 -0
  61. package/dist/tool/ls.d.ts +14 -0
  62. package/dist/tool/read.d.ts +17 -0
  63. package/dist/tool/registry.d.ts +30 -0
  64. package/dist/tool/todo.d.ts +76 -0
  65. package/dist/tool/tool.d.ts +65 -0
  66. package/dist/tool/write.d.ts +16 -0
  67. package/dist/tui/App.d.ts +10 -0
  68. package/dist/tui/components/Header.d.ts +12 -0
  69. package/dist/tui/components/Message/AssistantMessage.d.ts +10 -0
  70. package/dist/tui/components/Message/ReasoningMessage.d.ts +20 -0
  71. package/dist/tui/components/Message/ToolCallMessage.d.ts +25 -0
  72. package/dist/tui/components/Message/UserMessage.d.ts +11 -0
  73. package/dist/tui/components/Message/index.d.ts +13 -0
  74. package/dist/tui/components/PermissionPrompt.d.ts +6 -0
  75. package/dist/tui/components/PromptInput.d.ts +32 -0
  76. package/dist/tui/components/REPL.d.ts +17 -0
  77. package/dist/tui/components/Spinner.d.ts +13 -0
  78. package/dist/tui/components/StatusBar.d.ts +12 -0
  79. package/dist/tui/components/TodoList.d.ts +17 -0
  80. package/dist/tui/components/WelcomeBox.d.ts +13 -0
  81. package/dist/tui/components/dialogs/DiagnosticsPanel.d.ts +12 -0
  82. package/dist/tui/components/dialogs/HelpPanel.d.ts +11 -0
  83. package/dist/tui/components/dialogs/ModelSelector.d.ts +14 -0
  84. package/dist/tui/components/dialogs/PermissionPrompt.d.ts +17 -0
  85. package/dist/tui/components/dialogs/SessionPicker.d.ts +15 -0
  86. package/dist/tui/components/dialogs/index.d.ts +10 -0
  87. package/dist/tui/components/diff/DiffHunk.d.ts +12 -0
  88. package/dist/tui/components/diff/DiffLine.d.ts +14 -0
  89. package/dist/tui/components/diff/DiffStats.d.ts +12 -0
  90. package/dist/tui/components/diff/DiffView.d.ts +15 -0
  91. package/dist/tui/components/diff/index.d.ts +9 -0
  92. package/dist/tui/hooks/usePermission.d.ts +26 -0
  93. package/dist/tui/index.d.ts +15 -0
  94. package/dist/tui/theme.d.ts +27 -0
  95. package/dist/tui/utils/Cursor.d.ts +37 -0
  96. package/dist/tui/utils/clipboard.d.ts +3 -0
  97. package/dist/tui/utils/keypress.d.ts +39 -0
  98. package/dist/tui/utils/markdown.d.ts +13 -0
  99. package/dist/tui/utils/openContent.d.ts +22 -0
  100. package/dist/util/context.d.ts +10 -0
  101. package/dist/util/debug.d.ts +51 -0
  102. package/dist/util/error.d.ts +294 -0
  103. package/dist/util/example-commands.d.ts +18 -0
  104. package/dist/util/filesystem.d.ts +17 -0
  105. package/dist/util/id.d.ts +24 -0
  106. package/dist/util/iife.d.ts +1 -0
  107. package/dist/util/index.d.ts +7 -0
  108. package/dist/util/lazy.d.ts +1 -0
  109. package/dist/util/log.d.ts +26 -0
  110. package/dist/util/timeout.d.ts +1 -0
  111. package/dist/util/wildcard.d.ts +8 -0
  112. package/package.json +72 -0
@@ -0,0 +1,26 @@
1
+ /**
2
+ * usePermission Hook
3
+ *
4
+ * Manages permission request state and responses.
5
+ */
6
+ export declare function usePermission(): {
7
+ pending: {
8
+ id: string;
9
+ tool: string;
10
+ action: string;
11
+ description: string;
12
+ risk: "low" | "medium" | "high";
13
+ details?: Record<string, any> | undefined;
14
+ }[];
15
+ current: {
16
+ id: string;
17
+ tool: string;
18
+ action: string;
19
+ description: string;
20
+ risk: "low" | "medium" | "high";
21
+ details?: Record<string, any> | undefined;
22
+ };
23
+ hasPending: boolean;
24
+ grant: (always?: boolean) => void;
25
+ deny: () => void;
26
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * TUI Entry Point
3
+ *
4
+ * Provides the main tui() function that renders the terminal interface.
5
+ */
6
+ export { themes, getTheme, setTheme, getThemeNames } from "./theme";
7
+ export type { Theme } from "./theme";
8
+ export interface TuiOptions {
9
+ sessionId?: string;
10
+ onExit?: () => Promise<void>;
11
+ }
12
+ /**
13
+ * Start the Terminal User Interface
14
+ */
15
+ export declare function tui(options?: TuiOptions): Promise<void>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * TUI Theme System
3
+ *
4
+ * Defines colors and styling for the terminal interface.
5
+ */
6
+ export interface Theme {
7
+ name: string;
8
+ background: string;
9
+ foreground: string;
10
+ text: string;
11
+ primary: string;
12
+ secondary: string;
13
+ success: string;
14
+ warning: string;
15
+ error: string;
16
+ muted: string;
17
+ border: string;
18
+ selection: string;
19
+ diffAdd: string;
20
+ diffRemove: string;
21
+ diffContext: string;
22
+ diffHunkHeader: string;
23
+ }
24
+ export declare const themes: Record<string, Theme>;
25
+ export declare function getTheme(): Theme;
26
+ export declare function setTheme(name: string): void;
27
+ export declare function getThemeNames(): string[];
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Cursor Utility
3
+ *
4
+ * Manages cursor position for multiline text editing.
5
+ * Immutable class - all operations return new Cursor instances.
6
+ */
7
+ export declare class Cursor {
8
+ readonly text: string;
9
+ readonly offset: number;
10
+ constructor(text: string, offset?: number);
11
+ get line(): number;
12
+ get column(): number;
13
+ get lines(): string[];
14
+ get currentLine(): string;
15
+ get textBefore(): string;
16
+ get textAfter(): string;
17
+ left(): Cursor;
18
+ right(): Cursor;
19
+ up(): Cursor;
20
+ down(): Cursor;
21
+ lineStart(): Cursor;
22
+ lineEnd(): Cursor;
23
+ start(): Cursor;
24
+ end(): Cursor;
25
+ nextWord(): Cursor;
26
+ prevWord(): Cursor;
27
+ insert(str: string): Cursor;
28
+ delete(): Cursor;
29
+ backspace(): Cursor;
30
+ deleteWord(): Cursor;
31
+ deleteWordBack(): Cursor;
32
+ deleteToEnd(): Cursor;
33
+ deleteToStart(): Cursor;
34
+ clear(): Cursor;
35
+ render(cursorChar?: string, showCursor?: boolean): string;
36
+ renderInverted(): string;
37
+ }
@@ -0,0 +1,3 @@
1
+ export declare namespace Clipboard {
2
+ function copy(text: string): Promise<void>;
3
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Extended keypress detection for CSI u encoding and other special sequences.
3
+ *
4
+ * Some modern terminals (Kitty, WezTerm, iTerm2 with settings) support CSI u encoding
5
+ * which sends distinct sequences for modifier+key combinations.
6
+ *
7
+ * CSI u format: \x1b[<keycode>;<modifier>u
8
+ * Modifier bits: 1=Shift, 2=Alt, 4=Ctrl, 8=Super
9
+ *
10
+ * For Enter (keycode 13):
11
+ * - Enter: \x1b[13u or just \r
12
+ * - Shift+Enter: \x1b[13;2u
13
+ * - Ctrl+Enter: \x1b[13;5u
14
+ * - Alt+Enter: \x1b[13;3u
15
+ */
16
+ export interface ExtendedKey {
17
+ keycode: number;
18
+ shift: boolean;
19
+ ctrl: boolean;
20
+ alt: boolean;
21
+ meta: boolean;
22
+ }
23
+ /**
24
+ * Parse CSI u encoded key sequence.
25
+ * Returns null if not a CSI u sequence.
26
+ */
27
+ export declare function parseCSIu(sequence: string): ExtendedKey | null;
28
+ /**
29
+ * Check if input represents Shift+Enter in any encoding.
30
+ */
31
+ export declare function isShiftEnter(input: string, rawSequence?: string): boolean;
32
+ /**
33
+ * Check if input represents Enter (with or without modifiers) using CSI u encoding.
34
+ */
35
+ export declare function isEnterCSIu(input: string): {
36
+ isEnter: boolean;
37
+ shift: boolean;
38
+ ctrl: boolean;
39
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Markdown Rendering for Terminal
3
+ *
4
+ * Converts markdown to styled terminal output using chalk.
5
+ */
6
+ /**
7
+ * Render markdown to styled terminal text
8
+ */
9
+ export declare function renderMarkdown(content: string): string;
10
+ /**
11
+ * Truncate text to a maximum number of lines
12
+ */
13
+ export declare function truncateLines(text: string, maxLines: number): string;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Open Content Utility
3
+ *
4
+ * Detects VS Code environment and opens content in appropriate viewer.
5
+ * Writes content to temp file and opens with VS Code or default app.
6
+ */
7
+ /**
8
+ * Check if running inside VS Code terminal
9
+ */
10
+ export declare function isVSCodeTerminal(): boolean;
11
+ export interface OpenContentOptions {
12
+ toolName: string;
13
+ toolId: string;
14
+ args: Record<string, any>;
15
+ output: string;
16
+ }
17
+ /**
18
+ * Open tool output content in VS Code or default app
19
+ *
20
+ * Returns the path to the created temp file
21
+ */
22
+ export declare function openToolContent(options: OpenContentOptions): string;
@@ -0,0 +1,10 @@
1
+ export declare namespace Context {
2
+ class NotFound extends Error {
3
+ readonly name: string;
4
+ constructor(name: string);
5
+ }
6
+ function create<T>(name: string): {
7
+ use(): NonNullable<T>;
8
+ provide<R>(value: T, fn: () => R): R;
9
+ };
10
+ }
@@ -0,0 +1,51 @@
1
+ export declare function initDebug(enabled: boolean): void;
2
+ export declare function isDebugEnabled(): boolean;
3
+ export declare function getDebugFilePath(): string;
4
+ export declare function createDebugLogger(prefix: string): {
5
+ log: (...args: any[]) => void;
6
+ error: (...args: any[]) => void;
7
+ warn: (...args: any[]) => void;
8
+ info: (...args: any[]) => void;
9
+ };
10
+ export declare const debugCLI: {
11
+ log: (...args: any[]) => void;
12
+ error: (...args: any[]) => void;
13
+ warn: (...args: any[]) => void;
14
+ info: (...args: any[]) => void;
15
+ };
16
+ export declare const debugSession: {
17
+ log: (...args: any[]) => void;
18
+ error: (...args: any[]) => void;
19
+ warn: (...args: any[]) => void;
20
+ info: (...args: any[]) => void;
21
+ };
22
+ export declare const debugLLM: {
23
+ log: (...args: any[]) => void;
24
+ error: (...args: any[]) => void;
25
+ warn: (...args: any[]) => void;
26
+ info: (...args: any[]) => void;
27
+ };
28
+ export declare const debugTool: {
29
+ log: (...args: any[]) => void;
30
+ error: (...args: any[]) => void;
31
+ warn: (...args: any[]) => void;
32
+ info: (...args: any[]) => void;
33
+ };
34
+ export declare const debugStream: {
35
+ log: (...args: any[]) => void;
36
+ error: (...args: any[]) => void;
37
+ warn: (...args: any[]) => void;
38
+ info: (...args: any[]) => void;
39
+ };
40
+ export declare const debugPermission: {
41
+ log: (...args: any[]) => void;
42
+ error: (...args: any[]) => void;
43
+ warn: (...args: any[]) => void;
44
+ info: (...args: any[]) => void;
45
+ };
46
+ export declare const debugUI: {
47
+ log: (...args: any[]) => void;
48
+ error: (...args: any[]) => void;
49
+ warn: (...args: any[]) => void;
50
+ info: (...args: any[]) => void;
51
+ };
@@ -0,0 +1,294 @@
1
+ import z from "zod";
2
+ export declare abstract class NamedError extends Error {
3
+ abstract schema(): z.ZodType;
4
+ abstract toObject(): {
5
+ name: string;
6
+ data: any;
7
+ };
8
+ static create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): {
9
+ new (data: z.input<Data>, options?: ErrorOptions): {
10
+ readonly name: Name;
11
+ readonly data: z.input<Data>;
12
+ schema(): z.ZodObject<{
13
+ name: z.ZodLiteral<Name>;
14
+ data: Data;
15
+ }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
16
+ name: z.ZodLiteral<Name>;
17
+ data: Data;
18
+ }>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<{
19
+ name: z.ZodLiteral<Name>;
20
+ data: Data;
21
+ }> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
22
+ toObject(): {
23
+ name: Name;
24
+ data: z.input<Data>;
25
+ };
26
+ message: string;
27
+ stack?: string;
28
+ cause?: unknown;
29
+ };
30
+ readonly Schema: z.ZodObject<{
31
+ name: z.ZodLiteral<Name>;
32
+ data: Data;
33
+ }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
34
+ name: z.ZodLiteral<Name>;
35
+ data: Data;
36
+ }>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<{
37
+ name: z.ZodLiteral<Name>;
38
+ data: Data;
39
+ }> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
40
+ isInstance(input: any): input is InstanceType</*elided*/ any>;
41
+ create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): /*elided*/ any;
42
+ readonly Unknown: {
43
+ new (data: {
44
+ message: string;
45
+ }, options?: ErrorOptions): {
46
+ readonly name: "UnknownError";
47
+ readonly data: {
48
+ message: string;
49
+ };
50
+ schema(): z.ZodObject<{
51
+ name: z.ZodLiteral<"UnknownError">;
52
+ data: z.ZodObject<{
53
+ message: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ message: string;
56
+ }, {
57
+ message: string;
58
+ }>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ name: "UnknownError";
61
+ data: {
62
+ message: string;
63
+ };
64
+ }, {
65
+ name: "UnknownError";
66
+ data: {
67
+ message: string;
68
+ };
69
+ }>;
70
+ toObject(): {
71
+ name: "UnknownError";
72
+ data: {
73
+ message: string;
74
+ };
75
+ };
76
+ message: string;
77
+ stack?: string;
78
+ cause?: unknown;
79
+ };
80
+ readonly Schema: z.ZodObject<{
81
+ name: z.ZodLiteral<"UnknownError">;
82
+ data: z.ZodObject<{
83
+ message: z.ZodString;
84
+ }, "strip", z.ZodTypeAny, {
85
+ message: string;
86
+ }, {
87
+ message: string;
88
+ }>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ name: "UnknownError";
91
+ data: {
92
+ message: string;
93
+ };
94
+ }, {
95
+ name: "UnknownError";
96
+ data: {
97
+ message: string;
98
+ };
99
+ }>;
100
+ isInstance(input: any): input is {
101
+ readonly name: "UnknownError";
102
+ readonly data: {
103
+ message: string;
104
+ };
105
+ schema(): z.ZodObject<{
106
+ name: z.ZodLiteral<"UnknownError">;
107
+ data: z.ZodObject<{
108
+ message: z.ZodString;
109
+ }, "strip", z.ZodTypeAny, {
110
+ message: string;
111
+ }, {
112
+ message: string;
113
+ }>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ name: "UnknownError";
116
+ data: {
117
+ message: string;
118
+ };
119
+ }, {
120
+ name: "UnknownError";
121
+ data: {
122
+ message: string;
123
+ };
124
+ }>;
125
+ toObject(): {
126
+ name: "UnknownError";
127
+ data: {
128
+ message: string;
129
+ };
130
+ };
131
+ message: string;
132
+ stack?: string;
133
+ cause?: unknown;
134
+ };
135
+ create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): /*elided*/ any;
136
+ readonly Unknown: /*elided*/ any;
137
+ isError(error: unknown): error is Error;
138
+ isError(value: unknown): value is Error;
139
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
140
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
141
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
142
+ stackTraceLimit: number;
143
+ };
144
+ isError(error: unknown): error is Error;
145
+ isError(value: unknown): value is Error;
146
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
147
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
148
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
149
+ stackTraceLimit: number;
150
+ };
151
+ static readonly Unknown: {
152
+ new (data: {
153
+ message: string;
154
+ }, options?: ErrorOptions): {
155
+ readonly name: "UnknownError";
156
+ readonly data: {
157
+ message: string;
158
+ };
159
+ schema(): z.ZodObject<{
160
+ name: z.ZodLiteral<"UnknownError">;
161
+ data: z.ZodObject<{
162
+ message: z.ZodString;
163
+ }, "strip", z.ZodTypeAny, {
164
+ message: string;
165
+ }, {
166
+ message: string;
167
+ }>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ name: "UnknownError";
170
+ data: {
171
+ message: string;
172
+ };
173
+ }, {
174
+ name: "UnknownError";
175
+ data: {
176
+ message: string;
177
+ };
178
+ }>;
179
+ toObject(): {
180
+ name: "UnknownError";
181
+ data: {
182
+ message: string;
183
+ };
184
+ };
185
+ message: string;
186
+ stack?: string;
187
+ cause?: unknown;
188
+ };
189
+ readonly Schema: z.ZodObject<{
190
+ name: z.ZodLiteral<"UnknownError">;
191
+ data: z.ZodObject<{
192
+ message: z.ZodString;
193
+ }, "strip", z.ZodTypeAny, {
194
+ message: string;
195
+ }, {
196
+ message: string;
197
+ }>;
198
+ }, "strip", z.ZodTypeAny, {
199
+ name: "UnknownError";
200
+ data: {
201
+ message: string;
202
+ };
203
+ }, {
204
+ name: "UnknownError";
205
+ data: {
206
+ message: string;
207
+ };
208
+ }>;
209
+ isInstance(input: any): input is {
210
+ readonly name: "UnknownError";
211
+ readonly data: {
212
+ message: string;
213
+ };
214
+ schema(): z.ZodObject<{
215
+ name: z.ZodLiteral<"UnknownError">;
216
+ data: z.ZodObject<{
217
+ message: z.ZodString;
218
+ }, "strip", z.ZodTypeAny, {
219
+ message: string;
220
+ }, {
221
+ message: string;
222
+ }>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ name: "UnknownError";
225
+ data: {
226
+ message: string;
227
+ };
228
+ }, {
229
+ name: "UnknownError";
230
+ data: {
231
+ message: string;
232
+ };
233
+ }>;
234
+ toObject(): {
235
+ name: "UnknownError";
236
+ data: {
237
+ message: string;
238
+ };
239
+ };
240
+ message: string;
241
+ stack?: string;
242
+ cause?: unknown;
243
+ };
244
+ create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): {
245
+ new (data: z.input<Data>, options?: ErrorOptions): {
246
+ readonly name: Name;
247
+ readonly data: z.input<Data>;
248
+ schema(): z.ZodObject<{
249
+ name: z.ZodLiteral<Name>;
250
+ data: Data;
251
+ }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
252
+ name: z.ZodLiteral<Name>;
253
+ data: Data;
254
+ }>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<{
255
+ name: z.ZodLiteral<Name>;
256
+ data: Data;
257
+ }> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
258
+ toObject(): {
259
+ name: Name;
260
+ data: z.input<Data>;
261
+ };
262
+ message: string;
263
+ stack?: string;
264
+ cause?: unknown;
265
+ };
266
+ readonly Schema: z.ZodObject<{
267
+ name: z.ZodLiteral<Name>;
268
+ data: Data;
269
+ }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
270
+ name: z.ZodLiteral<Name>;
271
+ data: Data;
272
+ }>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<{
273
+ name: z.ZodLiteral<Name>;
274
+ data: Data;
275
+ }> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
276
+ isInstance(input: any): input is InstanceType</*elided*/ any>;
277
+ create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): /*elided*/ any;
278
+ readonly Unknown: /*elided*/ any;
279
+ isError(error: unknown): error is Error;
280
+ isError(value: unknown): value is Error;
281
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
282
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
283
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
284
+ stackTraceLimit: number;
285
+ };
286
+ readonly Unknown: /*elided*/ any;
287
+ isError(error: unknown): error is Error;
288
+ isError(value: unknown): value is Error;
289
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
290
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
291
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
292
+ stackTraceLimit: number;
293
+ };
294
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Example Commands
3
+ *
4
+ * Generates contextual example commands for the prompt placeholder.
5
+ * Similar to code-cli's example suggestions.
6
+ */
7
+ /**
8
+ * Generate a contextual example command
9
+ */
10
+ export declare function getExampleCommand(): string;
11
+ /**
12
+ * Get placeholder text with example command
13
+ */
14
+ export declare function getPlaceholder(): string;
15
+ /**
16
+ * Get multiple unique examples
17
+ */
18
+ export declare function getExamples(count?: number): string[];
@@ -0,0 +1,17 @@
1
+ export declare namespace Filesystem {
2
+ /**
3
+ * On Windows, normalize a path to its canonical casing using the filesystem.
4
+ * This is needed because Windows paths are case-insensitive but LSP servers
5
+ * may return paths with different casing than what we send them.
6
+ */
7
+ function normalizePath(p: string): string;
8
+ function overlaps(a: string, b: string): boolean;
9
+ function contains(parent: string, child: string): boolean;
10
+ function findUp(target: string, start: string, stop?: string): Promise<string[]>;
11
+ function up(options: {
12
+ targets: string[];
13
+ start: string;
14
+ stop?: string;
15
+ }): AsyncGenerator<string, void, unknown>;
16
+ function globUp(pattern: string, start: string, stop?: string): Promise<string[]>;
17
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ID Generation Utilities
3
+ *
4
+ * Provides unique identifier generation for sessions, messages, and parts.
5
+ * Uses timestamp-based sorting with random suffixes for uniqueness.
6
+ */
7
+ /**
8
+ * Generate a timestamp-based ID (ascending order - newer IDs are larger)
9
+ */
10
+ export declare function ascending(prefix: string): string;
11
+ /**
12
+ * Generate a timestamp-based ID (descending order - newer IDs are smaller)
13
+ * Useful for listing sessions in reverse chronological order
14
+ */
15
+ export declare function descending(prefix: string): string;
16
+ /**
17
+ * Generate IDs with specific prefixes
18
+ */
19
+ export declare const Id: {
20
+ session: () => string;
21
+ message: () => string;
22
+ part: () => string;
23
+ random: (prefix?: string) => string;
24
+ };
@@ -0,0 +1 @@
1
+ export declare function iife<T>(fn: () => T): T;
@@ -0,0 +1,7 @@
1
+ export * from "./context";
2
+ export * from "./lazy";
3
+ export * from "./log";
4
+ export * from "./error";
5
+ export * from "./iife";
6
+ export * from "./filesystem";
7
+ export * from "./id";
@@ -0,0 +1 @@
1
+ export declare function lazy<T>(fn: () => T): () => T;
@@ -0,0 +1,26 @@
1
+ import z from "zod";
2
+ export declare namespace Log {
3
+ const Level: z.ZodEnum<["DEBUG", "INFO", "WARN", "ERROR"]>;
4
+ type Level = z.infer<typeof Level>;
5
+ type Logger = {
6
+ debug(message?: any, extra?: Record<string, any>): void;
7
+ info(message?: any, extra?: Record<string, any>): void;
8
+ error(message?: any, extra?: Record<string, any>): void;
9
+ warn(message?: any, extra?: Record<string, any>): void;
10
+ tag(key: string, value: string): Logger;
11
+ clone(): Logger;
12
+ time(message: string, extra?: Record<string, any>): {
13
+ stop(): void;
14
+ [Symbol.dispose](): void;
15
+ };
16
+ };
17
+ const Default: Logger;
18
+ interface Options {
19
+ print: boolean;
20
+ dev?: boolean;
21
+ level?: Level;
22
+ }
23
+ function file(): string;
24
+ function init(options: Options): Promise<void>;
25
+ function create(tags?: Record<string, any>): Logger;
26
+ }
@@ -0,0 +1 @@
1
+ export declare function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T>;
@@ -0,0 +1,8 @@
1
+ export declare namespace Wildcard {
2
+ function match(str: string, pattern: string): boolean;
3
+ function all(input: string, patterns: Record<string, any>): any;
4
+ function allStructured(input: {
5
+ head: string;
6
+ tail: string[];
7
+ }, patterns: Record<string, any>): any;
8
+ }