@spenceriam/impulse 0.15.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.
- package/README.md +194 -0
- package/dist/api/client.d.ts +53 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +271 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +7 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/stream.d.ts +98 -0
- package/dist/api/stream.d.ts.map +1 -0
- package/dist/api/stream.js +202 -0
- package/dist/api/stream.js.map +1 -0
- package/dist/api/types.d.ts +1353 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +143 -0
- package/dist/api/types.js.map +1 -0
- package/dist/bash.txt +28 -0
- package/dist/bus/bus.d.ts +21 -0
- package/dist/bus/bus.d.ts.map +1 -0
- package/dist/bus/bus.js +22 -0
- package/dist/bus/bus.js.map +1 -0
- package/dist/bus/events.d.ts +100 -0
- package/dist/bus/events.d.ts.map +1 -0
- package/dist/bus/events.js +45 -0
- package/dist/bus/events.js.map +1 -0
- package/dist/bus/index.d.ts +3 -0
- package/dist/bus/index.d.ts.map +1 -0
- package/dist/bus/index.js +3 -0
- package/dist/bus/index.js.map +1 -0
- package/dist/file-edit.txt +21 -0
- package/dist/file-read.txt +18 -0
- package/dist/file-write.txt +16 -0
- package/dist/glob.txt +19 -0
- package/dist/global.d.ts +8 -0
- package/dist/global.d.ts.map +1 -0
- package/dist/global.js +14 -0
- package/dist/global.js.map +1 -0
- package/dist/grep.txt +20 -0
- package/dist/highlights-eq9cgrbb.scm +604 -0
- package/dist/highlights-ghv9g403.scm +205 -0
- package/dist/highlights-hk7bwhj4.scm +284 -0
- package/dist/highlights-r812a2qc.scm +150 -0
- package/dist/highlights-x6tmsnaa.scm +115 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62122 -0
- package/dist/index.js.map +1 -0
- package/dist/index.jsx +5 -0
- package/dist/index.jsx.map +1 -0
- package/dist/injections-73j83es3.scm +27 -0
- package/dist/input/at-refs.d.ts +42 -0
- package/dist/input/at-refs.d.ts.map +1 -0
- package/dist/input/at-refs.js +154 -0
- package/dist/input/at-refs.js.map +1 -0
- package/dist/input/history.d.ts +26 -0
- package/dist/input/history.d.ts.map +1 -0
- package/dist/input/history.js +109 -0
- package/dist/input/history.js.map +1 -0
- package/dist/input/index.d.ts +5 -0
- package/dist/input/index.d.ts.map +1 -0
- package/dist/input/index.js +5 -0
- package/dist/input/index.js.map +1 -0
- package/dist/input/paste.d.ts +19 -0
- package/dist/input/paste.d.ts.map +1 -0
- package/dist/input/paste.js +75 -0
- package/dist/input/paste.js.map +1 -0
- package/dist/input/shortcuts.d.ts +6 -0
- package/dist/input/shortcuts.d.ts.map +1 -0
- package/dist/input/shortcuts.js +84 -0
- package/dist/input/shortcuts.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/manager.d.ts +51 -0
- package/dist/mcp/manager.d.ts.map +1 -0
- package/dist/mcp/manager.js +158 -0
- package/dist/mcp/manager.js.map +1 -0
- package/dist/mcp/types.d.ts +18 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +5 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/session/todo.d.ts +24 -0
- package/dist/session/todo.d.ts.map +1 -0
- package/dist/session/todo.js +39 -0
- package/dist/session/todo.js.map +1 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/storage.d.ts +13 -0
- package/dist/storage/storage.d.ts.map +1 -0
- package/dist/storage/storage.js +84 -0
- package/dist/storage/storage.js.map +1 -0
- package/dist/task.txt +26 -0
- package/dist/todo-read.txt +14 -0
- package/dist/todo-write.txt +166 -0
- package/dist/tools/bash.d.ts +22 -0
- package/dist/tools/bash.d.ts.map +1 -0
- package/dist/tools/bash.js +70 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/file-edit.d.ts +22 -0
- package/dist/tools/file-edit.d.ts.map +1 -0
- package/dist/tools/file-edit.js +67 -0
- package/dist/tools/file-edit.js.map +1 -0
- package/dist/tools/file-read.d.ts +19 -0
- package/dist/tools/file-read.d.ts.map +1 -0
- package/dist/tools/file-read.js +70 -0
- package/dist/tools/file-read.js.map +1 -0
- package/dist/tools/file-write.d.ts +16 -0
- package/dist/tools/file-write.d.ts.map +1 -0
- package/dist/tools/file-write.js +45 -0
- package/dist/tools/file-write.js.map +1 -0
- package/dist/tools/glob.d.ts +16 -0
- package/dist/tools/glob.d.ts.map +1 -0
- package/dist/tools/glob.js +45 -0
- package/dist/tools/glob.js.map +1 -0
- package/dist/tools/grep.d.ts +19 -0
- package/dist/tools/grep.d.ts.map +1 -0
- package/dist/tools/grep.js +65 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +11 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/registry.d.ts +22 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +75 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/task.d.ts +19 -0
- package/dist/tools/task.d.ts.map +1 -0
- package/dist/tools/task.js +51 -0
- package/dist/tools/task.js.map +1 -0
- package/dist/tools/todo-read.d.ts +7 -0
- package/dist/tools/todo-read.d.ts.map +1 -0
- package/dist/tools/todo-read.js +56 -0
- package/dist/tools/todo-read.js.map +1 -0
- package/dist/tools/todo-write.d.ts +38 -0
- package/dist/tools/todo-write.d.ts.map +1 -0
- package/dist/tools/todo-write.js +40 -0
- package/dist/tools/todo-write.js.map +1 -0
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist/ui/App.d.ts +6 -0
- package/dist/ui/App.d.ts.map +1 -0
- package/dist/ui/App.jsx +37 -0
- package/dist/ui/App.jsx.map +1 -0
- package/dist/ui/components/Autocomplete.d.ts +24 -0
- package/dist/ui/components/Autocomplete.d.ts.map +1 -0
- package/dist/ui/components/Autocomplete.jsx +67 -0
- package/dist/ui/components/Autocomplete.jsx.map +1 -0
- package/dist/ui/components/ChatView.d.ts +14 -0
- package/dist/ui/components/ChatView.d.ts.map +1 -0
- package/dist/ui/components/ChatView.jsx +11 -0
- package/dist/ui/components/ChatView.jsx.map +1 -0
- package/dist/ui/components/InputArea.d.ts +18 -0
- package/dist/ui/components/InputArea.d.ts.map +1 -0
- package/dist/ui/components/InputArea.jsx +35 -0
- package/dist/ui/components/InputArea.jsx.map +1 -0
- package/dist/ui/components/MessageBlock.d.ts +21 -0
- package/dist/ui/components/MessageBlock.d.ts.map +1 -0
- package/dist/ui/components/MessageBlock.jsx +94 -0
- package/dist/ui/components/MessageBlock.jsx.map +1 -0
- package/dist/ui/components/Overlay.d.ts +28 -0
- package/dist/ui/components/Overlay.d.ts.map +1 -0
- package/dist/ui/components/Overlay.jsx +102 -0
- package/dist/ui/components/Overlay.jsx.map +1 -0
- package/dist/ui/components/ProgressBar.d.ts +9 -0
- package/dist/ui/components/ProgressBar.d.ts.map +1 -0
- package/dist/ui/components/ProgressBar.jsx +17 -0
- package/dist/ui/components/ProgressBar.jsx.map +1 -0
- package/dist/ui/components/Sidebar.d.ts +22 -0
- package/dist/ui/components/Sidebar.d.ts.map +1 -0
- package/dist/ui/components/Sidebar.jsx +96 -0
- package/dist/ui/components/Sidebar.jsx.map +1 -0
- package/dist/ui/components/StatusLine.d.ts +6 -0
- package/dist/ui/components/StatusLine.d.ts.map +1 -0
- package/dist/ui/components/StatusLine.jsx +32 -0
- package/dist/ui/components/StatusLine.jsx.map +1 -0
- package/dist/ui/components/ThinkingBlock.d.ts +15 -0
- package/dist/ui/components/ThinkingBlock.d.ts.map +1 -0
- package/dist/ui/components/ThinkingBlock.jsx +33 -0
- package/dist/ui/components/ThinkingBlock.jsx.map +1 -0
- package/dist/ui/components/TodoItem.d.ts +22 -0
- package/dist/ui/components/TodoItem.d.ts.map +1 -0
- package/dist/ui/components/TodoItem.jsx +11 -0
- package/dist/ui/components/TodoItem.jsx.map +1 -0
- package/dist/ui/components/ToolBlock.d.ts +27 -0
- package/dist/ui/components/ToolBlock.d.ts.map +1 -0
- package/dist/ui/components/ToolBlock.jsx +76 -0
- package/dist/ui/components/ToolBlock.jsx.map +1 -0
- package/dist/ui/components/index.d.ts +12 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +12 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/context/index.d.ts +4 -0
- package/dist/ui/context/index.d.ts.map +1 -0
- package/dist/ui/context/index.js +4 -0
- package/dist/ui/context/index.js.map +1 -0
- package/dist/ui/context/mode.d.ts +24 -0
- package/dist/ui/context/mode.d.ts.map +1 -0
- package/dist/ui/context/mode.jsx +53 -0
- package/dist/ui/context/mode.jsx.map +1 -0
- package/dist/ui/context/session.d.ts +43 -0
- package/dist/ui/context/session.d.ts.map +1 -0
- package/dist/ui/context/session.jsx +63 -0
- package/dist/ui/context/session.jsx.map +1 -0
- package/dist/ui/context/todo.d.ts +32 -0
- package/dist/ui/context/todo.d.ts.map +1 -0
- package/dist/ui/context/todo.jsx +75 -0
- package/dist/ui/context/todo.jsx.map +1 -0
- package/dist/ui/design.d.ts +182 -0
- package/dist/ui/design.d.ts.map +1 -0
- package/dist/ui/design.js +189 -0
- package/dist/ui/design.js.map +1 -0
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/util/config.d.ts +22 -0
- package/dist/util/config.d.ts.map +1 -0
- package/dist/util/config.js +55 -0
- package/dist/util/config.js.map +1 -0
- package/dist/util/instructions.d.ts +39 -0
- package/dist/util/instructions.d.ts.map +1 -0
- package/dist/util/instructions.js +96 -0
- package/dist/util/instructions.js.map +1 -0
- package/dist/util/lock.d.ts +18 -0
- package/dist/util/lock.d.ts.map +1 -0
- package/dist/util/lock.js +65 -0
- package/dist/util/lock.js.map +1 -0
- package/dist/util/logger.d.ts +8 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +81 -0
- package/dist/util/logger.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;GAGG;AAGH,eAAO,MAAM,QAAQ,uHASnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAGhD,eAAO,MAAM,WAAW,oDAAkD,CAAC;AAC3E,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAGtD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAGhD,eAAO,MAAM,WAAW;;;;;;;;;EAGtB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;EAM1B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAGzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAA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EAO9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGtE,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* GLM API Types
|
|
4
|
+
* OpenAI-compatible types for Z.AI Coding Plan API
|
|
5
|
+
*/
|
|
6
|
+
// Supported GLM models
|
|
7
|
+
export const GLMModel = z.enum([
|
|
8
|
+
"glm-4.7", // Flagship - complex coding, reasoning (default)
|
|
9
|
+
"glm-4.7-flash", // Fast flagship variant
|
|
10
|
+
"glm-4.6", // Previous gen flagship
|
|
11
|
+
"glm-4.6v", // Vision - image understanding
|
|
12
|
+
"glm-4.5", // Efficient general model
|
|
13
|
+
"glm-4.5-air", // Lightweight, fast
|
|
14
|
+
"glm-4.5-flash", // Ultra-fast
|
|
15
|
+
"glm-4.5v", // Vision - quick image tasks
|
|
16
|
+
]);
|
|
17
|
+
// Chat message roles
|
|
18
|
+
export const MessageRole = z.enum(["system", "user", "assistant", "tool"]);
|
|
19
|
+
// Tool call structure
|
|
20
|
+
export const ToolCall = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
type: z.literal("function"),
|
|
23
|
+
function: z.object({
|
|
24
|
+
name: z.string(),
|
|
25
|
+
arguments: z.string(),
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
// Chat message content can be string or array (for vision models)
|
|
29
|
+
export const TextContent = z.object({
|
|
30
|
+
type: z.literal("text"),
|
|
31
|
+
text: z.string(),
|
|
32
|
+
});
|
|
33
|
+
export const ImageUrlContent = z.object({
|
|
34
|
+
type: z.literal("image_url"),
|
|
35
|
+
image_url: z.object({
|
|
36
|
+
url: z.string(),
|
|
37
|
+
detail: z.enum(["auto", "low", "high"]).optional(),
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
export const MessageContent = z.union([
|
|
41
|
+
z.string(),
|
|
42
|
+
z.array(z.union([TextContent, ImageUrlContent])),
|
|
43
|
+
]);
|
|
44
|
+
// Base chat message
|
|
45
|
+
export const ChatMessage = z.object({
|
|
46
|
+
role: MessageRole,
|
|
47
|
+
content: MessageContent.nullable(),
|
|
48
|
+
name: z.string().optional(),
|
|
49
|
+
tool_calls: z.array(ToolCall).optional(),
|
|
50
|
+
tool_call_id: z.string().optional(),
|
|
51
|
+
// GLM-specific: reasoning content from thinking mode
|
|
52
|
+
reasoning_content: z.string().optional(),
|
|
53
|
+
});
|
|
54
|
+
// Tool definition for function calling
|
|
55
|
+
export const ToolDefinition = z.object({
|
|
56
|
+
type: z.literal("function"),
|
|
57
|
+
function: z.object({
|
|
58
|
+
name: z.string(),
|
|
59
|
+
description: z.string().optional(),
|
|
60
|
+
parameters: z.record(z.unknown()).optional(),
|
|
61
|
+
strict: z.boolean().optional(),
|
|
62
|
+
}),
|
|
63
|
+
});
|
|
64
|
+
// Chat completion request
|
|
65
|
+
export const ChatCompletionRequest = z.object({
|
|
66
|
+
model: GLMModel,
|
|
67
|
+
messages: z.array(ChatMessage),
|
|
68
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
69
|
+
top_p: z.number().min(0).max(1).optional(),
|
|
70
|
+
max_tokens: z.number().positive().optional(),
|
|
71
|
+
stream: z.boolean().optional(),
|
|
72
|
+
stop: z.union([z.string(), z.array(z.string())]).optional(),
|
|
73
|
+
tools: z.array(ToolDefinition).optional(),
|
|
74
|
+
tool_choice: z.union([
|
|
75
|
+
z.literal("auto"),
|
|
76
|
+
z.literal("none"),
|
|
77
|
+
z.literal("required"),
|
|
78
|
+
z.object({
|
|
79
|
+
type: z.literal("function"),
|
|
80
|
+
function: z.object({ name: z.string() }),
|
|
81
|
+
}),
|
|
82
|
+
]).optional(),
|
|
83
|
+
});
|
|
84
|
+
// Usage statistics
|
|
85
|
+
export const Usage = z.object({
|
|
86
|
+
prompt_tokens: z.number(),
|
|
87
|
+
completion_tokens: z.number(),
|
|
88
|
+
total_tokens: z.number(),
|
|
89
|
+
});
|
|
90
|
+
// Chat completion choice
|
|
91
|
+
export const ChatCompletionChoice = z.object({
|
|
92
|
+
index: z.number(),
|
|
93
|
+
message: ChatMessage,
|
|
94
|
+
finish_reason: z.enum(["stop", "length", "tool_calls", "content_filter"]).nullable(),
|
|
95
|
+
});
|
|
96
|
+
// Chat completion response
|
|
97
|
+
export const ChatCompletionResponse = z.object({
|
|
98
|
+
id: z.string(),
|
|
99
|
+
object: z.literal("chat.completion"),
|
|
100
|
+
created: z.number(),
|
|
101
|
+
model: z.string(),
|
|
102
|
+
choices: z.array(ChatCompletionChoice),
|
|
103
|
+
usage: Usage.optional(),
|
|
104
|
+
});
|
|
105
|
+
// Streaming delta
|
|
106
|
+
export const StreamDelta = z.object({
|
|
107
|
+
role: MessageRole.optional(),
|
|
108
|
+
content: z.string().nullable().optional(),
|
|
109
|
+
reasoning_content: z.string().nullable().optional(),
|
|
110
|
+
tool_calls: z.array(z.object({
|
|
111
|
+
index: z.number(),
|
|
112
|
+
id: z.string().optional(),
|
|
113
|
+
type: z.literal("function").optional(),
|
|
114
|
+
function: z.object({
|
|
115
|
+
name: z.string().optional(),
|
|
116
|
+
arguments: z.string().optional(),
|
|
117
|
+
}).optional(),
|
|
118
|
+
})).optional(),
|
|
119
|
+
});
|
|
120
|
+
// Streaming choice
|
|
121
|
+
export const StreamChoice = z.object({
|
|
122
|
+
index: z.number(),
|
|
123
|
+
delta: StreamDelta,
|
|
124
|
+
finish_reason: z.enum(["stop", "length", "tool_calls", "content_filter"]).nullable(),
|
|
125
|
+
});
|
|
126
|
+
// Streaming chunk
|
|
127
|
+
export const ChatCompletionChunk = z.object({
|
|
128
|
+
id: z.string(),
|
|
129
|
+
object: z.literal("chat.completion.chunk"),
|
|
130
|
+
created: z.number(),
|
|
131
|
+
model: z.string(),
|
|
132
|
+
choices: z.array(StreamChoice),
|
|
133
|
+
usage: Usage.optional().nullable(),
|
|
134
|
+
});
|
|
135
|
+
// API error response
|
|
136
|
+
export const APIError = z.object({
|
|
137
|
+
error: z.object({
|
|
138
|
+
message: z.string(),
|
|
139
|
+
type: z.string().optional(),
|
|
140
|
+
code: z.string().optional(),
|
|
141
|
+
}),
|
|
142
|
+
});
|
|
143
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;GAGG;AAEH,uBAAuB;AACvB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7B,SAAS,EAAS,iDAAiD;IACnE,eAAe,EAAG,wBAAwB;IAC1C,SAAS,EAAS,wBAAwB;IAC1C,UAAU,EAAQ,+BAA+B;IACjD,SAAS,EAAS,0BAA0B;IAC5C,aAAa,EAAK,oBAAoB;IACtC,eAAe,EAAG,aAAa;IAC/B,UAAU,EAAQ,6BAA6B;CAChD,CAAC,CAAC;AAIH,qBAAqB;AACrB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;AAG3E,sBAAsB;AACtB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;KACtB,CAAC;CACH,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C,CAAC,OAAO,CAAC,uBAAuB,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAIH,qBAAqB;AACrB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC5B,CAAC;CACH,CAAC,CAAC"}
|
package/dist/bash.txt
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Executes a given bash command in a persistent shell session.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
- All commands run in the project working directory by default
|
|
5
|
+
- Use the workdir parameter to run in a different directory
|
|
6
|
+
- AVOID using "cd <directory> && <command>" patterns - use workdir instead
|
|
7
|
+
|
|
8
|
+
Parameters:
|
|
9
|
+
- command (required): The command to execute
|
|
10
|
+
- description (required): A clear, concise description of what this command does (5-10 words)
|
|
11
|
+
- workdir (optional): The working directory to run the command in
|
|
12
|
+
- timeout (optional): Timeout in milliseconds (default 120000 = 2 minutes)
|
|
13
|
+
|
|
14
|
+
Important Notes:
|
|
15
|
+
- Always quote file paths that contain spaces with double quotes
|
|
16
|
+
- Output exceeding 2000 lines will be truncated
|
|
17
|
+
- Avoid using bash for file operations - use dedicated tools instead:
|
|
18
|
+
- File search: Use Glob (NOT find or ls)
|
|
19
|
+
- Content search: Use Grep (NOT grep or rg)
|
|
20
|
+
- Read files: Use Read (NOT cat/head/tail)
|
|
21
|
+
- Edit files: Use Edit (NOT sed/awk)
|
|
22
|
+
- Write files: Use Write (NOT echo)
|
|
23
|
+
|
|
24
|
+
Git Safety:
|
|
25
|
+
- NEVER update git config
|
|
26
|
+
- NEVER run destructive git commands (push --force, hard reset) without explicit user request
|
|
27
|
+
- NEVER skip hooks (--no-verify) unless explicitly requested
|
|
28
|
+
- NEVER commit changes unless explicitly asked
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare namespace BusEvent {
|
|
3
|
+
interface Definition<T extends z.ZodType> {
|
|
4
|
+
name: string;
|
|
5
|
+
schema: T;
|
|
6
|
+
}
|
|
7
|
+
function define<T extends z.ZodType>(name: string, schema: T): Definition<T>;
|
|
8
|
+
type BusEventPayload<T extends BusEvent.Definition<any>> = z.infer<T["schema"]>;
|
|
9
|
+
}
|
|
10
|
+
type Listener = (event: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: unknown;
|
|
13
|
+
}) => void;
|
|
14
|
+
declare class BusImpl {
|
|
15
|
+
private listeners;
|
|
16
|
+
subscribe(listener: Listener): () => void;
|
|
17
|
+
publish<T extends BusEvent.Definition<any>>(event: T, properties: z.infer<T["schema"]>): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const Bus: BusImpl;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=bus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bus.d.ts","sourceRoot":"","sources":["../../src/bus/bus.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,yBAAiB,QAAQ,CAAC;IACxB,UAAiB,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO;QAC7C,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,CAAC,CAAC;KACX;IAED,SAAgB,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EACxC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,CAAC,CAAC,CAEf;IAED,KAAY,eAAe,CAAC,CAAC,SAAS,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAC5D,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;CACxB;AAED,KAAK,QAAQ,GAAG,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,KAAK,IAAI,CAAC;AAEvE,cAAM,OAAO;IACX,OAAO,CAAC,SAAS,CAA4B;IAE7C,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI;IAKzC,OAAO,CAAC,CAAC,SAAS,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EACxC,KAAK,EAAE,CAAC,EACR,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAC/B,IAAI;CAOR;AAED,eAAO,MAAM,GAAG,SAAgB,CAAC"}
|
package/dist/bus/bus.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var BusEvent;
|
|
2
|
+
(function (BusEvent) {
|
|
3
|
+
function define(name, schema) {
|
|
4
|
+
return { name, schema };
|
|
5
|
+
}
|
|
6
|
+
BusEvent.define = define;
|
|
7
|
+
})(BusEvent || (BusEvent = {}));
|
|
8
|
+
class BusImpl {
|
|
9
|
+
listeners = new Set();
|
|
10
|
+
subscribe(listener) {
|
|
11
|
+
this.listeners.add(listener);
|
|
12
|
+
return () => this.listeners.delete(listener);
|
|
13
|
+
}
|
|
14
|
+
publish(event, properties) {
|
|
15
|
+
event.schema.parse(properties);
|
|
16
|
+
for (const listener of this.listeners) {
|
|
17
|
+
listener({ type: event.name, properties });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export const Bus = new BusImpl();
|
|
22
|
+
//# sourceMappingURL=bus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bus.js","sourceRoot":"","sources":["../../src/bus/bus.ts"],"names":[],"mappings":"AAEA,MAAM,KAAW,QAAQ,CAexB;AAfD,WAAiB,QAAQ;IAMvB,SAAgB,MAAM,CACpB,IAAY,EACZ,MAAS;QAET,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC;IALe,eAAM,SAKrB,CAAA;AAIH,CAAC,EAfgB,QAAQ,KAAR,QAAQ,QAexB;AAID,MAAM,OAAO;IACH,SAAS,GAAkB,IAAI,GAAG,EAAE,CAAC;IAE7C,SAAS,CAAC,QAAkB;QAC1B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,CACL,KAAQ,EACR,UAAgC;QAEhC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAE/B,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACtC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BusEvent } from "./bus";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
export declare const TodoEvents: {
|
|
4
|
+
Updated: BusEvent.Definition<z.ZodObject<{
|
|
5
|
+
sessionID: z.ZodString;
|
|
6
|
+
todos: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
status: z.ZodEnum<["pending", "in_progress", "completed", "cancelled"]>;
|
|
10
|
+
priority: z.ZodEnum<["high", "medium", "low"]>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
13
|
+
id: string;
|
|
14
|
+
content: string;
|
|
15
|
+
priority: "low" | "high" | "medium";
|
|
16
|
+
}, {
|
|
17
|
+
status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
18
|
+
id: string;
|
|
19
|
+
content: string;
|
|
20
|
+
priority: "low" | "high" | "medium";
|
|
21
|
+
}>, "many">;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
sessionID: string;
|
|
24
|
+
todos: {
|
|
25
|
+
status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
26
|
+
id: string;
|
|
27
|
+
content: string;
|
|
28
|
+
priority: "low" | "high" | "medium";
|
|
29
|
+
}[];
|
|
30
|
+
}, {
|
|
31
|
+
sessionID: string;
|
|
32
|
+
todos: {
|
|
33
|
+
status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
34
|
+
id: string;
|
|
35
|
+
content: string;
|
|
36
|
+
priority: "low" | "high" | "medium";
|
|
37
|
+
}[];
|
|
38
|
+
}>>;
|
|
39
|
+
};
|
|
40
|
+
export declare const SessionEvents: {
|
|
41
|
+
Updated: BusEvent.Definition<z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
id: string;
|
|
45
|
+
}, {
|
|
46
|
+
id: string;
|
|
47
|
+
}>>;
|
|
48
|
+
Deleted: BusEvent.Definition<z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
id: string;
|
|
52
|
+
}, {
|
|
53
|
+
id: string;
|
|
54
|
+
}>>;
|
|
55
|
+
Status: BusEvent.Definition<z.ZodObject<{
|
|
56
|
+
sessionID: z.ZodString;
|
|
57
|
+
status: z.ZodEnum<["idle", "working", "compacting"]>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
status: "idle" | "working" | "compacting";
|
|
60
|
+
sessionID: string;
|
|
61
|
+
}, {
|
|
62
|
+
status: "idle" | "working" | "compacting";
|
|
63
|
+
sessionID: string;
|
|
64
|
+
}>>;
|
|
65
|
+
};
|
|
66
|
+
export declare const MessageEvents: {
|
|
67
|
+
Updated: BusEvent.Definition<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
id: string;
|
|
71
|
+
}, {
|
|
72
|
+
id: string;
|
|
73
|
+
}>>;
|
|
74
|
+
Removed: BusEvent.Definition<z.ZodObject<{
|
|
75
|
+
sessionID: z.ZodString;
|
|
76
|
+
messageID: z.ZodString;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
sessionID: string;
|
|
79
|
+
messageID: string;
|
|
80
|
+
}, {
|
|
81
|
+
sessionID: string;
|
|
82
|
+
messageID: string;
|
|
83
|
+
}>>;
|
|
84
|
+
};
|
|
85
|
+
export declare const McpEvents: {
|
|
86
|
+
StatusChanged: BusEvent.Definition<z.ZodObject<{
|
|
87
|
+
server: z.ZodString;
|
|
88
|
+
status: z.ZodEnum<["connected", "failed", "disabled"]>;
|
|
89
|
+
error: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
status: "connected" | "failed" | "disabled";
|
|
92
|
+
server: string;
|
|
93
|
+
error?: string | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
status: "connected" | "failed" | "disabled";
|
|
96
|
+
server: string;
|
|
97
|
+
error?: string | undefined;
|
|
98
|
+
}>>;
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/bus/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,CAAC,MAAM,KAAK,CAAC;AAWpB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQtB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;CAsBzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;CAezB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;CASrB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BusEvent } from "./bus";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
const TodoSchema = z.object({
|
|
4
|
+
id: z.string().describe("Unique identifier for the todo item"),
|
|
5
|
+
content: z.string().describe("Brief description of the task"),
|
|
6
|
+
status: z.enum(["pending", "in_progress", "completed", "cancelled"])
|
|
7
|
+
.describe("Current status of the task"),
|
|
8
|
+
priority: z.enum(["high", "medium", "low"])
|
|
9
|
+
.describe("Priority level of the task"),
|
|
10
|
+
});
|
|
11
|
+
export const TodoEvents = {
|
|
12
|
+
Updated: BusEvent.define("todo.updated", z.object({
|
|
13
|
+
sessionID: z.string(),
|
|
14
|
+
todos: z.array(TodoSchema),
|
|
15
|
+
})),
|
|
16
|
+
};
|
|
17
|
+
export const SessionEvents = {
|
|
18
|
+
Updated: BusEvent.define("session.updated", z.object({
|
|
19
|
+
id: z.string(),
|
|
20
|
+
})),
|
|
21
|
+
Deleted: BusEvent.define("session.deleted", z.object({
|
|
22
|
+
id: z.string(),
|
|
23
|
+
})),
|
|
24
|
+
Status: BusEvent.define("session.status", z.object({
|
|
25
|
+
sessionID: z.string(),
|
|
26
|
+
status: z.enum(["idle", "working", "compacting"]),
|
|
27
|
+
})),
|
|
28
|
+
};
|
|
29
|
+
export const MessageEvents = {
|
|
30
|
+
Updated: BusEvent.define("message.updated", z.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
})),
|
|
33
|
+
Removed: BusEvent.define("message.removed", z.object({
|
|
34
|
+
sessionID: z.string(),
|
|
35
|
+
messageID: z.string(),
|
|
36
|
+
})),
|
|
37
|
+
};
|
|
38
|
+
export const McpEvents = {
|
|
39
|
+
StatusChanged: BusEvent.define("mcp.status", z.object({
|
|
40
|
+
server: z.string(),
|
|
41
|
+
status: z.enum(["connected", "failed", "disabled"]),
|
|
42
|
+
error: z.string().optional(),
|
|
43
|
+
})),
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/bus/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAC9D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC7D,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;SACjE,QAAQ,CAAC,4BAA4B,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;SACxC,QAAQ,CAAC,4BAA4B,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE,QAAQ,CAAC,MAAM,CACtB,cAAc,EACd,CAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC;KAC3B,CAAC,CACH;CACF,CAAC;AAEF,MAAM,CAAC,MAA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AAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bus/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bus/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Performs exact string replacements in files.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
- You must use the Read tool at least once before editing a file
|
|
5
|
+
- When editing text, preserve the exact indentation (tabs/spaces) as it appears in the file
|
|
6
|
+
- ALWAYS prefer editing existing files over writing new files
|
|
7
|
+
- Only use emojis if the user explicitly requests it
|
|
8
|
+
|
|
9
|
+
Parameters:
|
|
10
|
+
- filePath (required): The absolute path to the file to modify
|
|
11
|
+
- oldString (required): The text to replace
|
|
12
|
+
- newString (required): The text to replace it with (must be different from oldString)
|
|
13
|
+
- replaceAll (optional): Replace all occurrences of oldString (default false)
|
|
14
|
+
|
|
15
|
+
Error Conditions:
|
|
16
|
+
- The edit will FAIL if oldString is not found in the file
|
|
17
|
+
- The edit will FAIL if oldString is found multiple times (unless replaceAll is true)
|
|
18
|
+
- Provide more context in oldString to make it unique if needed
|
|
19
|
+
|
|
20
|
+
Notes:
|
|
21
|
+
- Use replaceAll for renaming variables or strings across a file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Reads a file from the local filesystem.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
- The filePath parameter must be an absolute path, not a relative path
|
|
5
|
+
- By default, it reads up to 2000 lines starting from the beginning of the file
|
|
6
|
+
- You can optionally specify a line offset and limit (especially handy for long files)
|
|
7
|
+
- Any lines longer than 2000 characters will be truncated
|
|
8
|
+
- Results are returned with line numbers starting at 1
|
|
9
|
+
|
|
10
|
+
Parameters:
|
|
11
|
+
- filePath (required): The absolute path to the file to read
|
|
12
|
+
- offset (optional): The line number to start reading from (0-based)
|
|
13
|
+
- limit (optional): The number of lines to read (defaults to 2000)
|
|
14
|
+
|
|
15
|
+
Notes:
|
|
16
|
+
- You can read multiple files in parallel by making multiple tool calls
|
|
17
|
+
- If you read a file that exists but has empty contents, you will receive a warning
|
|
18
|
+
- You can read image files using this tool
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Writes a file to the local filesystem.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
- This tool will overwrite an existing file if there is one at the provided path
|
|
5
|
+
- If this is an existing file, you MUST use the Read tool first to read the file's contents
|
|
6
|
+
- ALWAYS prefer editing existing files in the codebase over creating new ones
|
|
7
|
+
- NEVER proactively create documentation files (*.md) or README files unless explicitly requested
|
|
8
|
+
- Only use emojis if the user explicitly requests it
|
|
9
|
+
|
|
10
|
+
Parameters:
|
|
11
|
+
- filePath (required): The absolute path to the file to write (must be absolute, not relative)
|
|
12
|
+
- content (required): The content to write to the file
|
|
13
|
+
|
|
14
|
+
Notes:
|
|
15
|
+
- Creates parent directories if they don't exist
|
|
16
|
+
- Preserves file permissions when overwriting
|
package/dist/glob.txt
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Fast file pattern matching tool that works with any codebase size.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
- Supports glob patterns like "**/*.js" or "src/**/*.ts"
|
|
5
|
+
- Returns matching file paths sorted by modification time
|
|
6
|
+
- Use this tool when you need to find files by name patterns
|
|
7
|
+
|
|
8
|
+
Parameters:
|
|
9
|
+
- pattern (required): The glob pattern to match files against
|
|
10
|
+
- path (optional): The directory to search in (defaults to current working directory)
|
|
11
|
+
|
|
12
|
+
When to Use:
|
|
13
|
+
- Finding files by extension or name pattern
|
|
14
|
+
- Locating specific file types in a directory tree
|
|
15
|
+
- Quick file discovery before reading
|
|
16
|
+
|
|
17
|
+
When NOT to Use:
|
|
18
|
+
- Searching for content inside files (use Grep instead)
|
|
19
|
+
- Finding a specific known file path (use Read instead)
|
package/dist/global.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"AAGA,yBAAiB,MAAM,CAAC;IACtB,UAAiB,IAAI,CAAC;QAIb,MAAM,MAAM,EAAE,MAAsB,CAAC;QACrC,MAAM,IAAI,EAAE,MAAsB,CAAC;QACnC,MAAM,IAAI,EAAE,MAAyC,CAAC;KAC9D;CACF"}
|
package/dist/global.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import os from "os";
|
|
2
|
+
import path from "path";
|
|
3
|
+
export var Global;
|
|
4
|
+
(function (Global) {
|
|
5
|
+
let Path;
|
|
6
|
+
(function (Path) {
|
|
7
|
+
const homeDir = os.homedir();
|
|
8
|
+
const baseConfigDir = path.join(homeDir, ".config", "glm-cli");
|
|
9
|
+
Path.config = baseConfigDir;
|
|
10
|
+
Path.data = baseConfigDir;
|
|
11
|
+
Path.logs = path.join(baseConfigDir, "logs");
|
|
12
|
+
})(Path = Global.Path || (Global.Path = {}));
|
|
13
|
+
})(Global || (Global = {}));
|
|
14
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,KAAW,MAAM,CAStB;AATD,WAAiB,MAAM;IACrB,IAAiB,IAAI,CAOpB;IAPD,WAAiB,IAAI;QACnB,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;QAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAElD,WAAM,GAAW,aAAa,CAAC;QAC/B,SAAI,GAAW,aAAa,CAAC;QAC7B,SAAI,GAAW,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC,EAPgB,IAAI,GAAJ,WAAI,KAAJ,WAAI,QAOpB;AACH,CAAC,EATgB,MAAM,KAAN,MAAM,QAStB"}
|
package/dist/grep.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Fast content search tool that works with any codebase size.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
- Searches file contents using regular expressions
|
|
5
|
+
- Supports full regex syntax (e.g., "log.*Error", "function\\s+\\w+")
|
|
6
|
+
- Filter files by pattern with the include parameter
|
|
7
|
+
- Returns file paths and line numbers with matches, sorted by modification time
|
|
8
|
+
|
|
9
|
+
Parameters:
|
|
10
|
+
- pattern (required): The regex pattern to search for in file contents
|
|
11
|
+
- path (optional): The directory to search in (defaults to current working directory)
|
|
12
|
+
- include (optional): File pattern to include (e.g., "*.js", "*.{ts,tsx}")
|
|
13
|
+
|
|
14
|
+
When to Use:
|
|
15
|
+
- Finding files containing specific patterns
|
|
16
|
+
- Locating function definitions or usages
|
|
17
|
+
- Searching for error messages or log statements
|
|
18
|
+
|
|
19
|
+
Notes:
|
|
20
|
+
- Use Bash with rg (ripgrep) directly if you need to count matches within files
|