pi-plus-sdk 0.2.7 → 0.2.8

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 (3) hide show
  1. package/api.d.ts +35 -0
  2. package/api.js +29 -28
  3. package/package.json +1 -1
package/api.d.ts CHANGED
@@ -45,6 +45,30 @@ declare module "@earendil-works/pi-coding-agent" {
45
45
  }
46
46
  }
47
47
 
48
+ // pi-plus session overlay: the transcript header carries an optional
49
+ // `interactive` host-mode marker (false = headless run, hidden from user-facing
50
+ // history), NewSessionOptions accepts it, and every SessionInfo reports it.
51
+ // See packages/plus/src/coding-agent/core/session-manager.ts.
52
+ declare module "@earendil-works/pi-coding-agent" {
53
+ interface SessionHeader {
54
+ /** False when written by a headless host; undefined on pre-marker files. */
55
+ interactive?: boolean;
56
+ }
57
+ interface NewSessionOptions {
58
+ /** Per-session override of the process default (see setDefaultSessionInteractive). */
59
+ interactive?: boolean;
60
+ }
61
+ interface SessionInfo {
62
+ /** Copied from the transcript header; undefined when the file is unmarked. */
63
+ interactive?: boolean;
64
+ }
65
+ }
66
+
67
+ /** Declare whether this process counts as a human-driven host. Process-global
68
+ * (pi-plus overlay) because session-replacing paths carry no per-call option. */
69
+ export declare function setDefaultSessionInteractive(interactive: boolean): void;
70
+ export declare function getDefaultSessionInteractive(): boolean;
71
+
48
72
  export declare const plusSdkExtensionFactories: InlineExtension[];
49
73
 
50
74
  // --- pi-plus-permissions (bypass | acceptEdits | plan tool-call gate) ------
@@ -214,6 +238,12 @@ export declare function clearExtensionCache(): void;
214
238
  export interface CreatePlusAgentSessionOptions extends CreateAgentSessionOptions {
215
239
  extensionFactories?: InlineExtension[];
216
240
  ui?: PlusUIDialogHandlers;
241
+ /**
242
+ * Whether sessions this host writes count as user history (transcript header
243
+ * `interactive` flag, which history surfaces hide when false). Defaults to
244
+ * `ui !== undefined`. Process-global — set before creating sessions.
245
+ */
246
+ interactive?: boolean;
217
247
  commandContextActions?: ExtensionCommandContextActions;
218
248
  abortHandler?: () => void;
219
249
  shutdownHandler?: () => void;
@@ -227,6 +257,11 @@ export declare function createPlusAgentSession(
227
257
  export interface CreatePlusAgentSessionRuntimeOptions extends CreateAgentSessionOptions {
228
258
  extensionFactories?: InlineExtension[];
229
259
  ui?: PlusUIDialogHandlers;
260
+ /**
261
+ * Whether sessions this host writes count as user history (transcript header
262
+ * `interactive` flag). Defaults to `ui !== undefined`. Process-global.
263
+ */
264
+ interactive?: boolean;
230
265
  /** Overrides the runtime-routed actions (switchSession/fork/newSession/...)
231
266
  * the factory wires by default, same shape as bindExtensions' binding. */
232
267
  commandContextActions?: ExtensionCommandContextActions;