shariq-pi-extensions 0.5.0 → 0.5.1
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/docs/EXTENSIONS.md
CHANGED
|
@@ -58,4 +58,4 @@ Adds `/exit` as an alias for `/quit`.
|
|
|
58
58
|
|
|
59
59
|
## Tool exposure
|
|
60
60
|
|
|
61
|
-
Pi 1.0 lets each tool choose how the model reaches it. Tools that ask the user, manage lifecycles, or change session state (questions, goals, task list, terminals, subagents) use `model-only` exposure: they stay declared to the model even with `codemode.mode: "only"`, and codemode scripts cannot call them. The read-only web tools keep the default `direct` exposure so scripts can call them in parallel. Read-only tools also declare `readOnlyHint` annotations for permission extensions.
|
|
61
|
+
Pi 1.0 lets each tool choose how the model reaches it. Tools that ask the user, manage lifecycles, or change session state (questions, goals, task list, starting, writing to, or stopping terminals, subagents) use `model-only` exposure: they stay declared to the model even with `codemode.mode: "only"`, and codemode scripts cannot call them. The read-only web tools and `read_terminal` and `list_terminals` keep the default `direct` exposure so scripts can call them in parallel and filter their output. Read-only tools also declare `readOnlyHint` annotations for permission extensions.
|
|
@@ -10,7 +10,7 @@ Session-scoped background pseudo-terminals for Pi. The extension combines Codex-
|
|
|
10
10
|
- `list_terminals` — list running and settled terminals.
|
|
11
11
|
- `stop_terminal` — stop complete process groups with TERM-to-KILL escalation.
|
|
12
12
|
|
|
13
|
-
Each output response carries a byte cursor; pass it to the next read or write to get only new output. The tools render as compact cards with expandable output,
|
|
13
|
+
`read_terminal` and `list_terminals` are read-only and callable from codemode scripts, so a script can filter a long log down to what matters; the tools that start, write to, or stop processes use `model-only` exposure. Each output response carries a byte cursor; pass it to the next read or write to get only new output. The tools render as compact cards with expandable output, and running terminals appear in the shared **Active work** dock with elapsed time and the latest output line.
|
|
14
14
|
|
|
15
15
|
When a model-started terminal exits, its status and a bounded output tail are delivered as a custom message. An idle parent starts a new turn for it; a busy parent receives it, together with any other pending results, when its run settles. The message never appears as user-authored or follow-up input, and reading the terminal does not suppress it.
|
|
16
16
|
|
|
@@ -230,7 +230,7 @@ export default function backgroundTerminals(pi: ExtensionAPI) {
|
|
|
230
230
|
description:
|
|
231
231
|
"Read a background terminal's output since a cursor; omit the cursor for the retained tail. " +
|
|
232
232
|
"Use it when the user asks for progress or the process is waiting for input. Completion output arrives on its own.",
|
|
233
|
-
|
|
233
|
+
// Read-only, so codemode scripts may call it to filter large logs.
|
|
234
234
|
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
235
235
|
parameters: Type.Object({
|
|
236
236
|
id: Type.String({ description: 'Terminal id, such as "term-1".' }),
|
|
@@ -317,7 +317,6 @@ export default function backgroundTerminals(pi: ExtensionAPI) {
|
|
|
317
317
|
name: "list_terminals",
|
|
318
318
|
label: "List Background Terminals",
|
|
319
319
|
description: "List background terminals with id, status, pid, elapsed time, and working directory.",
|
|
320
|
-
exposure: "model-only",
|
|
321
320
|
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
322
321
|
parameters: Type.Object({}),
|
|
323
322
|
async execute() {
|
|
@@ -44,7 +44,9 @@ Capability modes:
|
|
|
44
44
|
- `execute`: the read-only set plus `bash` and background terminals, without direct edits;
|
|
45
45
|
- `all`: every tool the child loads.
|
|
46
46
|
|
|
47
|
-
Restrictive modes fail closed: an extension tool is unavailable until it is classified in `src/backends/pi.ts
|
|
47
|
+
Restrictive modes fail closed: an extension tool is unavailable until it is classified in `src/backends/pi.ts`, and a child-only `tool_call` check refuses unclassified tools at call time, including tools registered later. The session-only `task_list` tool is allowed in every mode.
|
|
48
|
+
|
|
49
|
+
Children load the same packages and extensions as the parent but not Pi's built-in extensions (`codemode`, MCP, and tool search), because Pi does not export them to extensions.
|
|
48
50
|
|
|
49
51
|
Each tool call inside a child times out after three minutes.
|
|
50
52
|
|