@oh-my-pi/pi-coding-agent 3.4.1337 → 3.6.1337
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/CHANGELOG.md +22 -0
- package/package.json +5 -4
- package/src/core/sdk.ts +14 -1
- package/src/core/session-manager.ts +98 -69
- package/src/core/settings-manager.ts +33 -0
- package/src/core/system-prompt.ts +15 -0
- package/src/core/title-generator.ts +28 -6
- package/src/core/tools/index.ts +6 -0
- package/src/core/tools/rulebook.ts +124 -0
- package/src/modes/interactive/components/extensions/extension-dashboard.ts +297 -0
- package/src/modes/interactive/components/extensions/extension-list.ts +477 -0
- package/src/modes/interactive/components/extensions/index.ts +9 -0
- package/src/modes/interactive/components/extensions/inspector-panel.ts +313 -0
- package/src/modes/interactive/components/extensions/state-manager.ts +558 -0
- package/src/modes/interactive/components/extensions/types.ts +191 -0
- package/src/modes/interactive/components/settings-defs.ts +2 -31
- package/src/modes/interactive/components/settings-selector.ts +0 -1
- package/src/modes/interactive/interactive-mode.ts +24 -296
- package/src/modes/print-mode.ts +34 -0
- package/src/modes/rpc/rpc-mode.ts +8 -7
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* - Hook UI: Hook UI requests are emitted, client responds with hook_ui_response
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
import { nanoid } from "nanoid";
|
|
14
15
|
import type { AgentSession } from "../../core/agent-session";
|
|
15
16
|
import type { HookUIContext } from "../../core/hooks/index";
|
|
16
17
|
import { logger } from "../../core/logger";
|
|
@@ -52,7 +53,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|
|
52
53
|
*/
|
|
53
54
|
const createHookUIContext = (): HookUIContext => ({
|
|
54
55
|
async select(title: string, options: string[]): Promise<string | undefined> {
|
|
55
|
-
const id =
|
|
56
|
+
const id = nanoid();
|
|
56
57
|
return new Promise((resolve, reject) => {
|
|
57
58
|
pendingHookRequests.set(id, {
|
|
58
59
|
resolve: (response: RpcHookUIResponse) => {
|
|
@@ -71,7 +72,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|
|
71
72
|
},
|
|
72
73
|
|
|
73
74
|
async confirm(title: string, message: string): Promise<boolean> {
|
|
74
|
-
const id =
|
|
75
|
+
const id = nanoid();
|
|
75
76
|
return new Promise((resolve, reject) => {
|
|
76
77
|
pendingHookRequests.set(id, {
|
|
77
78
|
resolve: (response: RpcHookUIResponse) => {
|
|
@@ -90,7 +91,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|
|
90
91
|
},
|
|
91
92
|
|
|
92
93
|
async input(title: string, placeholder?: string): Promise<string | undefined> {
|
|
93
|
-
const id =
|
|
94
|
+
const id = nanoid();
|
|
94
95
|
return new Promise((resolve, reject) => {
|
|
95
96
|
pendingHookRequests.set(id, {
|
|
96
97
|
resolve: (response: RpcHookUIResponse) => {
|
|
@@ -112,7 +113,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|
|
112
113
|
// Fire and forget - no response needed
|
|
113
114
|
output({
|
|
114
115
|
type: "hook_ui_request",
|
|
115
|
-
id:
|
|
116
|
+
id: nanoid(),
|
|
116
117
|
method: "notify",
|
|
117
118
|
message,
|
|
118
119
|
notifyType: type,
|
|
@@ -123,7 +124,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|
|
123
124
|
// Fire and forget - no response needed
|
|
124
125
|
output({
|
|
125
126
|
type: "hook_ui_request",
|
|
126
|
-
id:
|
|
127
|
+
id: nanoid(),
|
|
127
128
|
method: "setStatus",
|
|
128
129
|
statusKey: key,
|
|
129
130
|
statusText: text,
|
|
@@ -139,7 +140,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|
|
139
140
|
// Fire and forget - host can implement editor control
|
|
140
141
|
output({
|
|
141
142
|
type: "hook_ui_request",
|
|
142
|
-
id:
|
|
143
|
+
id: nanoid(),
|
|
143
144
|
method: "set_editor_text",
|
|
144
145
|
text,
|
|
145
146
|
} as RpcHookUIRequest);
|
|
@@ -152,7 +153,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|
|
152
153
|
},
|
|
153
154
|
|
|
154
155
|
async editor(title: string, prefill?: string): Promise<string | undefined> {
|
|
155
|
-
const id =
|
|
156
|
+
const id = nanoid();
|
|
156
157
|
return new Promise((resolve, reject) => {
|
|
157
158
|
pendingHookRequests.set(id, {
|
|
158
159
|
resolve: (response: RpcHookUIResponse) => {
|