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,159 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Porter Wire Protocol (PWP)
|
|
4
|
+
* Protocolo de comunicacion bidireccional via WebSocket
|
|
5
|
+
* Usa MessagePack para serializacion binaria eficiente
|
|
6
|
+
*/
|
|
7
|
+
export declare const MessageType: z.ZodEnum<["request", "response", "event", "stream"]>;
|
|
8
|
+
export type MessageType = z.infer<typeof MessageType>;
|
|
9
|
+
export declare const Channel: z.ZodEnum<["session", "llm", "tool", "permission", "system"]>;
|
|
10
|
+
export type Channel = z.infer<typeof Channel>;
|
|
11
|
+
export declare const PorterMessage: z.ZodObject<{
|
|
12
|
+
version: z.ZodLiteral<1>;
|
|
13
|
+
type: z.ZodEnum<["request", "response", "event", "stream"]>;
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
timestamp: z.ZodNumber;
|
|
16
|
+
channel: z.ZodEnum<["session", "llm", "tool", "permission", "system"]>;
|
|
17
|
+
action: z.ZodString;
|
|
18
|
+
payload: z.ZodUnknown;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
version: 1;
|
|
21
|
+
type: "event" | "request" | "response" | "stream";
|
|
22
|
+
id: string;
|
|
23
|
+
timestamp: number;
|
|
24
|
+
channel: "session" | "llm" | "tool" | "permission" | "system";
|
|
25
|
+
action: string;
|
|
26
|
+
payload?: unknown;
|
|
27
|
+
}, {
|
|
28
|
+
version: 1;
|
|
29
|
+
type: "event" | "request" | "response" | "stream";
|
|
30
|
+
id: string;
|
|
31
|
+
timestamp: number;
|
|
32
|
+
channel: "session" | "llm" | "tool" | "permission" | "system";
|
|
33
|
+
action: string;
|
|
34
|
+
payload?: unknown;
|
|
35
|
+
}>;
|
|
36
|
+
export type PorterMessage = z.infer<typeof PorterMessage>;
|
|
37
|
+
export declare function createRequest<T>(channel: Channel, action: string, payload: T): PorterMessage;
|
|
38
|
+
export declare function createResponse<T>(requestId: string, channel: Channel, action: string, payload: T): PorterMessage;
|
|
39
|
+
export declare function createEvent<T>(channel: Channel, action: string, payload: T): PorterMessage;
|
|
40
|
+
export declare function createStream<T>(streamId: string, channel: Channel, action: string, payload: T): PorterMessage;
|
|
41
|
+
export declare function createError(requestId: string, channel: Channel, error: string, details?: unknown): PorterMessage;
|
|
42
|
+
export declare const SessionPayloads: {
|
|
43
|
+
create: z.ZodObject<{
|
|
44
|
+
title: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
title?: string | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
title?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
list: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
51
|
+
get: z.ZodObject<{
|
|
52
|
+
sessionId: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
sessionId: string;
|
|
55
|
+
}, {
|
|
56
|
+
sessionId: string;
|
|
57
|
+
}>;
|
|
58
|
+
messages: z.ZodObject<{
|
|
59
|
+
sessionId: z.ZodString;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
sessionId: string;
|
|
62
|
+
}, {
|
|
63
|
+
sessionId: string;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
export declare const LLMPayloads: {
|
|
67
|
+
prompt: z.ZodObject<{
|
|
68
|
+
sessionId: z.ZodString;
|
|
69
|
+
content: z.ZodString;
|
|
70
|
+
attachments: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
sessionId: string;
|
|
73
|
+
content: string;
|
|
74
|
+
attachments?: string[] | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
sessionId: string;
|
|
77
|
+
content: string;
|
|
78
|
+
attachments?: string[] | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
cancel: z.ZodObject<{
|
|
81
|
+
sessionId: z.ZodString;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
sessionId: string;
|
|
84
|
+
}, {
|
|
85
|
+
sessionId: string;
|
|
86
|
+
}>;
|
|
87
|
+
};
|
|
88
|
+
export declare const ToolPayloads: {
|
|
89
|
+
list: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
90
|
+
execute: z.ZodObject<{
|
|
91
|
+
toolId: z.ZodString;
|
|
92
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
toolId: string;
|
|
95
|
+
args: Record<string, unknown>;
|
|
96
|
+
}, {
|
|
97
|
+
toolId: string;
|
|
98
|
+
args: Record<string, unknown>;
|
|
99
|
+
}>;
|
|
100
|
+
};
|
|
101
|
+
export declare const PermissionPayloads: {
|
|
102
|
+
respond: z.ZodObject<{
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
granted: z.ZodBoolean;
|
|
105
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
id: string;
|
|
108
|
+
granted: boolean;
|
|
109
|
+
pattern?: string | undefined;
|
|
110
|
+
}, {
|
|
111
|
+
id: string;
|
|
112
|
+
granted: boolean;
|
|
113
|
+
pattern?: string | undefined;
|
|
114
|
+
}>;
|
|
115
|
+
};
|
|
116
|
+
export declare const SystemPayloads: {
|
|
117
|
+
auth: z.ZodObject<{
|
|
118
|
+
token: z.ZodString;
|
|
119
|
+
clientId: z.ZodString;
|
|
120
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
token: string;
|
|
123
|
+
clientId: string;
|
|
124
|
+
capabilities?: string[] | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
token: string;
|
|
127
|
+
clientId: string;
|
|
128
|
+
capabilities?: string[] | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
health: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
131
|
+
};
|
|
132
|
+
export interface ConnectedClient {
|
|
133
|
+
id: string;
|
|
134
|
+
socket: WebSocket;
|
|
135
|
+
authenticated: boolean;
|
|
136
|
+
capabilities: string[];
|
|
137
|
+
subscriptions: Set<string>;
|
|
138
|
+
connectedAt: number;
|
|
139
|
+
}
|
|
140
|
+
export declare const GatewayInfo: z.ZodObject<{
|
|
141
|
+
pid: z.ZodNumber;
|
|
142
|
+
port: z.ZodNumber;
|
|
143
|
+
token: z.ZodString;
|
|
144
|
+
projectDir: z.ZodString;
|
|
145
|
+
startedAt: z.ZodNumber;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
token: string;
|
|
148
|
+
pid: number;
|
|
149
|
+
port: number;
|
|
150
|
+
projectDir: string;
|
|
151
|
+
startedAt: number;
|
|
152
|
+
}, {
|
|
153
|
+
token: string;
|
|
154
|
+
pid: number;
|
|
155
|
+
port: number;
|
|
156
|
+
projectDir: string;
|
|
157
|
+
startedAt: number;
|
|
158
|
+
}>;
|
|
159
|
+
export type GatewayInfo = z.infer<typeof GatewayInfo>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type PorterMessage, type ConnectedClient, type GatewayInfo } from "./protocol";
|
|
2
|
+
export declare namespace Gateway {
|
|
3
|
+
/**
|
|
4
|
+
* Inicia el Gateway Server
|
|
5
|
+
* Encuentra un puerto dinamico y guarda la info en gateway.json
|
|
6
|
+
*/
|
|
7
|
+
function start(): Promise<GatewayInfo>;
|
|
8
|
+
/**
|
|
9
|
+
* Detiene el Gateway Server
|
|
10
|
+
*/
|
|
11
|
+
function stop(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Envia un mensaje a todos los clientes autenticados
|
|
14
|
+
*/
|
|
15
|
+
function broadcast(msg: PorterMessage): void;
|
|
16
|
+
/**
|
|
17
|
+
* Envia un mensaje a un cliente especifico
|
|
18
|
+
*/
|
|
19
|
+
function send(clientId: string, msg: PorterMessage): void;
|
|
20
|
+
/**
|
|
21
|
+
* Obtiene la lista de clientes conectados
|
|
22
|
+
*/
|
|
23
|
+
function getClients(): ConnectedClient[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to resolve home directory paths (~/...)
|
|
3
|
+
* Works cross-platform (Windows, macOS, Linux)
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveHomePath(filepath: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Get platform-specific config directory for a command
|
|
8
|
+
* - Windows: %APPDATA%\<commandName>
|
|
9
|
+
* - macOS: ~/Library/Application Support/<commandName>
|
|
10
|
+
* - Linux: ~/.config/<commandName>
|
|
11
|
+
*/
|
|
12
|
+
export declare function getConfigDir(commandName: string): string;
|
|
13
|
+
export declare namespace Global {
|
|
14
|
+
const Path: {
|
|
15
|
+
readonly home: string;
|
|
16
|
+
readonly data: string;
|
|
17
|
+
readonly bin: string;
|
|
18
|
+
readonly log: string;
|
|
19
|
+
readonly cache: string;
|
|
20
|
+
readonly config: string;
|
|
21
|
+
readonly state: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
package/dist/index.d.ts
ADDED