@henryqw/pi-open-in 2.0.2 → 2.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 +11 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,17 +21,14 @@ Run `/set-open-in` when you want another command.
|
|
|
21
21
|
|
|
22
22
|
## Config
|
|
23
23
|
|
|
24
|
-
`~/.pi/agent/config/pi-open-in/config.json`
|
|
24
|
+
Package-owned: `~/.pi/agent/config/pi-open-in/config.json`
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
```
|
|
26
|
+
| Name | Description | Values | Default |
|
|
27
|
+
| --- | --- | --- | --- |
|
|
28
|
+
| `command` | Sets the command used by `/open`. Required when the file exists. | Non-empty string. | `"code"` |
|
|
31
29
|
|
|
32
30
|
- A missing file silently uses the default command, `"code"`.
|
|
33
31
|
- Reads do not create or write the config home.
|
|
34
|
-
- When the file exists, `command` is required. It must be a non-empty string.
|
|
35
32
|
- Only `/set-open-in` writes the file. Its write is atomic.
|
|
36
33
|
|
|
37
34
|
## API
|
|
@@ -44,9 +41,14 @@ import { loadOpenInConfig } from "@henryqw/pi-open-in/open-uri";
|
|
|
44
41
|
const { source, value } = loadOpenInConfig();
|
|
45
42
|
```
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
| Surface | Type | Purpose |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| `loadOpenInConfig(agentDir?)` | function | Reads and validates the owner config. |
|
|
47
|
+
| `configuredOpenUri(path)` | function | Returns a safe VS Code URI for a supported command. |
|
|
48
|
+
|
|
49
|
+
`loadOpenInConfig` returns `source` as `"missing"` or `"file"`. Its `value.command` is validated. Pass an agent directory when needed.
|
|
48
50
|
|
|
49
|
-
`configuredOpenUri(path)`
|
|
51
|
+
`configuredOpenUri(path)` works when the executable is `code`. For `code -n` and `code --new-window`, it adds `windowId=_blank` so the link opens a new window. It returns `undefined` for other commands or invalid config.
|
|
50
52
|
|
|
51
53
|
This extension owns command validation. `@henryqw/pi-config-store` owns the config home and storage.
|
|
52
54
|
|