@pi-unipi/utility 0.1.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/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @pi-unipi/utility
2
+
3
+ Utility commands and tools for the Pi coding agent — part of the Unipi suite.
4
+
5
+ ## Features
6
+
7
+ ### `/unipi:continue` Command
8
+
9
+ Continue the agent from where it left off **without adding a user message** to the conversation transcript.
10
+
11
+ ```
12
+ /unipi:continue
13
+ ```
14
+
15
+ This sends a "steer" message that tells the agent to proceed to the next step. Unlike typing "continue" yourself, this doesn't pollute the context with an extra user message.
16
+
17
+ ### `continue_task` Tool
18
+
19
+ The agent can call this tool programmatically when it finishes a step and needs to proceed to the next without waiting for user input.
20
+
21
+ ```
22
+ continue_task()
23
+ ```
24
+
25
+ **When to use:** The agent has completed one step and should automatically proceed to the next.
26
+
27
+ ## Installation
28
+
29
+ ```bash
30
+ pi install npm:@pi-unipi/utility
31
+ ```
32
+
33
+ Or install the full Unipi suite:
34
+
35
+ ```bash
36
+ pi install npm:@pi-unipi/unipi
37
+ ```
38
+
39
+ ## How It Works
40
+
41
+ Both the command and tool use Pi's `sendUserMessage` API with `deliverAs: "steer"` to inject a continuation prompt without creating a user message in the transcript. This keeps the conversation clean while allowing the agent to continue working.
42
+
43
+ The default continue prompt is:
44
+
45
+ > Continue from where you left off. Proceed with the next step.
46
+
47
+ ## Dependencies
48
+
49
+ - `@pi-unipi/core` — Shared constants and utilities
50
+ - `@mariozechner/pi-coding-agent` — Pi extension API
51
+ - `@sinclair/typebox` — Schema validation
package/commands.ts ADDED
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @pi-unipi/utility — Command registration
3
+ *
4
+ * Registers /unipi:continue command for clean agent continuation.
5
+ */
6
+
7
+ import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
8
+ import { UNIPI_PREFIX, UTILITY_COMMANDS } from "@pi-unipi/core";
9
+
10
+ /**
11
+ * Register utility commands.
12
+ */
13
+ export function registerUtilityCommands(pi: ExtensionAPI): void {
14
+ pi.registerCommand(`${UNIPI_PREFIX}${UTILITY_COMMANDS.CONTINUE}`, {
15
+ description: "Continue the agent from where it left off without adding user context",
16
+ handler: async (_args: string, ctx: ExtensionContext) => {
17
+ if (!ctx.isIdle()) {
18
+ if (ctx.hasUI) {
19
+ ctx.ui.notify(
20
+ "Agent is busy. Press ESC to interrupt, then try again.",
21
+ "warning",
22
+ );
23
+ }
24
+ return;
25
+ }
26
+
27
+ // Send custom message to trigger a turn without polluting transcript
28
+ pi.sendMessage(
29
+ {
30
+ customType: "unipi-continue",
31
+ content: "",
32
+ display: false,
33
+ },
34
+ { triggerTurn: true },
35
+ );
36
+ },
37
+ });
38
+ }
package/index.ts ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @pi-unipi/utility — Extension entry
3
+ *
4
+ * Provides /unipi:continue command for clean agent continuation
5
+ * without context pollution.
6
+ */
7
+
8
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
9
+ import {
10
+ UNIPI_EVENTS,
11
+ MODULES,
12
+ UTILITY_COMMANDS,
13
+ emitEvent,
14
+ getPackageVersion,
15
+ } from "@pi-unipi/core";
16
+ import { registerUtilityCommands } from "./commands.js";
17
+
18
+ /** Package version */
19
+ const VERSION = getPackageVersion(new URL(".", import.meta.url).pathname);
20
+
21
+ export default function (pi: ExtensionAPI) {
22
+ // Register commands
23
+ registerUtilityCommands(pi);
24
+
25
+ // Session lifecycle — announce module
26
+ pi.on("session_start", async () => {
27
+ emitEvent(pi, UNIPI_EVENTS.MODULE_READY, {
28
+ name: MODULES.UTILITY,
29
+ version: VERSION,
30
+ commands: [`unipi:${UTILITY_COMMANDS.CONTINUE}`],
31
+ tools: [],
32
+ });
33
+ });
34
+ }
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@pi-unipi/utility",
3
+ "version": "0.1.1",
4
+ "description": "Utility commands and tools for Pi coding agent — continue, status helpers",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Neuron Mr White",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Neuron-Mr-White/unipi.git",
11
+ "directory": "packages/utility"
12
+ },
13
+ "keywords": [
14
+ "pi-package",
15
+ "pi-extension",
16
+ "pi-coding-agent",
17
+ "unipi",
18
+ "utility",
19
+ "continue"
20
+ ],
21
+ "files": [
22
+ "index.ts",
23
+ "commands.ts",
24
+ "README.md"
25
+ ],
26
+ "pi": {
27
+ "extensions": [
28
+ "index.ts"
29
+ ]
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "dependencies": {
35
+ "@pi-unipi/core": "*"
36
+ },
37
+ "peerDependencies": {
38
+ "@mariozechner/pi-coding-agent": "*",
39
+ "@sinclair/typebox": "*"
40
+ }
41
+ }