@oh-my-pi/pi-coding-agent 17.1.8 → 17.2.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/CHANGELOG.md +110 -0
- package/dist/{CHANGELOG-vt8ene9g.md → CHANGELOG-dj46zzrm.md} +110 -0
- package/dist/cli.js +10009 -9654
- package/dist/{template-dys3vk5b.js → template-8vdv6xb4.js} +1 -1
- package/dist/types/advisor/runtime.d.ts +8 -2
- package/dist/types/advisor/transcript-recorder.d.ts +15 -0
- package/dist/types/auto-thinking/classifier.d.ts +9 -2
- package/dist/types/cli/args.d.ts +2 -0
- package/dist/types/cli/session-picker.d.ts +14 -7
- package/dist/types/collab/guest.d.ts +21 -2
- package/dist/types/commands/launch.d.ts +6 -0
- package/dist/types/config/model-discovery.d.ts +12 -0
- package/dist/types/config/settings-schema.d.ts +73 -8
- package/dist/types/cursor-bridge-tools.d.ts +54 -0
- package/dist/types/cursor.d.ts +193 -8
- package/dist/types/edit/edit-clipboard.d.ts +19 -0
- package/dist/types/edit/hashline/diff.d.ts +9 -1
- package/dist/types/edit/index.d.ts +8 -1
- package/dist/types/edit/streaming.d.ts +8 -1
- package/dist/types/extensibility/extensions/runner.d.ts +19 -2
- package/dist/types/extensibility/extensions/types.d.ts +25 -1
- package/dist/types/extensibility/legacy-pi-coding-agent-shim.d.ts +25 -0
- package/dist/types/internal-urls/index.d.ts +1 -0
- package/dist/types/internal-urls/local-protocol.d.ts +3 -2
- package/dist/types/internal-urls/security-protocol.d.ts +15 -0
- package/dist/types/internal-urls/types.d.ts +1 -1
- package/dist/types/launch/terminal-output-worker-client.d.ts +5 -0
- package/dist/types/launch/terminal-output-worker-protocol.d.ts +14 -0
- package/dist/types/launch/terminal-output-worker.d.ts +1 -0
- package/dist/types/lsp/client.d.ts +2 -0
- package/dist/types/main.d.ts +2 -0
- package/dist/types/mcp/manager.d.ts +33 -4
- package/dist/types/modes/components/codex-reset-fireworks.d.ts +51 -0
- package/dist/types/modes/components/read-tool-group.d.ts +12 -0
- package/dist/types/modes/components/session-selector.d.ts +6 -0
- package/dist/types/modes/components/status-line/component.d.ts +23 -0
- package/dist/types/modes/components/tool-execution.d.ts +16 -7
- package/dist/types/modes/components/usage-row.d.ts +2 -0
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +26 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +2 -1
- package/dist/types/modes/interactive-mode.d.ts +4 -2
- package/dist/types/modes/rpc/rpc-client.d.ts +7 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +16 -0
- package/dist/types/modes/theme/theme.d.ts +12 -1
- package/dist/types/modes/types.d.ts +2 -1
- package/dist/types/sdk.d.ts +18 -0
- package/dist/types/security/auth.d.ts +30 -0
- package/dist/types/security/cloud.d.ts +79 -0
- package/dist/types/security/comparison.d.ts +49 -0
- package/dist/types/security/contracts/ids.d.ts +15 -0
- package/dist/types/security/contracts/index.d.ts +4 -0
- package/dist/types/security/contracts/schemas.d.ts +660 -0
- package/dist/types/security/contracts/types.d.ts +234 -0
- package/dist/types/security/contracts/validation.d.ts +5 -0
- package/dist/types/security/coordinator.d.ts +100 -0
- package/dist/types/security/importers/codex-security.d.ts +7 -0
- package/dist/types/security/importers/index.d.ts +2 -0
- package/dist/types/security/importers/sarif.d.ts +9 -0
- package/dist/types/security/index.d.ts +13 -0
- package/dist/types/security/preflight.d.ts +61 -0
- package/dist/types/security/provenance.d.ts +24 -0
- package/dist/types/security/publication.d.ts +78 -0
- package/dist/types/security/remediation.d.ts +27 -0
- package/dist/types/security/resource-output.d.ts +8 -0
- package/dist/types/security/sarif.d.ts +2 -0
- package/dist/types/security/store.d.ts +40 -0
- package/dist/types/session/agent-session-events.d.ts +2 -0
- package/dist/types/session/agent-session-types.d.ts +36 -1
- package/dist/types/session/agent-session.d.ts +4 -2
- package/dist/types/session/claude-session-store.d.ts +13 -0
- package/dist/types/session/codex-session-store.d.ts +14 -0
- package/dist/types/session/credential-pin.d.ts +58 -0
- package/dist/types/session/foreign-session-import.d.ts +15 -0
- package/dist/types/session/foreign-session-jsonl.d.ts +9 -0
- package/dist/types/session/foreign-session-store.d.ts +23 -0
- package/dist/types/session/session-advisors.d.ts +47 -2
- package/dist/types/session/session-entries.d.ts +19 -1
- package/dist/types/session/session-handoff.d.ts +4 -1
- package/dist/types/session/session-loader.d.ts +2 -0
- package/dist/types/session/session-maintenance.d.ts +1 -1
- package/dist/types/session/session-manager.d.ts +21 -0
- package/dist/types/session/session-tools.d.ts +25 -1
- package/dist/types/session/turn-recovery.d.ts +10 -4
- package/dist/types/slash-commands/helpers/security.d.ts +2 -0
- package/dist/types/system-prompt.d.ts +4 -1
- package/dist/types/task/executor.d.ts +14 -2
- package/dist/types/task/render.d.ts +7 -0
- package/dist/types/thinking.d.ts +18 -6
- package/dist/types/tools/acp-bridge.d.ts +28 -5
- package/dist/types/tools/builtin-names.d.ts +1 -1
- package/dist/types/tools/grep.d.ts +17 -1
- package/dist/types/tools/hub/launch.d.ts +5 -1
- package/dist/types/tools/index.d.ts +10 -2
- package/dist/types/tools/path-utils.d.ts +19 -0
- package/dist/types/tools/read.d.ts +2 -0
- package/dist/types/tools/security-scan.d.ts +96 -0
- package/dist/types/tools/xdev.d.ts +2 -1
- package/dist/types/utils/changelog.d.ts +19 -0
- package/dist/types/utils/git.d.ts +10 -0
- package/dist/types/utils/jj.d.ts +11 -4
- package/dist/types/web/search/types.d.ts +2 -2
- package/package.json +12 -12
- package/scripts/security-compare.ts +40 -0
- package/src/advisor/runtime.ts +138 -12
- package/src/advisor/transcript-recorder.ts +56 -0
- package/src/auto-thinking/classifier.ts +48 -10
- package/src/cli/args.ts +6 -0
- package/src/cli/flag-tables.ts +2 -0
- package/src/cli/gallery-fixtures/fs.ts +25 -0
- package/src/cli/session-picker.ts +34 -17
- package/src/cli/ttsr-cli.ts +19 -1
- package/src/cli.ts +9 -0
- package/src/collab/guest.ts +37 -4
- package/src/collab/host.ts +1 -0
- package/src/commands/launch.ts +6 -0
- package/src/config/model-discovery.ts +32 -5
- package/src/config/model-registry.ts +107 -25
- package/src/config/settings-schema.ts +77 -6
- package/src/config/settings.ts +25 -0
- package/src/cursor-bridge-tools.ts +81 -0
- package/src/cursor.ts +463 -12
- package/src/edit/edit-clipboard.ts +23 -0
- package/src/edit/hashline/diff.ts +49 -10
- package/src/edit/hashline/execute.ts +38 -6
- package/src/edit/hashline/filesystem.ts +27 -3
- package/src/edit/index.ts +12 -2
- package/src/edit/renderer.ts +4 -4
- package/src/edit/streaming.ts +17 -2
- package/src/eval/py/prelude.py +7 -3
- package/src/export/html/template.js +1 -1
- package/src/extensibility/extensions/runner.ts +70 -0
- package/src/extensibility/extensions/types.ts +30 -0
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +65 -13
- package/src/internal-urls/index.ts +1 -0
- package/src/internal-urls/local-protocol.ts +3 -2
- package/src/internal-urls/mcp-protocol.ts +4 -1
- package/src/internal-urls/router.ts +4 -1
- package/src/internal-urls/security-protocol.ts +261 -0
- package/src/internal-urls/types.ts +1 -1
- package/src/launch/terminal-output-worker-client.ts +53 -0
- package/src/launch/terminal-output-worker-protocol.ts +11 -0
- package/src/launch/terminal-output-worker.ts +23 -0
- package/src/lsp/client.ts +18 -3
- package/src/lsp/index.ts +7 -0
- package/src/lsp/render.ts +1 -1
- package/src/main.ts +127 -56
- package/src/mcp/manager.ts +120 -18
- package/src/modes/acp/acp-agent.ts +15 -9
- package/src/modes/components/chat-transcript-builder.ts +30 -11
- package/src/modes/components/codex-reset-fireworks.ts +369 -0
- package/src/modes/components/read-tool-group.ts +159 -17
- package/src/modes/components/session-selector.ts +19 -3
- package/src/modes/components/status-line/component.ts +381 -54
- package/src/modes/components/tool-execution.ts +78 -31
- package/src/modes/components/usage-row.ts +10 -5
- package/src/modes/controllers/event-controller.ts +26 -4
- package/src/modes/controllers/mcp-command-controller.ts +68 -3
- package/src/modes/controllers/selector-controller.ts +94 -36
- package/src/modes/controllers/tan-command-controller.ts +14 -0
- package/src/modes/interactive-mode.ts +31 -17
- package/src/modes/rpc/host-uris.ts +6 -0
- package/src/modes/rpc/rpc-client.ts +18 -0
- package/src/modes/rpc/rpc-mode.ts +16 -1
- package/src/modes/rpc/rpc-types.ts +11 -0
- package/src/modes/theme/theme.ts +151 -6
- package/src/modes/types.ts +2 -1
- package/src/modes/utils/ui-helpers.ts +38 -21
- package/src/prompts/agents/security-reviewer.md +75 -0
- package/src/prompts/security/scan-coordinator.md +7 -0
- package/src/prompts/security/scan-request.md +21 -0
- package/src/prompts/security/validate-request.md +8 -0
- package/src/prompts/system/auto-thinking-difficulty.md +4 -2
- package/src/prompts/system/plan-mode-active.md +2 -2
- package/src/prompts/system/system-prompt.md +6 -0
- package/src/prompts/system/xdev-mount-notice.md +1 -1
- package/src/prompts/tools/bash.md +15 -17
- package/src/prompts/tools/checkpoint.md +1 -1
- package/src/prompts/tools/glob.md +7 -6
- package/src/prompts/tools/grep.md +7 -6
- package/src/prompts/tools/security-publish.md +1 -0
- package/src/prompts/tools/security-scan.md +1 -0
- package/src/sdk.ts +212 -21
- package/src/security/auth.ts +98 -0
- package/src/security/cloud.ts +686 -0
- package/src/security/comparison.ts +255 -0
- package/src/security/contracts/ids.ts +111 -0
- package/src/security/contracts/index.ts +4 -0
- package/src/security/contracts/schemas.ts +201 -0
- package/src/security/contracts/types.ts +254 -0
- package/src/security/contracts/validation.ts +65 -0
- package/src/security/coordinator.ts +708 -0
- package/src/security/importers/codex-security.ts +387 -0
- package/src/security/importers/index.ts +2 -0
- package/src/security/importers/sarif.ts +357 -0
- package/src/security/index.ts +13 -0
- package/src/security/preflight.ts +405 -0
- package/src/security/provenance.ts +106 -0
- package/src/security/publication.ts +326 -0
- package/src/security/remediation.ts +93 -0
- package/src/security/resource-output.ts +50 -0
- package/src/security/sarif.ts +78 -0
- package/src/security/store.ts +430 -0
- package/src/session/agent-session-events.ts +1 -0
- package/src/session/agent-session-types.ts +40 -1
- package/src/session/agent-session.ts +302 -175
- package/src/session/claude-session-store.ts +426 -0
- package/src/session/codex-session-store.ts +673 -0
- package/src/session/credential-pin.ts +93 -0
- package/src/session/foreign-session-import.ts +52 -0
- package/src/session/foreign-session-jsonl.ts +29 -0
- package/src/session/foreign-session-store.ts +26 -0
- package/src/session/model-controls.ts +11 -3
- package/src/session/session-advisors.ts +140 -16
- package/src/session/session-entries.ts +21 -1
- package/src/session/session-handoff.ts +20 -3
- package/src/session/session-loader.ts +25 -9
- package/src/session/session-maintenance.ts +59 -11
- package/src/session/session-manager.ts +61 -0
- package/src/session/session-tools.ts +107 -5
- package/src/session/settings-stream-fn.ts +1 -0
- package/src/session/turn-recovery.ts +97 -51
- package/src/slash-commands/builtin-registry.ts +152 -3
- package/src/slash-commands/helpers/security.ts +451 -0
- package/src/system-prompt.ts +7 -2
- package/src/task/agents.ts +2 -0
- package/src/task/executor.ts +20 -4
- package/src/task/render.ts +20 -4
- package/src/task/structured-subagent.ts +6 -4
- package/src/thinking.ts +29 -10
- package/src/tools/acp-bridge.ts +52 -8
- package/src/tools/browser.ts +5 -0
- package/src/tools/builtin-names.ts +1 -0
- package/src/tools/checkpoint.ts +0 -13
- package/src/tools/grep.ts +64 -8
- package/src/tools/hub/launch.ts +10 -15
- package/src/tools/index.ts +37 -5
- package/src/tools/path-utils.ts +91 -0
- package/src/tools/read.ts +3 -0
- package/src/tools/security-scan.ts +287 -0
- package/src/tools/write.ts +9 -3
- package/src/tools/xdev.ts +39 -14
- package/src/utils/changelog.ts +144 -4
- package/src/utils/git.ts +61 -14
- package/src/utils/jj.ts +19 -13
- package/src/web/search/providers/codex.ts +34 -0
- package/src/web/search/types.ts +1 -1
|
@@ -14,11 +14,13 @@ import type { MCPManager } from "../mcp/index.js";
|
|
|
14
14
|
import { type PlanApprovalDetails } from "../plan-mode/approved-plan.js";
|
|
15
15
|
import { type AgentSession } from "../session/agent-session.js";
|
|
16
16
|
import type { CompactMode } from "../session/compact-modes.js";
|
|
17
|
+
import type { ForeignSessionSource } from "../session/foreign-session-store.js";
|
|
17
18
|
import { HistoryStorage } from "../session/history-storage.js";
|
|
18
19
|
import type { SessionContext } from "../session/session-context.js";
|
|
19
20
|
import type { SessionManager } from "../session/session-manager.js";
|
|
20
21
|
import type { ShakeMode } from "../session/shake-types.js";
|
|
21
22
|
import type { LspStartupServerInfo } from "../tools/index.js";
|
|
23
|
+
import { type StartupChangelogSelection } from "../utils/changelog.js";
|
|
22
24
|
import type { EventBus } from "../utils/event-bus.js";
|
|
23
25
|
import type { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
24
26
|
import type { BashExecutionComponent } from "./components/bash-execution.js";
|
|
@@ -174,7 +176,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
174
176
|
focusParentSession(): Promise<void>;
|
|
175
177
|
unfocusSession(): Promise<void>;
|
|
176
178
|
clearTransientSessionUi(): void;
|
|
177
|
-
constructor(session: AgentSession, version: string,
|
|
179
|
+
constructor(session: AgentSession, version: string, startupChangelog?: StartupChangelogSelection | undefined, setToolUIContext?: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers?: LspStartupServerInfo[] | undefined, mcpManager?: MCPManager, eventBus?: EventBus);
|
|
178
180
|
playWelcomeIntro(): void;
|
|
179
181
|
init(options?: InteractiveModeInitOptions): Promise<void>;
|
|
180
182
|
/** Reload the title-generation system prompt override for the provided working
|
|
@@ -369,7 +371,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
369
371
|
showUserMessageSelector(): void;
|
|
370
372
|
showCopySelector(): void;
|
|
371
373
|
showTreeSelector(): void;
|
|
372
|
-
showSessionSelector(): void;
|
|
374
|
+
showSessionSelector(source?: ForeignSessionSource): void;
|
|
373
375
|
handleResumeSession(sessionPath: string): Promise<void>;
|
|
374
376
|
handleSessionDeleteCommand(): Promise<void>;
|
|
375
377
|
showOAuthSelector(mode: "login" | "logout", providerId?: string): Promise<void>;
|
|
@@ -135,6 +135,13 @@ export declare class RpcClient {
|
|
|
135
135
|
* Get current session state.
|
|
136
136
|
*/
|
|
137
137
|
getState(): Promise<RpcSessionState>;
|
|
138
|
+
/**
|
|
139
|
+
* Enable or disable fast mode for the active model family.
|
|
140
|
+
*/
|
|
141
|
+
setFastMode(enabled: boolean): Promise<{
|
|
142
|
+
enabled: boolean;
|
|
143
|
+
active: boolean;
|
|
144
|
+
}>;
|
|
138
145
|
/**
|
|
139
146
|
* Configure subagent frames emitted by the RPC server. Servers default to "off".
|
|
140
147
|
* "progress" emits lifecycle/progress frames; "events" additionally emits raw subagent session events.
|
|
@@ -50,6 +50,10 @@ export type RpcCommand = {
|
|
|
50
50
|
} | {
|
|
51
51
|
id?: string;
|
|
52
52
|
type: "get_state";
|
|
53
|
+
} | {
|
|
54
|
+
id?: string;
|
|
55
|
+
type: "set_fast_mode";
|
|
56
|
+
enabled: boolean;
|
|
53
57
|
} | {
|
|
54
58
|
id?: string;
|
|
55
59
|
type: "get_available_commands";
|
|
@@ -187,6 +191,9 @@ export interface RpcSessionState {
|
|
|
187
191
|
sessionId: string;
|
|
188
192
|
sessionName?: string;
|
|
189
193
|
autoCompactionEnabled: boolean;
|
|
194
|
+
fastModeEnabled: boolean;
|
|
195
|
+
fastModeActive: boolean;
|
|
196
|
+
tokensPerSecond: number | null;
|
|
190
197
|
messageCount: number;
|
|
191
198
|
queuedMessageCount: number;
|
|
192
199
|
todoPhases: TodoPhase[];
|
|
@@ -315,6 +322,15 @@ export type RpcResponse = {
|
|
|
315
322
|
command: "get_state";
|
|
316
323
|
success: true;
|
|
317
324
|
data: RpcSessionState;
|
|
325
|
+
} | {
|
|
326
|
+
id?: string;
|
|
327
|
+
type: "response";
|
|
328
|
+
command: "set_fast_mode";
|
|
329
|
+
success: true;
|
|
330
|
+
data: {
|
|
331
|
+
enabled: boolean;
|
|
332
|
+
active: boolean;
|
|
333
|
+
};
|
|
318
334
|
} | {
|
|
319
335
|
id?: string;
|
|
320
336
|
type: "response";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Effort } from "@oh-my-pi/pi-ai";
|
|
3
|
-
import type { EditorTheme, MarkdownTheme, SelectListTheme, SettingsListTheme, SymbolTheme } from "@oh-my-pi/pi-tui";
|
|
3
|
+
import type { EditorTheme, MarkdownTheme, SelectListTheme, SettingsListTheme, SymbolTheme, Terminal } from "@oh-my-pi/pi-tui";
|
|
4
4
|
export { getLanguageFromPath, isMarkdownPath } from "../../utils/lang-from-path.js";
|
|
5
5
|
export type SymbolPreset = "unicode" | "nerd" | "ascii";
|
|
6
6
|
/**
|
|
@@ -328,6 +328,17 @@ export declare function getAvailableSymbolPresets(): SymbolPreset[];
|
|
|
328
328
|
* Check if a string is a valid symbol preset.
|
|
329
329
|
*/
|
|
330
330
|
export declare function isValidSymbolPreset(preset: string): preset is SymbolPreset;
|
|
331
|
+
type MacOSAppearanceReprobeTerminal = Pick<Terminal, "appearance" | "onAppearanceChange" | "onAppearanceReport" | "onPrivateModeReport" | "refreshAppearance">;
|
|
332
|
+
/**
|
|
333
|
+
* Fall back to native macOS appearance notifications when the terminal
|
|
334
|
+
* explicitly confirms that Mode 2031 notifications are unsupported.
|
|
335
|
+
*
|
|
336
|
+
* Native notifications provisionally repaint from the host appearance and
|
|
337
|
+
* synchronously trigger an OSC 11 probe, followed by a bounded burst of six
|
|
338
|
+
* retries. A changed terminal classification cancels the sequence; otherwise
|
|
339
|
+
* a confirmed terminal classification is restored at the validation deadline.
|
|
340
|
+
*/
|
|
341
|
+
export declare function startMacOSAppearanceReprobeFallback(terminal: MacOSAppearanceReprobeTerminal): () => void;
|
|
331
342
|
export declare function stopThemeWatcher(): void;
|
|
332
343
|
/**
|
|
333
344
|
* Get resolved theme colors as CSS-compatible hex strings.
|
|
@@ -13,6 +13,7 @@ import type { MCPManager } from "../mcp/index.js";
|
|
|
13
13
|
import type { PlanApprovalDetails } from "../plan-mode/approved-plan.js";
|
|
14
14
|
import type { AgentSession } from "../session/agent-session.js";
|
|
15
15
|
import type { CompactMode } from "../session/compact-modes.js";
|
|
16
|
+
import type { ForeignSessionSource } from "../session/foreign-session-store.js";
|
|
16
17
|
import type { HistoryStorage } from "../session/history-storage.js";
|
|
17
18
|
import type { SessionContext } from "../session/session-context.js";
|
|
18
19
|
import type { SessionManager } from "../session/session-manager.js";
|
|
@@ -357,7 +358,7 @@ export interface InteractiveModeContext {
|
|
|
357
358
|
showUserMessageSelector(): void;
|
|
358
359
|
showCopySelector(): void;
|
|
359
360
|
showTreeSelector(): void;
|
|
360
|
-
showSessionSelector(): void;
|
|
361
|
+
showSessionSelector(source?: ForeignSessionSource): void;
|
|
361
362
|
handleResumeSession(sessionPath: string): Promise<void>;
|
|
362
363
|
handleSessionDeleteCommand(): Promise<void>;
|
|
363
364
|
showOAuthSelector(mode: "login" | "logout", providerId?: string): Promise<void>;
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -39,6 +39,13 @@ export interface CreateAgentSessionOptions {
|
|
|
39
39
|
authStorage?: AuthStorage;
|
|
40
40
|
/** Model registry. Default: discoverModels(authStorage, agentDir) */
|
|
41
41
|
modelRegistry?: ModelRegistry;
|
|
42
|
+
/**
|
|
43
|
+
* Request credential resolver. Defaults to the model registry's normal
|
|
44
|
+
* session-affine resolver. Security scans use this narrow seam to keep one
|
|
45
|
+
* durable OAuth row pinned for the operation without changing ordinary
|
|
46
|
+
* provider routing.
|
|
47
|
+
*/
|
|
48
|
+
getApiKey?: AgentOptions["getApiKey"];
|
|
42
49
|
/** Model to use. Default: from settings, else first available */
|
|
43
50
|
model?: Model;
|
|
44
51
|
/** Raw model pattern(s) (e.g. from --model CLI flag) to resolve after extensions load.
|
|
@@ -158,6 +165,8 @@ export interface CreateAgentSessionOptions {
|
|
|
158
165
|
mcpManager?: MCPManager;
|
|
159
166
|
/** Enable LSP integration (tool, formatting, diagnostics, warmup). Default: true */
|
|
160
167
|
enableLsp?: boolean;
|
|
168
|
+
/** Restrict LSP to navigation and diagnostics even when enabled. Defaults to true for restricted sessions. */
|
|
169
|
+
lspReadOnly?: boolean;
|
|
161
170
|
/** Whether this invocation may expose IRC. `false` removes it even for subagents. */
|
|
162
171
|
enableIrc?: boolean;
|
|
163
172
|
/** Skip subprocess-kernel availability checks and prelude warmup */
|
|
@@ -166,6 +175,12 @@ export interface CreateAgentSessionOptions {
|
|
|
166
175
|
toolNames?: string[];
|
|
167
176
|
/** Limit the session to explicitly supplied tool names, without discovered extras. */
|
|
168
177
|
restrictToolNames?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Permit only caller-supplied SDK custom tools inside a restricted session.
|
|
180
|
+
* They must still be named in {@link toolNames}; discovered extensions, MCP,
|
|
181
|
+
* and ambient custom tools remain disabled. Default: false.
|
|
182
|
+
*/
|
|
183
|
+
allowRestrictedCustomTools?: boolean;
|
|
169
184
|
/** Output schema for structured completion (subagents). */
|
|
170
185
|
outputSchema?: unknown;
|
|
171
186
|
/** Enforcement policy for {@link outputSchema}; defaults to legacy permissive behavior. */
|
|
@@ -270,6 +285,7 @@ export type * from "./extensibility/extensions/index.js";
|
|
|
270
285
|
export type { Skill } from "./extensibility/skills.js";
|
|
271
286
|
export type { FileSlashCommand } from "./extensibility/slash-commands.js";
|
|
272
287
|
export type { MCPManager, MCPServerConfig, MCPServerConnection, MCPToolsLoadResult } from "./mcp/index.js";
|
|
288
|
+
export { type AgentRef, AgentRegistry, MAIN_AGENT_ID } from "./registry/agent-registry.js";
|
|
273
289
|
export type { Tool } from "./tools/index.js";
|
|
274
290
|
export { buildDirectoryTree, buildWorkspaceTree, type DirectoryTree, type WorkspaceTree } from "./workspace-tree.js";
|
|
275
291
|
export { BashTool, BUILTIN_TOOLS, createTools, EditTool, EvalTool, GlobTool, GrepTool, HIDDEN_TOOLS, ReadTool, type ToolSession, WebSearchTool, WriteTool, };
|
|
@@ -367,6 +383,8 @@ export interface BuildSystemPromptOptions {
|
|
|
367
383
|
appendPrompt?: string;
|
|
368
384
|
inlineToolDescriptors?: boolean;
|
|
369
385
|
includeWorkspaceTree?: boolean;
|
|
386
|
+
/** Include the read-only security:// resource inventory entry. Default: false. */
|
|
387
|
+
securityEnabled?: boolean;
|
|
370
388
|
}
|
|
371
389
|
/**
|
|
372
390
|
* Build the default provider-facing system prompt blocks.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentOptions } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { OAuthAccessResolution } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { AuthStorage } from "../session/auth-storage.js";
|
|
4
|
+
import type { SecurityAccountRef } from "./contracts/index.js";
|
|
5
|
+
export interface ExactSecurityOAuthOptions {
|
|
6
|
+
authStorage: AuthStorage;
|
|
7
|
+
account: SecurityAccountRef;
|
|
8
|
+
}
|
|
9
|
+
export declare function assertSecurityIdentityMatches(account: SecurityAccountRef, resolution: {
|
|
10
|
+
credentialId?: number;
|
|
11
|
+
accountId?: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
orgId?: string;
|
|
14
|
+
orgName?: string;
|
|
15
|
+
}): void;
|
|
16
|
+
export declare function selectSecurityAccount(authStorage: AuthStorage, provider: string, requestedCredentialId?: number, sessionId?: string): SecurityAccountRef;
|
|
17
|
+
export declare function resolveExactSecurityOAuthAccess(authStorage: AuthStorage, account: SecurityAccountRef, options: {
|
|
18
|
+
forceRefresh: boolean;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}): Promise<Extract<OAuthAccessResolution, {
|
|
21
|
+
ok: true;
|
|
22
|
+
}>>;
|
|
23
|
+
/**
|
|
24
|
+
* Build a request credential resolver pinned to one durable OAuth row.
|
|
25
|
+
*
|
|
26
|
+
* Initial resolution and refresh both target the same row. The auth driver's
|
|
27
|
+
* final sibling-rotation step returns `undefined`, so an unavailable account
|
|
28
|
+
* fails the scan rather than crossing an account/workspace boundary.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createExactSecurityOAuthResolver(options: ExactSecurityOAuthOptions): NonNullable<AgentOptions["getApiKey"]>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { AuthStorage } from "../session/auth-storage.js";
|
|
2
|
+
import { type SecurityAccountRef, type SecurityScanBundle, type SecuritySeverityLevel } from "./contracts/index.js";
|
|
3
|
+
import type { SecurityStore } from "./store.js";
|
|
4
|
+
type JsonObject = Record<string, unknown>;
|
|
5
|
+
export type CodexSecurityCloudFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
6
|
+
export interface CodexSecurityCloudClientOptions {
|
|
7
|
+
authStorage: AuthStorage;
|
|
8
|
+
account: SecurityAccountRef;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
fetch?: CodexSecurityCloudFetch;
|
|
11
|
+
}
|
|
12
|
+
export interface CodexSecurityCloudConfiguration {
|
|
13
|
+
id: string;
|
|
14
|
+
sourceId?: string;
|
|
15
|
+
repositoryId: string;
|
|
16
|
+
repositoryUrl: string;
|
|
17
|
+
environmentId: string;
|
|
18
|
+
state?: string;
|
|
19
|
+
currentStep?: string;
|
|
20
|
+
scanType?: string;
|
|
21
|
+
remainingScans?: number;
|
|
22
|
+
totalScans?: number;
|
|
23
|
+
createdAt?: string;
|
|
24
|
+
updatedAt?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CodexSecurityCloudConfigurationPage {
|
|
27
|
+
items: CodexSecurityCloudConfiguration[];
|
|
28
|
+
nextCursor?: string;
|
|
29
|
+
totalInAccount?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface StartCodexSecurityCloudScanInput {
|
|
32
|
+
repositoryId: string;
|
|
33
|
+
repositoryUrl: string;
|
|
34
|
+
environmentId: string;
|
|
35
|
+
lookbackDays?: number | "all";
|
|
36
|
+
maintainerAttackConcerns?: string;
|
|
37
|
+
maintainerFocusAreas?: string;
|
|
38
|
+
maintainerAdditionalContext?: string;
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
}
|
|
41
|
+
export interface CodexSecurityCloudStats {
|
|
42
|
+
configurationId: string;
|
|
43
|
+
sourceConfigurationId?: string;
|
|
44
|
+
currentStep?: string;
|
|
45
|
+
pendingCommits: number;
|
|
46
|
+
finishedCommits: number;
|
|
47
|
+
failedCommits: number;
|
|
48
|
+
findingCounts: Record<SecuritySeverityLevel, number>;
|
|
49
|
+
lastScannedCommit?: string;
|
|
50
|
+
lastScannedAt?: string;
|
|
51
|
+
updatedAt?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PullCodexSecurityCloudResultsInput {
|
|
54
|
+
client: CodexSecurityCloudClient;
|
|
55
|
+
configurationId: string;
|
|
56
|
+
store: SecurityStore;
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
}
|
|
59
|
+
export declare class CodexSecurityCloudHttpError extends Error {
|
|
60
|
+
readonly status: number;
|
|
61
|
+
readonly endpoint: string;
|
|
62
|
+
constructor(status: number, endpoint: string);
|
|
63
|
+
}
|
|
64
|
+
export declare class CodexSecurityCloudClient {
|
|
65
|
+
#private;
|
|
66
|
+
constructor(options: CodexSecurityCloudClientOptions);
|
|
67
|
+
listConfigurations(options?: {
|
|
68
|
+
limit?: number;
|
|
69
|
+
cursor?: string;
|
|
70
|
+
signal?: AbortSignal;
|
|
71
|
+
}): Promise<CodexSecurityCloudConfigurationPage>;
|
|
72
|
+
listAllConfigurations(signal?: AbortSignal): Promise<CodexSecurityCloudConfiguration[]>;
|
|
73
|
+
getConfiguration(configurationId: string, signal?: AbortSignal): Promise<CodexSecurityCloudConfiguration>;
|
|
74
|
+
startScan(input: StartCodexSecurityCloudScanInput): Promise<CodexSecurityCloudConfiguration>;
|
|
75
|
+
getStats(configurationId: string, signal?: AbortSignal): Promise<CodexSecurityCloudStats>;
|
|
76
|
+
listFindingDetails(repositoryUrl: string, configuration: CodexSecurityCloudConfiguration, signal?: AbortSignal): Promise<JsonObject[]>;
|
|
77
|
+
}
|
|
78
|
+
export declare function pullCodexSecurityCloudResults(input: PullCodexSecurityCloudResultsInput): Promise<SecurityScanBundle>;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SecurityComparisonReport, SecurityFinding, SecurityScanBundle } from "./contracts/index.js";
|
|
2
|
+
export interface SecurityDifferentialFindingMatch {
|
|
3
|
+
referenceFindingId: string;
|
|
4
|
+
candidateFindingId: string;
|
|
5
|
+
basis: "fingerprint" | "rule_location" | "taxonomy_location";
|
|
6
|
+
}
|
|
7
|
+
export interface SecurityDifferentialFindingSummary {
|
|
8
|
+
findingId: string;
|
|
9
|
+
ruleId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
severity: SecurityFinding["severity"]["level"];
|
|
12
|
+
confidence: SecurityFinding["confidence"]["level"];
|
|
13
|
+
validationStatus: SecurityFinding["validation"]["status"];
|
|
14
|
+
dispositionStatus: SecurityFinding["disposition"]["status"];
|
|
15
|
+
primaryLocation?: {
|
|
16
|
+
path: string;
|
|
17
|
+
startLine: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface SecurityDifferentialScanSummary {
|
|
21
|
+
scanId: string;
|
|
22
|
+
producer: SecurityScanBundle["scan"]["producer"];
|
|
23
|
+
status: SecurityScanBundle["scan"]["status"];
|
|
24
|
+
findingCount: number;
|
|
25
|
+
actionableFindingCount: number;
|
|
26
|
+
validatedFindingCount: number;
|
|
27
|
+
rejectedFindingCount: number;
|
|
28
|
+
coverage: SecurityScanBundle["scan"]["coverage"];
|
|
29
|
+
metrics?: SecurityScanBundle["scan"]["metrics"];
|
|
30
|
+
}
|
|
31
|
+
export interface SecurityDifferentialReport {
|
|
32
|
+
referenceScanId: string;
|
|
33
|
+
candidateScanId: string;
|
|
34
|
+
matches: SecurityDifferentialFindingMatch[];
|
|
35
|
+
referenceOnlyFindingIds: string[];
|
|
36
|
+
candidateOnlyFindingIds: string[];
|
|
37
|
+
reference: SecurityDifferentialScanSummary;
|
|
38
|
+
candidate: SecurityDifferentialScanSummary;
|
|
39
|
+
referenceOnlyFindings: SecurityDifferentialFindingSummary[];
|
|
40
|
+
candidateOnlyFindings: SecurityDifferentialFindingSummary[];
|
|
41
|
+
referenceFindingCount: number;
|
|
42
|
+
candidateFindingCount: number;
|
|
43
|
+
matchedFindingCount: number;
|
|
44
|
+
recallAgainstReference: number;
|
|
45
|
+
precisionAgainstReference: number;
|
|
46
|
+
jaccardOverlap: number;
|
|
47
|
+
}
|
|
48
|
+
export declare function compareSecurityProducers(reference: SecurityScanBundle, candidate: SecurityScanBundle): SecurityDifferentialReport;
|
|
49
|
+
export declare function compareSecurityLineage(before: SecurityScanBundle, after: SecurityScanBundle): SecurityComparisonReport;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SecurityLocation } from "./types.js";
|
|
2
|
+
export declare function canonicalSecurityJson(value: unknown): string;
|
|
3
|
+
export interface SecurityFindingFingerprintInput {
|
|
4
|
+
ruleId: string;
|
|
5
|
+
category: string;
|
|
6
|
+
anchor?: string;
|
|
7
|
+
locations: readonly SecurityLocation[];
|
|
8
|
+
}
|
|
9
|
+
export declare function createSecurityFindingFingerprint(input: SecurityFindingFingerprintInput): string;
|
|
10
|
+
export declare function createSecurityFindingId(fingerprint: string): string;
|
|
11
|
+
export declare function createSecurityOccurrenceId(fingerprint: string, locations: readonly SecurityLocation[]): string;
|
|
12
|
+
export declare function createSecurityEvidenceId(fingerprint: string, label: string, ordinal: number): string;
|
|
13
|
+
export declare function createSecurityScanId(randomUuid?: () => string): string;
|
|
14
|
+
export declare function createSecurityPlanId(fingerprint: string): string;
|
|
15
|
+
export declare function encodeSecurityProjectKey(repositoryRoot: string): string;
|