bioscode 0.1.5
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/LICENSE +306 -0
- package/NOTICE +45 -0
- package/README.md +277 -0
- package/dist/auth/index.d.ts +202 -0
- package/dist/brand/index.d.ts +7 -0
- package/dist/brand/loader.d.ts +463 -0
- package/dist/brand/rules.d.ts +25 -0
- package/dist/brand/schema.d.ts +246 -0
- package/dist/bus/bus-event.d.ts +10 -0
- package/dist/bus/global.d.ts +7 -0
- package/dist/bus/index.d.ts +26 -0
- package/dist/cli/auth.d.ts +23 -0
- package/dist/cli/brand.d.ts +6 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/ui.d.ts +26 -0
- package/dist/command/index.d.ts +54 -0
- package/dist/config/config.d.ts +6036 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/markdown.d.ts +415 -0
- package/dist/constants/index.d.ts +6 -0
- package/dist/constants/version.d.ts +5 -0
- package/dist/diff/engine.d.ts +15 -0
- package/dist/diff/index.d.ts +8 -0
- package/dist/diff/types.d.ts +66 -0
- package/dist/file/ignore.d.ts +7 -0
- package/dist/flag/index.d.ts +19 -0
- package/dist/gateway/bridge.d.ts +11 -0
- package/dist/gateway/handlers/llm.d.ts +7 -0
- package/dist/gateway/handlers/permission.d.ts +15 -0
- package/dist/gateway/handlers/session.d.ts +7 -0
- package/dist/gateway/handlers/system.d.ts +7 -0
- package/dist/gateway/handlers/tool.d.ts +7 -0
- package/dist/gateway/index.d.ts +18 -0
- package/dist/gateway/protocol.d.ts +159 -0
- package/dist/gateway/router.d.ts +7 -0
- package/dist/gateway/server.d.ts +24 -0
- package/dist/global/index.d.ts +23 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +34 -0
- package/dist/permission/index.d.ts +2 -0
- package/dist/permission/permission.d.ts +172 -0
- package/dist/permission/types.d.ts +109 -0
- package/dist/project/index.d.ts +3 -0
- package/dist/project/instance.d.ts +33 -0
- package/dist/project/project.d.ts +82 -0
- package/dist/project/state.d.ts +4 -0
- package/dist/prompt/index.d.ts +5 -0
- package/dist/prompt/system.d.ts +29 -0
- package/dist/prompt/template.d.ts +24 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/models.d.ts +14 -0
- package/dist/provider/provider.d.ts +848 -0
- package/dist/provider/types.d.ts +328 -0
- package/dist/server/index.d.ts +21 -0
- package/dist/server/routes/api.d.ts +2 -0
- package/dist/server/routes/auth.d.ts +2 -0
- package/dist/server/routes/events.d.ts +2 -0
- package/dist/server/routes/health.d.ts +2 -0
- package/dist/server/routes/sessions.d.ts +2 -0
- package/dist/server/services/agent.d.ts +40 -0
- package/dist/server/services/permission.d.ts +43 -0
- package/dist/server/sse/emitter.d.ts +57 -0
- package/dist/session/context-cache.d.ts +75 -0
- package/dist/session/context-optimization.d.ts +165 -0
- package/dist/session/index.d.ts +5 -0
- package/dist/session/llm.d.ts +68 -0
- package/dist/session/message-optimizer.d.ts +32 -0
- package/dist/session/session.d.ts +524 -0
- package/dist/session/title-generator.d.ts +11 -0
- package/dist/session/types.d.ts +713 -0
- package/dist/snapshot/index.d.ts +40 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/storage.d.ts +34 -0
- package/dist/theme.d.ts +64 -0
- package/dist/tool/bash.d.ts +19 -0
- package/dist/tool/edit.d.ts +21 -0
- package/dist/tool/glob.d.ts +15 -0
- package/dist/tool/grep.d.ts +20 -0
- package/dist/tool/image.d.ts +22 -0
- package/dist/tool/index.d.ts +11 -0
- package/dist/tool/ls.d.ts +14 -0
- package/dist/tool/read.d.ts +17 -0
- package/dist/tool/registry.d.ts +30 -0
- package/dist/tool/think.d.ts +11 -0
- package/dist/tool/todo.d.ts +76 -0
- package/dist/tool/tool.d.ts +65 -0
- package/dist/tool/webfetch.d.ts +15 -0
- package/dist/tool/write.d.ts +16 -0
- package/dist/tui/App.d.ts +10 -0
- package/dist/tui/components/Header.d.ts +13 -0
- package/dist/tui/components/LoadingIndicator.d.ts +26 -0
- package/dist/tui/components/Message/AssistantMessage.d.ts +11 -0
- package/dist/tui/components/Message/ReasoningMessage.d.ts +21 -0
- package/dist/tui/components/Message/ToolCallMessage.d.ts +26 -0
- package/dist/tui/components/Message/UserMessage.d.ts +12 -0
- package/dist/tui/components/Message/index.d.ts +16 -0
- package/dist/tui/components/PermissionPrompt.d.ts +6 -0
- package/dist/tui/components/PromptInput.d.ts +33 -0
- package/dist/tui/components/REPL.d.ts +22 -0
- package/dist/tui/components/Spinner.d.ts +13 -0
- package/dist/tui/components/StatusBar.d.ts +13 -0
- package/dist/tui/components/TodoList.d.ts +17 -0
- package/dist/tui/components/WelcomeBox.d.ts +13 -0
- package/dist/tui/components/dialogs/DiagnosticsPanel.d.ts +12 -0
- package/dist/tui/components/dialogs/HelpPanel.d.ts +11 -0
- package/dist/tui/components/dialogs/ModelSelector.d.ts +14 -0
- package/dist/tui/components/dialogs/PermissionPrompt.d.ts +17 -0
- package/dist/tui/components/dialogs/SessionPicker.d.ts +20 -0
- package/dist/tui/components/dialogs/index.d.ts +10 -0
- package/dist/tui/components/diff/DiffHunk.d.ts +12 -0
- package/dist/tui/components/diff/DiffLine.d.ts +14 -0
- package/dist/tui/components/diff/DiffStats.d.ts +12 -0
- package/dist/tui/components/diff/DiffView.d.ts +15 -0
- package/dist/tui/components/diff/index.d.ts +9 -0
- package/dist/tui/hooks/useAnimatedLabel.d.ts +12 -0
- package/dist/tui/hooks/usePermission.d.ts +34 -0
- package/dist/tui/hooks/useTermWidth.d.ts +13 -0
- package/dist/tui/index.d.ts +20 -0
- package/dist/tui/theme.d.ts +8 -0
- package/dist/tui/utils/Cursor.d.ts +37 -0
- package/dist/tui/utils/clipboard.d.ts +3 -0
- package/dist/tui/utils/keypress.d.ts +39 -0
- package/dist/tui/utils/markdown.d.ts +13 -0
- package/dist/tui/utils/openContent.d.ts +22 -0
- package/dist/util/ascii.d.ts +22 -0
- package/dist/util/bell.d.ts +14 -0
- package/dist/util/color.d.ts +28 -0
- package/dist/util/context.d.ts +10 -0
- package/dist/util/debug.d.ts +51 -0
- package/dist/util/error.d.ts +294 -0
- package/dist/util/example-commands.d.ts +18 -0
- package/dist/util/filesystem.d.ts +17 -0
- package/dist/util/id.d.ts +24 -0
- package/dist/util/iife.d.ts +1 -0
- package/dist/util/index.d.ts +7 -0
- package/dist/util/lazy.d.ts +1 -0
- package/dist/util/log.d.ts +26 -0
- package/dist/util/paths.d.ts +45 -0
- package/dist/util/shell.d.ts +36 -0
- package/dist/util/timeout.d.ts +1 -0
- package/dist/util/wildcard.d.ts +8 -0
- package/package.json +87 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import matter from "gray-matter";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare namespace ConfigMarkdown {
|
|
4
|
+
const FILE_REGEX: RegExp;
|
|
5
|
+
const SHELL_REGEX: RegExp;
|
|
6
|
+
function files(template: string): RegExpExecArray[];
|
|
7
|
+
function shell(template: string): RegExpExecArray[];
|
|
8
|
+
function parse(filePath: string): Promise<matter.GrayMatterFile<string>>;
|
|
9
|
+
const FrontmatterError: {
|
|
10
|
+
new (data: {
|
|
11
|
+
path: string;
|
|
12
|
+
message: string;
|
|
13
|
+
}, options?: ErrorOptions): {
|
|
14
|
+
readonly name: "ConfigFrontmatterError";
|
|
15
|
+
readonly data: {
|
|
16
|
+
path: string;
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
schema(): z.ZodObject<{
|
|
20
|
+
name: z.ZodLiteral<"ConfigFrontmatterError">;
|
|
21
|
+
data: z.ZodObject<{
|
|
22
|
+
path: z.ZodString;
|
|
23
|
+
message: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
path: string;
|
|
26
|
+
message: string;
|
|
27
|
+
}, {
|
|
28
|
+
path: string;
|
|
29
|
+
message: string;
|
|
30
|
+
}>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
name: "ConfigFrontmatterError";
|
|
33
|
+
data: {
|
|
34
|
+
path: string;
|
|
35
|
+
message: string;
|
|
36
|
+
};
|
|
37
|
+
}, {
|
|
38
|
+
name: "ConfigFrontmatterError";
|
|
39
|
+
data: {
|
|
40
|
+
path: string;
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
}>;
|
|
44
|
+
toObject(): {
|
|
45
|
+
name: "ConfigFrontmatterError";
|
|
46
|
+
data: {
|
|
47
|
+
path: string;
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
message: string;
|
|
52
|
+
stack?: string;
|
|
53
|
+
cause?: unknown;
|
|
54
|
+
};
|
|
55
|
+
readonly Schema: z.ZodObject<{
|
|
56
|
+
name: z.ZodLiteral<"ConfigFrontmatterError">;
|
|
57
|
+
data: z.ZodObject<{
|
|
58
|
+
path: z.ZodString;
|
|
59
|
+
message: z.ZodString;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
path: string;
|
|
62
|
+
message: string;
|
|
63
|
+
}, {
|
|
64
|
+
path: string;
|
|
65
|
+
message: string;
|
|
66
|
+
}>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
name: "ConfigFrontmatterError";
|
|
69
|
+
data: {
|
|
70
|
+
path: string;
|
|
71
|
+
message: string;
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
name: "ConfigFrontmatterError";
|
|
75
|
+
data: {
|
|
76
|
+
path: string;
|
|
77
|
+
message: string;
|
|
78
|
+
};
|
|
79
|
+
}>;
|
|
80
|
+
isInstance(input: any): input is {
|
|
81
|
+
readonly name: "ConfigFrontmatterError";
|
|
82
|
+
readonly data: {
|
|
83
|
+
path: string;
|
|
84
|
+
message: string;
|
|
85
|
+
};
|
|
86
|
+
schema(): z.ZodObject<{
|
|
87
|
+
name: z.ZodLiteral<"ConfigFrontmatterError">;
|
|
88
|
+
data: z.ZodObject<{
|
|
89
|
+
path: z.ZodString;
|
|
90
|
+
message: z.ZodString;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
path: string;
|
|
93
|
+
message: string;
|
|
94
|
+
}, {
|
|
95
|
+
path: string;
|
|
96
|
+
message: string;
|
|
97
|
+
}>;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
name: "ConfigFrontmatterError";
|
|
100
|
+
data: {
|
|
101
|
+
path: string;
|
|
102
|
+
message: string;
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
name: "ConfigFrontmatterError";
|
|
106
|
+
data: {
|
|
107
|
+
path: string;
|
|
108
|
+
message: string;
|
|
109
|
+
};
|
|
110
|
+
}>;
|
|
111
|
+
toObject(): {
|
|
112
|
+
name: "ConfigFrontmatterError";
|
|
113
|
+
data: {
|
|
114
|
+
path: string;
|
|
115
|
+
message: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
message: string;
|
|
119
|
+
stack?: string;
|
|
120
|
+
cause?: unknown;
|
|
121
|
+
};
|
|
122
|
+
create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): {
|
|
123
|
+
new (data: z.input<Data>, options?: ErrorOptions): {
|
|
124
|
+
readonly name: Name;
|
|
125
|
+
readonly data: z.input<Data>;
|
|
126
|
+
schema(): z.ZodObject<{
|
|
127
|
+
name: z.ZodLiteral<Name>;
|
|
128
|
+
data: Data;
|
|
129
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
130
|
+
name: z.ZodLiteral<Name>;
|
|
131
|
+
data: Data;
|
|
132
|
+
}>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<{
|
|
133
|
+
name: z.ZodLiteral<Name>;
|
|
134
|
+
data: Data;
|
|
135
|
+
}> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
|
|
136
|
+
toObject(): {
|
|
137
|
+
name: Name;
|
|
138
|
+
data: z.input<Data>;
|
|
139
|
+
};
|
|
140
|
+
message: string;
|
|
141
|
+
stack?: string;
|
|
142
|
+
cause?: unknown;
|
|
143
|
+
};
|
|
144
|
+
readonly Schema: z.ZodObject<{
|
|
145
|
+
name: z.ZodLiteral<Name>;
|
|
146
|
+
data: Data;
|
|
147
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
148
|
+
name: z.ZodLiteral<Name>;
|
|
149
|
+
data: Data;
|
|
150
|
+
}>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<{
|
|
151
|
+
name: z.ZodLiteral<Name>;
|
|
152
|
+
data: Data;
|
|
153
|
+
}> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
|
|
154
|
+
isInstance(input: any): input is InstanceType</*elided*/ any>;
|
|
155
|
+
create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): /*elided*/ any;
|
|
156
|
+
readonly Unknown: {
|
|
157
|
+
new (data: {
|
|
158
|
+
message: string;
|
|
159
|
+
}, options?: ErrorOptions): {
|
|
160
|
+
readonly name: "UnknownError";
|
|
161
|
+
readonly data: {
|
|
162
|
+
message: string;
|
|
163
|
+
};
|
|
164
|
+
schema(): z.ZodObject<{
|
|
165
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
166
|
+
data: z.ZodObject<{
|
|
167
|
+
message: z.ZodString;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
message: string;
|
|
170
|
+
}, {
|
|
171
|
+
message: string;
|
|
172
|
+
}>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
name: "UnknownError";
|
|
175
|
+
data: {
|
|
176
|
+
message: string;
|
|
177
|
+
};
|
|
178
|
+
}, {
|
|
179
|
+
name: "UnknownError";
|
|
180
|
+
data: {
|
|
181
|
+
message: string;
|
|
182
|
+
};
|
|
183
|
+
}>;
|
|
184
|
+
toObject(): {
|
|
185
|
+
name: "UnknownError";
|
|
186
|
+
data: {
|
|
187
|
+
message: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
message: string;
|
|
191
|
+
stack?: string;
|
|
192
|
+
cause?: unknown;
|
|
193
|
+
};
|
|
194
|
+
readonly Schema: z.ZodObject<{
|
|
195
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
196
|
+
data: z.ZodObject<{
|
|
197
|
+
message: z.ZodString;
|
|
198
|
+
}, "strip", z.ZodTypeAny, {
|
|
199
|
+
message: string;
|
|
200
|
+
}, {
|
|
201
|
+
message: string;
|
|
202
|
+
}>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
name: "UnknownError";
|
|
205
|
+
data: {
|
|
206
|
+
message: string;
|
|
207
|
+
};
|
|
208
|
+
}, {
|
|
209
|
+
name: "UnknownError";
|
|
210
|
+
data: {
|
|
211
|
+
message: string;
|
|
212
|
+
};
|
|
213
|
+
}>;
|
|
214
|
+
isInstance(input: any): input is {
|
|
215
|
+
readonly name: "UnknownError";
|
|
216
|
+
readonly data: {
|
|
217
|
+
message: string;
|
|
218
|
+
};
|
|
219
|
+
schema(): z.ZodObject<{
|
|
220
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
221
|
+
data: z.ZodObject<{
|
|
222
|
+
message: z.ZodString;
|
|
223
|
+
}, "strip", z.ZodTypeAny, {
|
|
224
|
+
message: string;
|
|
225
|
+
}, {
|
|
226
|
+
message: string;
|
|
227
|
+
}>;
|
|
228
|
+
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
name: "UnknownError";
|
|
230
|
+
data: {
|
|
231
|
+
message: string;
|
|
232
|
+
};
|
|
233
|
+
}, {
|
|
234
|
+
name: "UnknownError";
|
|
235
|
+
data: {
|
|
236
|
+
message: string;
|
|
237
|
+
};
|
|
238
|
+
}>;
|
|
239
|
+
toObject(): {
|
|
240
|
+
name: "UnknownError";
|
|
241
|
+
data: {
|
|
242
|
+
message: string;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
message: string;
|
|
246
|
+
stack?: string;
|
|
247
|
+
cause?: unknown;
|
|
248
|
+
};
|
|
249
|
+
create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): /*elided*/ any;
|
|
250
|
+
readonly Unknown: /*elided*/ any;
|
|
251
|
+
isError(error: unknown): error is Error;
|
|
252
|
+
isError(value: unknown): value is Error;
|
|
253
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
254
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
255
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
256
|
+
stackTraceLimit: number;
|
|
257
|
+
};
|
|
258
|
+
isError(error: unknown): error is Error;
|
|
259
|
+
isError(value: unknown): value is Error;
|
|
260
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
261
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
262
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
263
|
+
stackTraceLimit: number;
|
|
264
|
+
};
|
|
265
|
+
readonly Unknown: {
|
|
266
|
+
new (data: {
|
|
267
|
+
message: string;
|
|
268
|
+
}, options?: ErrorOptions): {
|
|
269
|
+
readonly name: "UnknownError";
|
|
270
|
+
readonly data: {
|
|
271
|
+
message: string;
|
|
272
|
+
};
|
|
273
|
+
schema(): z.ZodObject<{
|
|
274
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
275
|
+
data: z.ZodObject<{
|
|
276
|
+
message: z.ZodString;
|
|
277
|
+
}, "strip", z.ZodTypeAny, {
|
|
278
|
+
message: string;
|
|
279
|
+
}, {
|
|
280
|
+
message: string;
|
|
281
|
+
}>;
|
|
282
|
+
}, "strip", z.ZodTypeAny, {
|
|
283
|
+
name: "UnknownError";
|
|
284
|
+
data: {
|
|
285
|
+
message: string;
|
|
286
|
+
};
|
|
287
|
+
}, {
|
|
288
|
+
name: "UnknownError";
|
|
289
|
+
data: {
|
|
290
|
+
message: string;
|
|
291
|
+
};
|
|
292
|
+
}>;
|
|
293
|
+
toObject(): {
|
|
294
|
+
name: "UnknownError";
|
|
295
|
+
data: {
|
|
296
|
+
message: string;
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
message: string;
|
|
300
|
+
stack?: string;
|
|
301
|
+
cause?: unknown;
|
|
302
|
+
};
|
|
303
|
+
readonly Schema: z.ZodObject<{
|
|
304
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
305
|
+
data: z.ZodObject<{
|
|
306
|
+
message: z.ZodString;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
message: string;
|
|
309
|
+
}, {
|
|
310
|
+
message: string;
|
|
311
|
+
}>;
|
|
312
|
+
}, "strip", z.ZodTypeAny, {
|
|
313
|
+
name: "UnknownError";
|
|
314
|
+
data: {
|
|
315
|
+
message: string;
|
|
316
|
+
};
|
|
317
|
+
}, {
|
|
318
|
+
name: "UnknownError";
|
|
319
|
+
data: {
|
|
320
|
+
message: string;
|
|
321
|
+
};
|
|
322
|
+
}>;
|
|
323
|
+
isInstance(input: any): input is {
|
|
324
|
+
readonly name: "UnknownError";
|
|
325
|
+
readonly data: {
|
|
326
|
+
message: string;
|
|
327
|
+
};
|
|
328
|
+
schema(): z.ZodObject<{
|
|
329
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
330
|
+
data: z.ZodObject<{
|
|
331
|
+
message: z.ZodString;
|
|
332
|
+
}, "strip", z.ZodTypeAny, {
|
|
333
|
+
message: string;
|
|
334
|
+
}, {
|
|
335
|
+
message: string;
|
|
336
|
+
}>;
|
|
337
|
+
}, "strip", z.ZodTypeAny, {
|
|
338
|
+
name: "UnknownError";
|
|
339
|
+
data: {
|
|
340
|
+
message: string;
|
|
341
|
+
};
|
|
342
|
+
}, {
|
|
343
|
+
name: "UnknownError";
|
|
344
|
+
data: {
|
|
345
|
+
message: string;
|
|
346
|
+
};
|
|
347
|
+
}>;
|
|
348
|
+
toObject(): {
|
|
349
|
+
name: "UnknownError";
|
|
350
|
+
data: {
|
|
351
|
+
message: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
message: string;
|
|
355
|
+
stack?: string;
|
|
356
|
+
cause?: unknown;
|
|
357
|
+
};
|
|
358
|
+
create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): {
|
|
359
|
+
new (data: z.input<Data>, options?: ErrorOptions): {
|
|
360
|
+
readonly name: Name;
|
|
361
|
+
readonly data: z.input<Data>;
|
|
362
|
+
schema(): z.ZodObject<{
|
|
363
|
+
name: z.ZodLiteral<Name>;
|
|
364
|
+
data: Data;
|
|
365
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
366
|
+
name: z.ZodLiteral<Name>;
|
|
367
|
+
data: Data;
|
|
368
|
+
}>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<{
|
|
369
|
+
name: z.ZodLiteral<Name>;
|
|
370
|
+
data: Data;
|
|
371
|
+
}> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
|
|
372
|
+
toObject(): {
|
|
373
|
+
name: Name;
|
|
374
|
+
data: z.input<Data>;
|
|
375
|
+
};
|
|
376
|
+
message: string;
|
|
377
|
+
stack?: string;
|
|
378
|
+
cause?: unknown;
|
|
379
|
+
};
|
|
380
|
+
readonly Schema: z.ZodObject<{
|
|
381
|
+
name: z.ZodLiteral<Name>;
|
|
382
|
+
data: Data;
|
|
383
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
384
|
+
name: z.ZodLiteral<Name>;
|
|
385
|
+
data: Data;
|
|
386
|
+
}>, any> extends infer T ? { [k in keyof T]: T[k]; } : never, z.baseObjectInputType<{
|
|
387
|
+
name: z.ZodLiteral<Name>;
|
|
388
|
+
data: Data;
|
|
389
|
+
}> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1]; } : never>;
|
|
390
|
+
isInstance(input: any): input is InstanceType</*elided*/ any>;
|
|
391
|
+
create<Name extends string, Data extends z.ZodType>(name: Name, data: Data): /*elided*/ any;
|
|
392
|
+
readonly Unknown: /*elided*/ any;
|
|
393
|
+
isError(error: unknown): error is Error;
|
|
394
|
+
isError(value: unknown): value is Error;
|
|
395
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
396
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
397
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
398
|
+
stackTraceLimit: number;
|
|
399
|
+
};
|
|
400
|
+
readonly Unknown: /*elided*/ any;
|
|
401
|
+
isError(error: unknown): error is Error;
|
|
402
|
+
isError(value: unknown): value is Error;
|
|
403
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
404
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
405
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
406
|
+
stackTraceLimit: number;
|
|
407
|
+
};
|
|
408
|
+
isError(error: unknown): error is Error;
|
|
409
|
+
isError(value: unknown): value is Error;
|
|
410
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
411
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
412
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
413
|
+
stackTraceLimit: number;
|
|
414
|
+
};
|
|
415
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants Module
|
|
3
|
+
* Re-exports from theme module for backward compatibility
|
|
4
|
+
*/
|
|
5
|
+
export { VERSION } from "./version";
|
|
6
|
+
export { PRODUCT_NAME, PRODUCT_COMMAND, CONFIG_DIR, CONFIG_FILE, RULES_FILE, ENV_PREFIX, LOCAL_RULE_FILES, GLOBAL_RULE_FILES, } from "../theme";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diff Engine
|
|
3
|
+
*
|
|
4
|
+
* Motor de diff para PorterCode.
|
|
5
|
+
* Implementacion propia basada en el algoritmo de longest common subsequence.
|
|
6
|
+
*/
|
|
7
|
+
import type { DiffResult, DiffOptions, WordChange } from "./types";
|
|
8
|
+
/**
|
|
9
|
+
* Computa el diff entre dos contenidos
|
|
10
|
+
*/
|
|
11
|
+
export declare function computeDiff(oldContent: string, newContent: string, options: DiffOptions): DiffResult;
|
|
12
|
+
/**
|
|
13
|
+
* Computa cambios word-level entre dos lineas
|
|
14
|
+
*/
|
|
15
|
+
export declare function computeWordDiff(oldLine: string, newLine: string): WordChange[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diff Module
|
|
3
|
+
*
|
|
4
|
+
* Sistema de diff propio para PorterCode.
|
|
5
|
+
* Usa algoritmo LCS (Longest Common Subsequence) para generar diffs.
|
|
6
|
+
*/
|
|
7
|
+
export { computeDiff, computeWordDiff } from "./engine";
|
|
8
|
+
export type { DiffResult, DiffHunk, DiffLine, DiffOptions, WordChange, ChangeType, } from "./types";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diff Types
|
|
3
|
+
*
|
|
4
|
+
* Estructuras de datos propias para el sistema de diff de PorterCode.
|
|
5
|
+
* Usa Patience algorithm para generar diffs mas legibles.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Tipos de cambio en una linea
|
|
9
|
+
*/
|
|
10
|
+
export type ChangeType = "add" | "remove" | "context" | "modify";
|
|
11
|
+
/**
|
|
12
|
+
* Cambio a nivel de palabra dentro de una linea
|
|
13
|
+
*/
|
|
14
|
+
export interface WordChange {
|
|
15
|
+
text: string;
|
|
16
|
+
type: "added" | "removed" | "unchanged";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Una linea individual en el diff
|
|
20
|
+
*/
|
|
21
|
+
export interface DiffLine {
|
|
22
|
+
type: ChangeType;
|
|
23
|
+
content: string;
|
|
24
|
+
lineNumber: {
|
|
25
|
+
old?: number;
|
|
26
|
+
new?: number;
|
|
27
|
+
};
|
|
28
|
+
/** Cambios word-level para lineas modificadas */
|
|
29
|
+
wordChanges?: WordChange[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Un hunk con contexto y metadatos
|
|
33
|
+
*/
|
|
34
|
+
export interface DiffHunk {
|
|
35
|
+
oldStart: number;
|
|
36
|
+
oldCount: number;
|
|
37
|
+
newStart: number;
|
|
38
|
+
newCount: number;
|
|
39
|
+
lines: DiffLine[];
|
|
40
|
+
/** Encabezado de funcion/clase si es detectado */
|
|
41
|
+
header?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resultado completo del diff
|
|
45
|
+
*/
|
|
46
|
+
export interface DiffResult {
|
|
47
|
+
filePath: string;
|
|
48
|
+
hunks: DiffHunk[];
|
|
49
|
+
stats: {
|
|
50
|
+
additions: number;
|
|
51
|
+
deletions: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Opciones de configuracion para el diff
|
|
56
|
+
*/
|
|
57
|
+
export interface DiffOptions {
|
|
58
|
+
/** Ruta del archivo (requerido) */
|
|
59
|
+
filePath: string;
|
|
60
|
+
/** Lineas de contexto antes/despues de cambios (default: 3) */
|
|
61
|
+
context?: number;
|
|
62
|
+
/** Habilitar diff word-level (default: false) */
|
|
63
|
+
wordDiff?: boolean;
|
|
64
|
+
/** Ignorar diferencias de espacios en blanco */
|
|
65
|
+
ignoreWhitespace?: boolean;
|
|
66
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment flag accessors
|
|
3
|
+
*
|
|
4
|
+
* Uses getters for flags that need dynamic reading (important for tests),
|
|
5
|
+
* and static values for configuration that is read at startup.
|
|
6
|
+
*/
|
|
7
|
+
export declare namespace Flag {
|
|
8
|
+
const PORTER_CONFIG: string | undefined;
|
|
9
|
+
const PORTER_CONFIG_CONTENT: string | undefined;
|
|
10
|
+
const PORTER_CONFIG_DIR: string | undefined;
|
|
11
|
+
function getPermission(): string | undefined;
|
|
12
|
+
const PORTER_PERMISSION: string | undefined;
|
|
13
|
+
const PORTER_LOG_LEVEL: string | undefined;
|
|
14
|
+
const PORTER_LOG_PRINT: boolean;
|
|
15
|
+
const PORTER_DEV: boolean;
|
|
16
|
+
const PORTER_DISABLE_AUTO_OPTIMIZE: boolean;
|
|
17
|
+
const PORTER_DISABLE_PRUNE: boolean;
|
|
18
|
+
const PORTER_FAKE_VCS: string | undefined;
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PorterMessage } from "./protocol";
|
|
2
|
+
export declare namespace Bridge {
|
|
3
|
+
/**
|
|
4
|
+
* Inicializa el bridge entre el Bus y el Gateway
|
|
5
|
+
*/
|
|
6
|
+
function init(broadcast: (msg: PorterMessage) => void): void;
|
|
7
|
+
/**
|
|
8
|
+
* Detiene el bridge
|
|
9
|
+
*/
|
|
10
|
+
function stop(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PorterMessage, type ConnectedClient } from "../protocol";
|
|
2
|
+
export declare namespace PermissionHandler {
|
|
3
|
+
/**
|
|
4
|
+
* Maneja mensajes del canal "permission"
|
|
5
|
+
*/
|
|
6
|
+
function handle(msg: PorterMessage, client: ConnectedClient): Promise<PorterMessage | void>;
|
|
7
|
+
/**
|
|
8
|
+
* Registra un callback para una solicitud de permiso
|
|
9
|
+
*/
|
|
10
|
+
function registerCallback(id: string, callback: (granted: boolean, pattern?: string) => void): void;
|
|
11
|
+
/**
|
|
12
|
+
* Limpia callbacks expirados
|
|
13
|
+
*/
|
|
14
|
+
function clearCallback(id: string): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gateway Module (Legacy)
|
|
3
|
+
*
|
|
4
|
+
* WebSocket-based communication using Porter Wire Protocol (PWP).
|
|
5
|
+
*
|
|
6
|
+
* NOTE: The VS Code extension now uses HTTP + SSE instead.
|
|
7
|
+
* See src/server/ for the current HTTP server implementation.
|
|
8
|
+
* This module is kept for potential future use cases.
|
|
9
|
+
*/
|
|
10
|
+
export { Gateway } from "./server";
|
|
11
|
+
export { Bridge } from "./bridge";
|
|
12
|
+
export { Router } from "./router";
|
|
13
|
+
export { type PorterMessage, type ConnectedClient, type GatewayInfo, type Channel, type MessageType, createRequest, createResponse, createEvent, createStream, createError, PorterMessage as PorterMessageSchema, GatewayInfo as GatewayInfoSchema, } from "./protocol";
|
|
14
|
+
export { SessionHandler } from "./handlers/session";
|
|
15
|
+
export { LLMHandler } from "./handlers/llm";
|
|
16
|
+
export { ToolHandler } from "./handlers/tool";
|
|
17
|
+
export { PermissionHandler } from "./handlers/permission";
|
|
18
|
+
export { SystemHandler } from "./handlers/system";
|