@henryqw/pi-open-in 2.0.2 → 3.0.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.
Files changed (2) hide show
  1. package/README.md +11 -9
  2. package/package.json +6 -3
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
- ```json
27
- {
28
- "command": "code"
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
- `source` is `"missing"` or `"file"`. `value.command` is validated. Pass an agent directory to `loadOpenInConfig(agentDir)` when needed.
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)` returns a VS Code URI 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.
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-open-in",
3
- "version": "2.0.2",
3
+ "version": "3.0.0",
4
4
  "description": "Open the current Pi working directory with a configurable command.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -28,7 +28,7 @@
28
28
  "pack:check": "npm pack --dry-run"
29
29
  },
30
30
  "peerDependencies": {
31
- "@earendil-works/pi-coding-agent": "^0.85.1"
31
+ "@earendil-works/pi-coding-agent": "^0.86.0"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
@@ -47,6 +47,9 @@
47
47
  ]
48
48
  },
49
49
  "dependencies": {
50
- "@henryqw/pi-config-store": "^1.0.0"
50
+ "@henryqw/pi-config-store": "^2.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "@earendil-works/pi-coding-agent": "0.86.0"
51
54
  }
52
55
  }