pi-codex-marketplace 1.0.5 → 1.1.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 +3 -2
- package/extensions/pi/autocomplete.ts +14 -7
- package/extensions/pi/index.ts +5 -4
- package/package.json +2 -2
- package/src/bridge/command.ts +382 -153
- package/src/bridge/completion.ts +163 -48
- package/src/bridge/installation-identity.ts +27 -0
- package/src/bridge/skill-discovery.ts +164 -0
- package/src/bridge/state.ts +17 -0
- package/src/projection/exposure.ts +9 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Requirements: **Pi `0.87.0`(相容下限 `0.84.2`)** · **Node >=22.19.0**
|
|
|
23
23
|
|
|
24
24
|
## 子命令速查
|
|
25
25
|
|
|
26
|
-
TUI `/codex-marketplace` 與 Headless CLI `pi-codex-marketplace`
|
|
26
|
+
TUI `/codex-marketplace` 與 Headless CLI `pi-codex-marketplace` 共用同一組十個子命令(無參數=總覽):
|
|
27
27
|
|
|
28
28
|
| 子命令 | 行為 |
|
|
29
29
|
|--------|------|
|
|
@@ -34,6 +34,7 @@ TUI `/codex-marketplace` 與 Headless CLI `pi-codex-marketplace` 共用同一組
|
|
|
34
34
|
| `disable <名稱>` / `enable <名稱>` | 停用/啟用 plugin |
|
|
35
35
|
| `remove <名稱>` | 移除單支 plugin |
|
|
36
36
|
| `forget <名稱>` | 移除整個 marketplace(含其全部安裝) |
|
|
37
|
+
| `skills <名稱> [exclude \| include \| only \| reset]` | 查看 skills 與排除狀態;逐項排除/恢復、一次性只保留、重設 |
|
|
37
38
|
| `help` | 子命令清單 |
|
|
38
39
|
|
|
39
40
|
## Documentation
|
|
@@ -43,7 +44,7 @@ TUI `/codex-marketplace` 與 Headless CLI `pi-codex-marketplace` 共用同一組
|
|
|
43
44
|
| 文件 | 內容 |
|
|
44
45
|
|------|------|
|
|
45
46
|
| [docs/installation.md](./docs/installation.md) | 安裝/更新/移除:Pi Extension 各模式、Headless CLI、`-l` 語意、requirements |
|
|
46
|
-
| [docs/usage.md](./docs/usage.md) | `/codex-marketplace`
|
|
47
|
+
| [docs/usage.md](./docs/usage.md) | `/codex-marketplace` 使用手冊:十子命令細節、Skill 排除清單、語意鐵則、Pi 原生 autocomplete |
|
|
47
48
|
| [docs/cli.md](./docs/cli.md) | Headless Bridge CLI:執行方式、輸出與退出代碼契約、狀態生效時機 |
|
|
48
49
|
| [docs/private-repos.md](./docs/private-repos.md) | 私有 Git repo:Credentialed Acquisition(核准式取得)、SSH 定位器 |
|
|
49
50
|
| [docs/architecture.md](./docs/architecture.md) | 架構:Bridge State storage、支援矩陣、領域詞彙、ADR |
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* Pi's built-in combined provider completes the slash-command name and inserts a
|
|
5
5
|
* trailing space without exposing empty-prefix argument completion (root subcommands) when
|
|
6
6
|
* the editor holds exactly `/codex-marketplace`. This wrapper intercepts that exact editor
|
|
7
|
-
* content and presents the
|
|
7
|
+
* content and presents the ten root candidates. It also owns the second-level argument
|
|
8
8
|
* contexts (`install` #122, the Installation lifecycle `enable` / `disable` / `remove` #123,
|
|
9
|
-
*
|
|
9
|
+
* the Marketplace Registration `list` / `forget` #124, and the Skill Exclusion surface
|
|
10
|
+
* `skills` #158) on forced (Tab) requests, which
|
|
10
11
|
* Pi routes to file completion instead of slash-command argument completion (its
|
|
11
12
|
* argument path only runs when `force` is false) — the wrapper returns the state-aware
|
|
12
13
|
* candidates there. `add` stays free-form (#124): its forced Tab keeps Pi's native
|
|
@@ -17,6 +18,11 @@
|
|
|
17
18
|
* The wrapper is installed from a `session_start` handler via `ctx.ui.addAutocompleteProvider`,
|
|
18
19
|
* which interactive (TUI) mode wires into the editor and RPC/JSON/print modes no-op, so a
|
|
19
20
|
* terminal-only provider is never registered outside a TUI session.
|
|
21
|
+
*
|
|
22
|
+
* The `skills` context (#158) nests deeper than the other contexts: the same forced-Tab
|
|
23
|
+
* interception covers `skills <名稱> ` (operations) and `skills <名稱> exclude|include|only `
|
|
24
|
+
* (skill names) because they share the `/codex-marketplace skills ` prefix — see
|
|
25
|
+
* `completeArguments` for the grammar it owns at each depth.
|
|
20
26
|
*/
|
|
21
27
|
|
|
22
28
|
import type { AutocompleteProvider } from '@earendil-works/pi-tui';
|
|
@@ -27,12 +33,13 @@ import { completeArguments, type CompletionReadOptions } from '../../src/bridge/
|
|
|
27
33
|
export const EXACT_COMMAND = '/codex-marketplace';
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
|
-
* The Bridge-owned second-level argument contexts on forced requests: `install
|
|
31
|
-
* installation lifecycle actions
|
|
32
|
-
* by the trailing space root candidates insert.
|
|
33
|
-
* argument is an arbitrary path or Git locator that
|
|
36
|
+
* The Bridge-owned second-level argument contexts on forced requests: `install`, the
|
|
37
|
+
* installation lifecycle actions, the Marketplace Registration commands, and the Skill
|
|
38
|
+
* Exclusion surface (`skills`) — each followed by the trailing space root candidates insert.
|
|
39
|
+
* `add` is deliberately absent (#124): its argument is an arbitrary path or Git locator that
|
|
40
|
+
* stays under Pi's native completion.
|
|
34
41
|
*/
|
|
35
|
-
export const SECOND_LEVEL_ARGUMENT_RE = /^\/codex-marketplace (?:install|list|forget|enable|disable|remove) /;
|
|
42
|
+
export const SECOND_LEVEL_ARGUMENT_RE = /^\/codex-marketplace (?:install|list|forget|enable|disable|remove|skills) /;
|
|
36
43
|
|
|
37
44
|
/**
|
|
38
45
|
* Wrap the host's current autocomplete provider. Suggestion generation intercepts only the
|
package/extensions/pi/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { completeArguments } from '../../src/bridge/completion.js';
|
|
|
18
18
|
import { createBridgeAutocompleteProvider } from './autocomplete.js';
|
|
19
19
|
|
|
20
20
|
export default function (pi: ExtensionAPI) {
|
|
21
|
-
// Root-level autocomplete (#121) + second-level autocomplete (#122–#124): stack a narrow
|
|
21
|
+
// Root-level autocomplete (#121) + second-level autocomplete (#122–#124, #158): stack a narrow
|
|
22
22
|
// provider for the exact `/codex-marketplace` editor text and the forced `install `,
|
|
23
23
|
// Installation lifecycle (`enable ` / `disable ` / `remove `), and Marketplace Registration
|
|
24
24
|
// (`list ` / `forget `) argument contexts (Pi otherwise completes just the command name
|
|
@@ -46,9 +46,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
pi.registerCommand('codex-marketplace', {
|
|
49
|
-
description: 'codex / claude marketplace 管理(add/list/install/update/disable/enable/remove/forget/help)',
|
|
50
|
-
// Standard argument completion (#121–#124): typed subcommand and `install <query>` /
|
|
51
|
-
// lifecycle `<query>` / Registration (`list` / `forget`) `<query>`
|
|
49
|
+
description: 'codex / claude marketplace 管理(add/list/install/update/disable/enable/remove/forget/skills/help)',
|
|
50
|
+
// Standard argument completion (#121–#124, #158): typed subcommand and `install <query>` /
|
|
51
|
+
// lifecycle `<query>` / Registration (`list` / `forget`) `<query>` / Skill Exclusion
|
|
52
|
+
// (`skills <名稱> [操作]`) prefixes go through
|
|
52
53
|
// Pi's normal autocomplete; unowned syntax (including `add`'s free-form argument) returns
|
|
53
54
|
// null so Pi falls through to its own behavior.
|
|
54
55
|
getArgumentCompletions: (argumentPrefix: string) => completeArguments(argumentPrefix),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-codex-marketplace",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Bridge Package for Codex and Claude Marketplace compatibility in Pi — 極簡 /codex-marketplace 純文字指令與 Headless CLI(add/list/install/update/disable/enable/remove/forget)、單一 Global Bridge State、當下最新安裝與即時投影",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Bridge Package for Codex and Claude Marketplace compatibility in Pi — 極簡 /codex-marketplace 純文字指令與 Headless CLI(add/list/install/update/disable/enable/remove/forget/skills)、單一 Global Bridge State、當下最新安裝與即時投影",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"pi-package",
|