xcode-copilot-server 1.0.2 → 1.0.3
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 +7 -0
- package/config.json5 +12 -1
- package/dist/utils/prompt.d.ts +8 -3
- package/dist/utils/prompt.js +8 -3
- package/dist/utils/prompt.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,12 +102,19 @@ The config file uses [JSON5](https://json5.org/) format, which supports comments
|
|
|
102
102
|
|
|
103
103
|
// Built-in CLI tools allowlist.
|
|
104
104
|
// ["*"] to allow all, [] to deny all, or a list of specific tool names.
|
|
105
|
+
//
|
|
106
|
+
// Empty by default so Xcode can handle all operations (search, read, edit)
|
|
107
|
+
// through its UI. Enabling CLI tools lets the Copilot session perform
|
|
108
|
+
// those operations directly, bypassing Xcode.
|
|
105
109
|
allowedCliTools: [],
|
|
106
110
|
|
|
107
111
|
// Maximum request body size in MiB.
|
|
108
112
|
bodyLimitMiB: 4,
|
|
109
113
|
|
|
110
114
|
// Filename patterns to filter out from search results in the prompt.
|
|
115
|
+
//
|
|
116
|
+
// Xcode can include full file contents for every search match, so add patterns
|
|
117
|
+
// here to strip files that bloat the prompt (e.g. ["mock", "generated"]).
|
|
111
118
|
excludedFilePatterns: [],
|
|
112
119
|
|
|
113
120
|
// Reasoning effort for models that support it: "low", "medium", "high", "xhigh"
|
package/config.json5
CHANGED
|
@@ -24,10 +24,17 @@
|
|
|
24
24
|
// },
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
-
// Built-in CLI tools allowlist (glob, grep, bash, etc)
|
|
27
|
+
// Built-in CLI tools allowlist (glob, grep, bash, etc).
|
|
28
28
|
// - ["*"]: allow all CLI tools
|
|
29
29
|
// - []: deny all CLI tools
|
|
30
30
|
// - ["glob", "grep"]: allow only specific CLI tools
|
|
31
|
+
//
|
|
32
|
+
// This is empty by default because Xcode should be the one handling operations
|
|
33
|
+
// like searching, reading, and editing files. The model tells Xcode what to
|
|
34
|
+
// change and Xcode applies those changes through its own UI, keeping everything
|
|
35
|
+
// in sync. If CLI tools are enabled, the Copilot session may perform those
|
|
36
|
+
// operations itself (e.g. writing files via bash), bypassing Xcode and leaving
|
|
37
|
+
// its UI out of sync with what actually happened on disk.
|
|
31
38
|
allowedCliTools: [],
|
|
32
39
|
|
|
33
40
|
// Maximum request body size in MiB.
|
|
@@ -35,6 +42,10 @@
|
|
|
35
42
|
|
|
36
43
|
// Filename patterns to filter out from search results in the prompt.
|
|
37
44
|
// Code blocks whose filename contains any of these (case-insensitive) are stripped.
|
|
45
|
+
//
|
|
46
|
+
// Xcode's search results can include full file contents for every match, which can
|
|
47
|
+
// bloat the prompt with irrelevant code. Add patterns here to strip those files
|
|
48
|
+
// before they reach the model (e.g. ["mock", "generated"]).
|
|
38
49
|
excludedFilePatterns: [],
|
|
39
50
|
|
|
40
51
|
// Reasoning effort for models that support it.
|
package/dist/utils/prompt.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { Message } from "../types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Strips fenced code blocks whose
|
|
3
|
+
* Strips fenced code blocks whose header contains any of the given patterns
|
|
4
|
+
* (case-insensitive). Xcode formats search results as fenced blocks with a
|
|
5
|
+
* header like ` ```swift:/path/to/File.swift `, so the patterns are matched
|
|
6
|
+
* against the file path in that header.
|
|
4
7
|
*
|
|
5
|
-
* Xcode search
|
|
6
|
-
* can be thousands of lines and add nothing useful to the prompt.
|
|
8
|
+
* Xcode's search results can include full file contents for every match, so
|
|
9
|
+
* some files can be thousands of lines and add nothing useful to the prompt.
|
|
10
|
+
* For example, a mock data file might match the search query but its contents
|
|
11
|
+
* aren't helpful for generating a useful response.
|
|
7
12
|
*/
|
|
8
13
|
export declare function filterExcludedFiles(s: string, patterns: string[]): string;
|
|
9
14
|
/** System/developer messages are skipped — they're passed via `SessionConfig.systemMessage`. */
|
package/dist/utils/prompt.js
CHANGED
|
@@ -3,10 +3,15 @@ function escapeRegex(s) {
|
|
|
3
3
|
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* Strips fenced code blocks whose
|
|
6
|
+
* Strips fenced code blocks whose header contains any of the given patterns
|
|
7
|
+
* (case-insensitive). Xcode formats search results as fenced blocks with a
|
|
8
|
+
* header like ` ```swift:/path/to/File.swift `, so the patterns are matched
|
|
9
|
+
* against the file path in that header.
|
|
7
10
|
*
|
|
8
|
-
* Xcode search
|
|
9
|
-
* can be thousands of lines and add nothing useful to the prompt.
|
|
11
|
+
* Xcode's search results can include full file contents for every match, so
|
|
12
|
+
* some files can be thousands of lines and add nothing useful to the prompt.
|
|
13
|
+
* For example, a mock data file might match the search query but its contents
|
|
14
|
+
* aren't helpful for generating a useful response.
|
|
10
15
|
*/
|
|
11
16
|
export function filterExcludedFiles(s, patterns) {
|
|
12
17
|
if (patterns.length === 0)
|
package/dist/utils/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/utils/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/utils/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAS,EAAE,QAAkB;IAC/D,IAAI,QAAQ,CAAC,MAAM,KA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