shortcutxl 0.3.76 → 0.3.77
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/BINARY-INVENTORY.json +813 -813
- package/CHANGELOG.md +6 -0
- package/dist/ai/models.d.ts +10 -6
- package/dist/ai/models.generated.d.ts +72 -0
- package/dist/ai/models.generated.js +33 -0
- package/dist/ai/models.js +36 -13
- package/dist/ai/providers/anthropic.d.ts +4 -2
- package/dist/ai/providers/anthropic.js +59 -29
- package/dist/ai/providers/azure-openai-responses.d.ts +2 -1
- package/dist/ai/providers/azure-openai-responses.js +4 -20
- package/dist/ai/providers/google-vertex.d.ts +8 -2
- package/dist/ai/providers/google-vertex.js +66 -54
- package/dist/ai/providers/google.js +15 -48
- package/dist/ai/providers/openai-completions.d.ts +4 -1
- package/dist/ai/providers/openai-completions.js +26 -10
- package/dist/ai/providers/openai-reasoning.d.ts +5 -0
- package/dist/ai/providers/openai-reasoning.js +13 -0
- package/dist/ai/providers/openai-responses-shared.js +1 -1
- package/dist/ai/providers/openai-responses.d.ts +6 -2
- package/dist/ai/providers/openai-responses.js +28 -23
- package/dist/ai/providers/simple-options.d.ts +2 -3
- package/dist/ai/providers/simple-options.js +4 -6
- package/dist/ai/types.d.ts +19 -2
- package/dist/app/agent-session-runtime-adapter.js +7 -6
- package/dist/app/approvals/approval-errors.d.ts +15 -0
- package/dist/app/approvals/approval-errors.js +14 -0
- package/dist/app/approvals/runtime-approval-gates.d.ts +1 -2
- package/dist/app/approvals/tool-approval.d.ts +1 -0
- package/dist/app/approvals/tool-approval.js +11 -23
- package/dist/app/approvals/types.d.ts +0 -14
- package/dist/app/approvals/types.js +0 -2
- package/dist/app/background/tool-summaries.js +0 -2
- package/dist/app/local/tools/execute-code/executor.d.ts +1 -1
- package/dist/app/local/tools/execute-code/executor.js +20 -10
- package/dist/app/local/tools/execute-code/tool.js +21 -2
- package/dist/app/permissions/runtime-approval-flow.d.ts +1 -5
- package/dist/app/permissions/runtime-approval-flow.js +0 -28
- package/dist/app/permissions/tool-gates.d.ts +2 -3
- package/dist/app/permissions/tool-gates.js +3 -81
- package/dist/app/prompts/shared-guidelines.js +2 -2
- package/dist/app/providers/google-vertex-gateway.js +4 -51
- package/dist/app/providers/model-registry.d.ts +1 -0
- package/dist/app/providers/model-registry.js +39 -0
- package/dist/app/providers/model-resolver.js +10 -7
- package/dist/app/providers/register-shortcut-provider.js +2 -6
- package/dist/app/providers/shortcut-api-v2-transport.js +4 -0
- package/dist/app/providers/shortcut-llm-proxy-client.d.ts +2 -2
- package/dist/app/providers/shortcut-llm-proxy-client.js +1 -0
- package/dist/app/resources/package-manager.js +2 -123
- package/dist/app/resources/resource-patterns.d.ts +9 -0
- package/dist/app/resources/resource-patterns.js +120 -0
- package/dist/app/session/forked-agent.d.ts +2 -2
- package/dist/app/session/model-manager.js +3 -2
- package/dist/app/session/session-lifecycle.js +3 -2
- package/dist/app/session/session-models.d.ts +2 -0
- package/dist/app/session/session-models.js +14 -6
- package/dist/app/settings-manager.d.ts +3 -3
- package/dist/app/shared/tools/execute-code/mog.d.ts +3 -1
- package/dist/app/shared/tools/execute-code/mog.js +18 -2
- package/dist/app/tools/execute-code/index.d.ts +1 -0
- package/dist/app/tools/execute-code/index.js +3 -1
- package/dist/app/tools/find-ignore-files.d.ts +3 -0
- package/dist/app/tools/find-ignore-files.js +33 -0
- package/dist/app/tools/find.js +2 -21
- package/dist/app/tools/llm-analysis.js +0 -2
- package/dist/app/tools/refresh-context.d.ts +1 -1
- package/dist/app/tools/session-settings/update-session-settings.js +2 -2
- package/dist/app/tools/take-screenshot.js +0 -2
- package/dist/app/tools/task/runner.js +1 -2
- package/dist/app/tools/task/task.d.ts +1 -3
- package/dist/app/tools/task/task.js +20 -40
- package/dist/autocomplete/core.d.ts +33 -0
- package/dist/autocomplete/core.js +113 -0
- package/dist/{tui → autocomplete}/fuzzy.d.ts +0 -1
- package/dist/{tui → autocomplete}/fuzzy.js +0 -1
- package/dist/{tui/autocomplete.d.ts → autocomplete/index.d.ts} +0 -1
- package/dist/{tui/autocomplete.js → autocomplete/index.js} +62 -158
- package/dist/cli/args.js +1 -1
- package/dist/cli/list-models.js +1 -1
- package/dist/cli.js +25535 -28515
- package/dist/contracts/agent-session-store.d.ts +1 -1
- package/dist/contracts/agent-settings.d.ts +1 -0
- package/dist/contracts/agent-settings.js +2 -1
- package/dist/contracts/model-call.d.ts +1 -1
- package/dist/contracts/model-stream.d.ts +1 -0
- package/dist/contracts/model-stream.js +1 -0
- package/dist/contracts/wire.d.ts +2 -6
- package/dist/core/agent-engine.js +1 -1
- package/dist/core/core-types.d.ts +1 -21
- package/dist/core/defaults.d.ts +1 -1
- package/dist/core/defaults.js +9 -1
- package/dist/core/prompts/agent-guidelines.d.ts +4 -5
- package/dist/core/prompts/agent-guidelines.js +28 -42
- package/dist/core/session-schema.d.ts +1 -1
- package/dist/embedded-agent/ai-invoke.js +5 -3
- package/dist/embedded-agent/anthropic-messages-transport.d.ts +5 -20
- package/dist/embedded-agent/anthropic-messages-transport.js +23 -786
- package/dist/embedded-agent/bootstrap.js +2 -2
- package/dist/embedded-agent/compose.js +8 -7
- package/dist/embedded-agent/gateway-base-url.d.ts +3 -0
- package/dist/embedded-agent/gateway-base-url.js +35 -0
- package/dist/embedded-agent/google-vertex-transport.d.ts +2 -10
- package/dist/embedded-agent/google-vertex-transport.js +20 -117
- package/dist/embedded-agent/host-runtime-options.d.ts +0 -8
- package/dist/embedded-agent/host-runtime-options.js +10 -2
- package/dist/embedded-agent/host-tools/invoke-llm/contract.d.ts +1 -1
- package/dist/embedded-agent/host-tools/invoke-llm/contract.js +3 -1
- package/dist/embedded-agent/host-tools/sandbox-llm/contract.d.ts +8 -3
- package/dist/embedded-agent/host-tools/sandbox-llm/contract.js +12 -8
- package/dist/embedded-agent/host-tools/sandbox-llm/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/sandbox-llm/index.js +1 -1
- package/dist/embedded-agent/host-tools/take-screenshot/contract.d.ts +0 -2
- package/dist/embedded-agent/host-tools/take-screenshot/contract.js +1 -3
- package/dist/embedded-agent/host-tools/take-screenshot/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/take-screenshot/index.js +1 -1
- package/dist/embedded-agent/host-tools/task/agents/clone.js +1 -2
- package/dist/embedded-agent/host-tools/task/contract.js +1 -1
- package/dist/embedded-agent/model-selection.d.ts +0 -6
- package/dist/embedded-agent/model-selection.js +15 -8
- package/dist/embedded-agent/openai-completions-transport.d.ts +2 -10
- package/dist/embedded-agent/openai-completions-transport.js +20 -120
- package/dist/embedded-agent/openai-responses-transport.d.ts +2 -10
- package/dist/embedded-agent/openai-responses-transport.js +15 -170
- package/dist/embedded-agent/prompt/build.js +1 -2
- package/dist/embedded-agent/provider-native-request.d.ts +24 -0
- package/dist/embedded-agent/provider-native-request.js +64 -0
- package/dist/embedded-agent/run-stats.d.ts +1 -1
- package/dist/embedded-agent/stream.d.ts +3 -9
- package/dist/embedded-agent/stream.js +11 -19
- package/dist/main.js +2 -13
- package/dist/rpc/rpc-approval-gates.js +1 -2
- package/dist/shell/approvals/runtime-approval-gates.js +1 -3
- package/dist/shell/components/selectors/model-selector.js +2 -1
- package/dist/shell/components/selectors/session-selector-search.js +1 -1
- package/dist/shell/components/selectors/thinking-selector.js +7 -6
- package/dist/shell/index.d.ts +0 -1
- package/dist/shell/index.js +0 -1
- package/dist/shell/interactive/interactive-mode.js +3 -1
- package/dist/shell/theme/runtime.d.ts +1 -1
- package/dist/shell/theme/runtime.js +1 -0
- package/dist/shortcut-model-catalog.d.ts +7 -2
- package/dist/shortcut-model-catalog.js +127 -10
- package/dist/tui/components/editor.d.ts +1 -1
- package/dist/tui/components/editor.js +1 -1
- package/dist/tui/components/settings-list.js +1 -1
- package/dist/tui/editor-component.d.ts +1 -1
- package/dist/tui/index.d.ts +0 -7
- package/dist/tui/index.js +0 -5
- package/native-app/main/index.js +3199 -47
- package/native-app/main/{photon_rs-SoVDgheu.js → photon_rs-XkYyYTVA.js} +2 -2
- package/native-app/package.json +1 -1
- package/native-app/preload/index.cjs +2 -0
- package/native-app/renderer/assets/{index-OhGE0UY4.css → index-B9UxxO8s.css} +4 -2
- package/native-app/renderer/assets/{index-CFc-oZuS.js → index-CtherCML.js} +231 -4
- package/native-app/renderer/index.html +2 -2
- package/package.json +16 -3
- package/skills/add-custom-model/SKILL.md +52 -0
- package/user-docs/dist/shortcutxl-docs.pdf +0 -0
- package/xll/ShortcutXL.xll +0 -0
- package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/idna-3.18.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/pip-26.1.2.dist-info/RECORD +3 -3
- package/xll/python/Lib/site-packages/pywin32-311.dist-info/RECORD +2 -2
- package/xll/python/Scripts/httpx.exe +0 -0
- package/xll/python/Scripts/idna.exe +0 -0
- package/xll/python/Scripts/pip.exe +0 -0
- package/xll/python/Scripts/pip3.13.exe +0 -0
- package/xll/python/Scripts/pip3.exe +0 -0
- package/xll/python/Scripts/pywin32_postinstall.exe +0 -0
- package/xll/python/Scripts/pywin32_testall.exe +0 -0
- package/dist/shell/approvals/task-spawn-approval.d.ts +0 -20
- package/dist/shell/approvals/task-spawn-approval.js +0 -93
- /package/dist/{tui → autocomplete}/skill-autocomplete.js +0 -0
|
@@ -2,71 +2,16 @@ import { spawnSync } from 'child_process';
|
|
|
2
2
|
import { readdirSync, statSync } from 'fs';
|
|
3
3
|
import { homedir } from 'os';
|
|
4
4
|
import { basename, dirname, join } from 'path';
|
|
5
|
+
import {
|
|
6
|
+
applyAutocompleteCompletion,
|
|
7
|
+
buildCompletionValue,
|
|
8
|
+
extractAtPrefix,
|
|
9
|
+
extractQuotedPrefix,
|
|
10
|
+
findLastDelimiter,
|
|
11
|
+
parsePathPrefix
|
|
12
|
+
} from './core.js';
|
|
5
13
|
import { fuzzyFilter } from './fuzzy.js';
|
|
6
14
|
import { extractInlineSkillAutocompleteToken } from './skill-autocomplete.js';
|
|
7
|
-
const PATH_DELIMITERS = new Set([' ', '\t', '"', "'", '=']);
|
|
8
|
-
function findLastDelimiter(text) {
|
|
9
|
-
for (let i = text.length - 1; i >= 0; i -= 1) {
|
|
10
|
-
if (PATH_DELIMITERS.has(text[i] ?? '')) {
|
|
11
|
-
return i;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return -1;
|
|
15
|
-
}
|
|
16
|
-
function findUnclosedQuoteStart(text) {
|
|
17
|
-
let inQuotes = false;
|
|
18
|
-
let quoteStart = -1;
|
|
19
|
-
for (let i = 0; i < text.length; i += 1) {
|
|
20
|
-
if (text[i] === '"') {
|
|
21
|
-
inQuotes = !inQuotes;
|
|
22
|
-
if (inQuotes) {
|
|
23
|
-
quoteStart = i;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return inQuotes ? quoteStart : null;
|
|
28
|
-
}
|
|
29
|
-
function isTokenStart(text, index) {
|
|
30
|
-
return index === 0 || PATH_DELIMITERS.has(text[index - 1] ?? '');
|
|
31
|
-
}
|
|
32
|
-
function extractQuotedPrefix(text) {
|
|
33
|
-
const quoteStart = findUnclosedQuoteStart(text);
|
|
34
|
-
if (quoteStart === null) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
if (quoteStart > 0 && text[quoteStart - 1] === '@') {
|
|
38
|
-
if (!isTokenStart(text, quoteStart - 1)) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
return text.slice(quoteStart - 1);
|
|
42
|
-
}
|
|
43
|
-
if (!isTokenStart(text, quoteStart)) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
return text.slice(quoteStart);
|
|
47
|
-
}
|
|
48
|
-
function parsePathPrefix(prefix) {
|
|
49
|
-
if (prefix.startsWith('@"')) {
|
|
50
|
-
return { rawPrefix: prefix.slice(2), isAtPrefix: true, isQuotedPrefix: true };
|
|
51
|
-
}
|
|
52
|
-
if (prefix.startsWith('"')) {
|
|
53
|
-
return { rawPrefix: prefix.slice(1), isAtPrefix: false, isQuotedPrefix: true };
|
|
54
|
-
}
|
|
55
|
-
if (prefix.startsWith('@')) {
|
|
56
|
-
return { rawPrefix: prefix.slice(1), isAtPrefix: true, isQuotedPrefix: false };
|
|
57
|
-
}
|
|
58
|
-
return { rawPrefix: prefix, isAtPrefix: false, isQuotedPrefix: false };
|
|
59
|
-
}
|
|
60
|
-
function buildCompletionValue(path, options) {
|
|
61
|
-
const needsQuotes = options.isQuotedPrefix || path.includes(' ');
|
|
62
|
-
const prefix = options.isAtPrefix ? '@' : '';
|
|
63
|
-
if (!needsQuotes) {
|
|
64
|
-
return `${prefix}${path}`;
|
|
65
|
-
}
|
|
66
|
-
const openQuote = `${prefix}"`;
|
|
67
|
-
const closeQuote = '"';
|
|
68
|
-
return `${openQuote}${path}${closeQuote}`;
|
|
69
|
-
}
|
|
70
15
|
// Use fd to walk directory tree (fast, respects .gitignore)
|
|
71
16
|
function walkDirectoryWithFd(baseDir, fdPath, query, maxResults) {
|
|
72
17
|
const args = [
|
|
@@ -99,10 +44,11 @@ function walkDirectoryWithFd(baseDir, fdPath, query, maxResults) {
|
|
|
99
44
|
if (result.status !== 0 || !result.stdout) {
|
|
100
45
|
return [];
|
|
101
46
|
}
|
|
102
|
-
const lines = result.stdout.trim().split(
|
|
47
|
+
const lines = result.stdout.trim().split(/\r?\n/).filter(Boolean);
|
|
103
48
|
const results = [];
|
|
104
49
|
for (const line of lines) {
|
|
105
|
-
const
|
|
50
|
+
const posixPath = line.replaceAll('\\', '/');
|
|
51
|
+
const normalizedPath = posixPath.endsWith('/') ? posixPath.slice(0, -1) : posixPath;
|
|
106
52
|
if (
|
|
107
53
|
normalizedPath === '.git' ||
|
|
108
54
|
normalizedPath.startsWith('.git/') ||
|
|
@@ -111,14 +57,58 @@ function walkDirectoryWithFd(baseDir, fdPath, query, maxResults) {
|
|
|
111
57
|
continue;
|
|
112
58
|
}
|
|
113
59
|
// fd outputs directories with trailing /
|
|
114
|
-
const isDirectory =
|
|
60
|
+
const isDirectory = posixPath.endsWith('/');
|
|
115
61
|
results.push({
|
|
116
|
-
path:
|
|
62
|
+
path: posixPath,
|
|
117
63
|
isDirectory
|
|
118
64
|
});
|
|
119
65
|
}
|
|
120
66
|
return results;
|
|
121
67
|
}
|
|
68
|
+
// Keep autocomplete available when the shared tool bootstrap cannot provide fd, such as in
|
|
69
|
+
// offline mode or on an unsupported platform.
|
|
70
|
+
function walkDirectoryWithoutFd(baseDir, query, maxResults) {
|
|
71
|
+
const normalizedQuery = query.toLowerCase();
|
|
72
|
+
const results = [];
|
|
73
|
+
const pendingDirectories = [''];
|
|
74
|
+
let visitedEntries = 0;
|
|
75
|
+
const maxVisitedEntries = 20_000;
|
|
76
|
+
|
|
77
|
+
while (
|
|
78
|
+
pendingDirectories.length > 0 &&
|
|
79
|
+
results.length < maxResults &&
|
|
80
|
+
visitedEntries < maxVisitedEntries
|
|
81
|
+
) {
|
|
82
|
+
const relativeDirectory = pendingDirectories.shift() ?? '';
|
|
83
|
+
const directory = relativeDirectory ? join(baseDir, relativeDirectory) : baseDir;
|
|
84
|
+
let entries;
|
|
85
|
+
try {
|
|
86
|
+
entries = readdirSync(directory, { withFileTypes: true });
|
|
87
|
+
} catch {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
entries.sort((a, b) => {
|
|
91
|
+
if (a.isDirectory() !== b.isDirectory()) return a.isDirectory() ? -1 : 1;
|
|
92
|
+
return a.name.localeCompare(b.name);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
for (const entry of entries) {
|
|
96
|
+
visitedEntries++;
|
|
97
|
+
if (entry.name === '.git' || entry.name === 'node_modules') continue;
|
|
98
|
+
const relativePath = relativeDirectory ? join(relativeDirectory, entry.name) : entry.name;
|
|
99
|
+
const displayPath = relativePath.split('\\').join('/');
|
|
100
|
+
const isDirectory = entry.isDirectory();
|
|
101
|
+
if (isDirectory) pendingDirectories.push(relativePath);
|
|
102
|
+
if (!normalizedQuery || displayPath.toLowerCase().includes(normalizedQuery)) {
|
|
103
|
+
results.push({ path: isDirectory ? `${displayPath}/` : displayPath, isDirectory });
|
|
104
|
+
if (results.length >= maxResults) break;
|
|
105
|
+
}
|
|
106
|
+
if (visitedEntries >= maxVisitedEntries) break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return results;
|
|
111
|
+
}
|
|
122
112
|
// Combined provider that handles both slash commands and file paths
|
|
123
113
|
export class CombinedAutocompleteProvider {
|
|
124
114
|
commands;
|
|
@@ -253,94 +243,11 @@ export class CombinedAutocompleteProvider {
|
|
|
253
243
|
return null;
|
|
254
244
|
}
|
|
255
245
|
applyCompletion(lines, cursorLine, cursorCol, item, prefix) {
|
|
256
|
-
|
|
257
|
-
const beforePrefix = currentLine.slice(0, cursorCol - prefix.length);
|
|
258
|
-
const afterCursor = currentLine.slice(cursorCol);
|
|
259
|
-
const isQuotedPrefix = prefix.startsWith('"') || prefix.startsWith('@"');
|
|
260
|
-
const hasLeadingQuoteAfterCursor = afterCursor.startsWith('"');
|
|
261
|
-
const hasTrailingQuoteInItem = item.value.endsWith('"');
|
|
262
|
-
const adjustedAfterCursor =
|
|
263
|
-
isQuotedPrefix && hasTrailingQuoteInItem && hasLeadingQuoteAfterCursor
|
|
264
|
-
? afterCursor.slice(1)
|
|
265
|
-
: afterCursor;
|
|
266
|
-
// Check if we're completing a slash command (prefix starts with "/" but NOT a file path)
|
|
267
|
-
// Slash commands are at the start of the line and don't contain path separators after the first /
|
|
268
|
-
const isSlashCommand =
|
|
269
|
-
prefix.startsWith('/') &&
|
|
270
|
-
!prefix.slice(1).includes('/') &&
|
|
271
|
-
(beforePrefix.trim() === '' || item.value.startsWith('skill:'));
|
|
272
|
-
if (isSlashCommand) {
|
|
273
|
-
// This is a command name completion
|
|
274
|
-
const newLine = `${beforePrefix}/${item.value} ${adjustedAfterCursor}`;
|
|
275
|
-
const newLines = [...lines];
|
|
276
|
-
newLines[cursorLine] = newLine;
|
|
277
|
-
return {
|
|
278
|
-
lines: newLines,
|
|
279
|
-
cursorLine,
|
|
280
|
-
cursorCol: beforePrefix.length + item.value.length + 2 // +2 for "/" and space
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
// Check if we're completing a file attachment (prefix starts with "@")
|
|
284
|
-
if (prefix.startsWith('@')) {
|
|
285
|
-
// This is a file attachment completion
|
|
286
|
-
// Don't add space after directories so user can continue autocompleting
|
|
287
|
-
const isDirectory = item.label.endsWith('/');
|
|
288
|
-
const suffix = isDirectory ? '' : ' ';
|
|
289
|
-
const newLine = `${beforePrefix + item.value}${suffix}${adjustedAfterCursor}`;
|
|
290
|
-
const newLines = [...lines];
|
|
291
|
-
newLines[cursorLine] = newLine;
|
|
292
|
-
const hasTrailingQuote = item.value.endsWith('"');
|
|
293
|
-
const cursorOffset =
|
|
294
|
-
isDirectory && hasTrailingQuote ? item.value.length - 1 : item.value.length;
|
|
295
|
-
return {
|
|
296
|
-
lines: newLines,
|
|
297
|
-
cursorLine,
|
|
298
|
-
cursorCol: beforePrefix.length + cursorOffset + suffix.length
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
// Check if we're in a slash command context (beforePrefix contains "/command ")
|
|
302
|
-
const textBeforeCursor = currentLine.slice(0, cursorCol);
|
|
303
|
-
if (textBeforeCursor.includes('/') && textBeforeCursor.includes(' ')) {
|
|
304
|
-
// This is likely a command argument completion
|
|
305
|
-
const newLine = beforePrefix + item.value + adjustedAfterCursor;
|
|
306
|
-
const newLines = [...lines];
|
|
307
|
-
newLines[cursorLine] = newLine;
|
|
308
|
-
const isDirectory = item.label.endsWith('/');
|
|
309
|
-
const hasTrailingQuote = item.value.endsWith('"');
|
|
310
|
-
const cursorOffset =
|
|
311
|
-
isDirectory && hasTrailingQuote ? item.value.length - 1 : item.value.length;
|
|
312
|
-
return {
|
|
313
|
-
lines: newLines,
|
|
314
|
-
cursorLine,
|
|
315
|
-
cursorCol: beforePrefix.length + cursorOffset
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
// For file paths, complete the path
|
|
319
|
-
const newLine = beforePrefix + item.value + adjustedAfterCursor;
|
|
320
|
-
const newLines = [...lines];
|
|
321
|
-
newLines[cursorLine] = newLine;
|
|
322
|
-
const isDirectory = item.label.endsWith('/');
|
|
323
|
-
const hasTrailingQuote = item.value.endsWith('"');
|
|
324
|
-
const cursorOffset =
|
|
325
|
-
isDirectory && hasTrailingQuote ? item.value.length - 1 : item.value.length;
|
|
326
|
-
return {
|
|
327
|
-
lines: newLines,
|
|
328
|
-
cursorLine,
|
|
329
|
-
cursorCol: beforePrefix.length + cursorOffset
|
|
330
|
-
};
|
|
246
|
+
return applyAutocompleteCompletion(lines, cursorLine, cursorCol, item, prefix);
|
|
331
247
|
}
|
|
332
248
|
// Extract @ prefix for fuzzy file suggestions
|
|
333
249
|
extractAtPrefix(text) {
|
|
334
|
-
|
|
335
|
-
if (quotedPrefix?.startsWith('@"')) {
|
|
336
|
-
return quotedPrefix;
|
|
337
|
-
}
|
|
338
|
-
const lastDelimiterIndex = findLastDelimiter(text);
|
|
339
|
-
const tokenStart = lastDelimiterIndex === -1 ? 0 : lastDelimiterIndex + 1;
|
|
340
|
-
if (text[tokenStart] === '@') {
|
|
341
|
-
return text.slice(tokenStart);
|
|
342
|
-
}
|
|
343
|
-
return null;
|
|
250
|
+
return extractAtPrefix(text);
|
|
344
251
|
}
|
|
345
252
|
// Extract a path-like prefix from the text before cursor
|
|
346
253
|
extractPathPrefix(text, forceExtract = false) {
|
|
@@ -546,15 +453,13 @@ export class CombinedAutocompleteProvider {
|
|
|
546
453
|
}
|
|
547
454
|
// Fuzzy file search using fd (fast, respects .gitignore)
|
|
548
455
|
getFuzzyFileSuggestions(query, options) {
|
|
549
|
-
if (!this.fdPath) {
|
|
550
|
-
// fd not available, return empty results
|
|
551
|
-
return [];
|
|
552
|
-
}
|
|
553
456
|
try {
|
|
554
457
|
const scopedQuery = this.resolveScopedFuzzyQuery(query);
|
|
555
458
|
const fdBaseDir = scopedQuery?.baseDir ?? this.basePath;
|
|
556
459
|
const fdQuery = scopedQuery?.query ?? query;
|
|
557
|
-
const entries =
|
|
460
|
+
const entries = this.fdPath
|
|
461
|
+
? walkDirectoryWithFd(fdBaseDir, this.fdPath, fdQuery, 100)
|
|
462
|
+
: walkDirectoryWithoutFd(fdBaseDir, fdQuery, 100);
|
|
558
463
|
// Score entries
|
|
559
464
|
const scoredEntries = entries
|
|
560
465
|
.map((entry) => ({
|
|
@@ -622,4 +527,3 @@ export class CombinedAutocompleteProvider {
|
|
|
622
527
|
return true;
|
|
623
528
|
}
|
|
624
529
|
}
|
|
625
|
-
//# sourceMappingURL=autocomplete.js.map
|
package/dist/cli/args.js
CHANGED
|
@@ -233,7 +233,7 @@ ${chalk.bold('Options:')}
|
|
|
233
233
|
--session <path> Use specific session file
|
|
234
234
|
--session-dir <dir> Directory for session storage and lookup
|
|
235
235
|
--no-session Don't save session (ephemeral)
|
|
236
|
-
--thinking <level> Set thinking level: off, minimal, low, medium, high, xhigh
|
|
236
|
+
--thinking <level> Set thinking level: off, minimal, low, medium, high, xhigh, max
|
|
237
237
|
--extension, -e <path> Load an extension file (can be used multiple times)
|
|
238
238
|
--no-extensions, -ne Disable extension discovery (explicit -e paths still work)
|
|
239
239
|
--skill <path> Load a skill file or directory (can be used multiple times)
|
package/dist/cli/list-models.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* List available models with optional fuzzy search
|
|
3
3
|
*/
|
|
4
4
|
import { filterInteractiveSelectableModels } from '../app/session/session-models.js';
|
|
5
|
-
import { fuzzyFilter } from '../
|
|
5
|
+
import { fuzzyFilter } from '../autocomplete/fuzzy.js';
|
|
6
6
|
/**
|
|
7
7
|
* Format a number as human-readable (e.g., 200000 -> "200K", 1000000 -> "1M")
|
|
8
8
|
*/
|