@slopus/happy-terminal 0.3.0-beta.13
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/LICENSE +21 -0
- package/LICENSE-CODEX +203 -0
- package/LICENSE-GROK-BUILD +204 -0
- package/LICENSE-HAPPY +21 -0
- package/README.md +60 -0
- package/THIRD-PARTY-NOTICES.md +34 -0
- package/dist/HappyTerminalUserError.d.ts +12 -0
- package/dist/app/AppTranscriptEntry.d.ts +33 -0
- package/dist/app/AppendOnlyStreamingRender.d.ts +12 -0
- package/dist/app/CodexFileDiff.d.ts +20 -0
- package/dist/app/CodexMcpToolCall.d.ts +25 -0
- package/dist/app/CodingAssistantAgentBackend.d.ts +81 -0
- package/dist/app/CodingAssistantApp.d.ts +128 -0
- package/dist/app/CompletedTurn.d.ts +11 -0
- package/dist/app/FileMentionAutocomplete.d.ts +30 -0
- package/dist/app/HappyTerminalProcessTerminal.d.ts +7 -0
- package/dist/app/NoticeChild.d.ts +4 -0
- package/dist/app/SecretMenuController.d.ts +31 -0
- package/dist/app/SelectionList.d.ts +24 -0
- package/dist/app/SessionDraftSync.d.ts +51 -0
- package/dist/app/StartupStatusApp.d.ts +34 -0
- package/dist/app/StartupStatusCardModel.d.ts +22 -0
- package/dist/app/TemporaryFullscreenController.d.ts +9 -0
- package/dist/app/TerminalColorLevel.d.ts +1 -0
- package/dist/app/TerminalOutputTrace.d.ts +12 -0
- package/dist/app/TerminalTheme.d.ts +11 -0
- package/dist/app/TranscriptEntryRenderCache.d.ts +10 -0
- package/dist/app/applyWorkflowRunUpdate.d.ts +2 -0
- package/dist/app/blendComposerBackground.d.ts +2 -0
- package/dist/app/boundedJsonStringify.d.ts +1 -0
- package/dist/app/calculateCacheHitPercent.d.ts +2 -0
- package/dist/app/codexDiffAnsi.d.ts +17 -0
- package/dist/app/compactCompletedTurnEntries.d.ts +2 -0
- package/dist/app/containsMarkdownTable.d.ts +1 -0
- package/dist/app/createAgentMarkdownTheme.d.ts +3 -0
- package/dist/app/createBackgroundTerminalViewer.d.ts +16 -0
- package/dist/app/createCompletedTurn.d.ts +6 -0
- package/dist/app/createEditorTheme.d.ts +3 -0
- package/dist/app/createFileMentionAutocompleteItems.d.ts +3 -0
- package/dist/app/createSecretInputPanel.d.ts +12 -0
- package/dist/app/createSelectionPanel.d.ts +14 -0
- package/dist/app/createSerialTaskQueue.d.ts +1 -0
- package/dist/app/createSessionPicker.d.ts +17 -0
- package/dist/app/createSlashCommands.d.ts +7 -0
- package/dist/app/createStopOnceHandler.d.ts +1 -0
- package/dist/app/createSubagentMonitor.d.ts +17 -0
- package/dist/app/createTerminalInputBurstHandler.d.ts +5 -0
- package/dist/app/createWorkflowMonitor.d.ts +15 -0
- package/dist/app/defaultTerminalTheme.d.ts +1 -0
- package/dist/app/describeModelChoice.d.ts +4 -0
- package/dist/app/describeProviderSignIn.d.ts +2 -0
- package/dist/app/describeReasoningLevel.d.ts +4 -0
- package/dist/app/detectCodexDiffLanguage.d.ts +1 -0
- package/dist/app/encodeModelChoice.d.ts +1 -0
- package/dist/app/endsAfterOpeningCodeFence.d.ts +1 -0
- package/dist/app/findFileMentionContext.d.ts +9 -0
- package/dist/app/findFileMentionPrefix.d.ts +5 -0
- package/dist/app/formatActivityElapsedTime.d.ts +1 -0
- package/dist/app/formatCodexMcpToolResult.d.ts +3 -0
- package/dist/app/formatCompactTokens.d.ts +1 -0
- package/dist/app/formatFileMention.d.ts +1 -0
- package/dist/app/formatProviderError.d.ts +6 -0
- package/dist/app/formatRelativeTime.d.ts +2 -0
- package/dist/app/formatResetDuration.d.ts +1 -0
- package/dist/app/formatSessionPickerEntry.d.ts +14 -0
- package/dist/app/formatSessionTokenStatus.d.ts +6 -0
- package/dist/app/formatSessionUsageSummary.d.ts +3 -0
- package/dist/app/formatStartupStatusUsageRemaining.d.ts +2 -0
- package/dist/app/formatStartupStatusUsageRows.d.ts +2 -0
- package/dist/app/formatSubagentToolCall.d.ts +10 -0
- package/dist/app/formatToolPermissionNotice.d.ts +3 -0
- package/dist/app/formatToolResultForDisplay.d.ts +2 -0
- package/dist/app/formatTurnUsageSummary.d.ts +2 -0
- package/dist/app/formatWorkUsageSummary.d.ts +14 -0
- package/dist/app/highlightAgentCode.d.ts +1 -0
- package/dist/app/highlightCodexDiffLine.d.ts +2 -0
- package/dist/app/highlightShellCommand.d.ts +1 -0
- package/dist/app/humanizeGoalStatus.d.ts +2 -0
- package/dist/app/humanizeMcpName.d.ts +1 -0
- package/dist/app/humanizePermissionMode.d.ts +2 -0
- package/dist/app/humanizePermissionReviewLevel.d.ts +2 -0
- package/dist/app/humanizeProviderId.d.ts +1 -0
- package/dist/app/humanizeReasoningLevel.d.ts +1 -0
- package/dist/app/humanizeSubagentStatus.d.ts +2 -0
- package/dist/app/humanizeToolName.d.ts +1 -0
- package/dist/app/humanizeWorkflowStatus.d.ts +2 -0
- package/dist/app/installResumeInstructions.d.ts +26 -0
- package/dist/app/installTerminalCrashCleanup.d.ts +26 -0
- package/dist/app/isLightTerminalBackground.d.ts +2 -0
- package/dist/app/layoutCodexFileDiff.d.ts +13 -0
- package/dist/app/looksLikeAuthenticationFailure.d.ts +5 -0
- package/dist/app/nearestXtermColorIndex.d.ts +2 -0
- package/dist/app/parseCodexMcpToolInvocation.d.ts +2 -0
- package/dist/app/parseSessionCommand.d.ts +6 -0
- package/dist/app/providerErrorResetAt.d.ts +2 -0
- package/dist/app/providerQuotaToStartupStatusUsage.d.ts +3 -0
- package/dist/app/readClipboardImage.d.ts +9 -0
- package/dist/app/renderActivityWave.d.ts +3 -0
- package/dist/app/renderAgentMarkdown.d.ts +8 -0
- package/dist/app/renderBackgroundTerminalCompletion.d.ts +1 -0
- package/dist/app/renderBackgroundTerminalInteraction.d.ts +2 -0
- package/dist/app/renderBackgroundTerminalSummary.d.ts +1 -0
- package/dist/app/renderChildRows.d.ts +13 -0
- package/dist/app/renderCodexDiffLine.d.ts +3 -0
- package/dist/app/renderCodexFileDiff.d.ts +7 -0
- package/dist/app/renderCodexMcpToolCall.d.ts +2 -0
- package/dist/app/renderCompletedTurnStats.d.ts +2 -0
- package/dist/app/renderExecCommand.d.ts +11 -0
- package/dist/app/renderExploration.d.ts +9 -0
- package/dist/app/renderFullscreenComponent.d.ts +8 -0
- package/dist/app/renderHappyTerminalBanner.d.ts +6 -0
- package/dist/app/renderHappyTerminalVersion.d.ts +1 -0
- package/dist/app/renderNoticeWithChildren.d.ts +7 -0
- package/dist/app/renderPendingSteeringMessages.d.ts +1 -0
- package/dist/app/renderStartupStatusCard.d.ts +7 -0
- package/dist/app/renderSubagentSummary.d.ts +6 -0
- package/dist/app/renderTurnCompletionSeparator.d.ts +1 -0
- package/dist/app/renderWorkflowSummary.d.ts +1 -0
- package/dist/app/resolveInputBackground.d.ts +3 -0
- package/dist/app/resolveStartupProviderQuota.d.ts +3 -0
- package/dist/app/resolveStartupSessionId.d.ts +18 -0
- package/dist/app/resolveTerminalColorLevel.d.ts +2 -0
- package/dist/app/resolveTerminalStyle.d.ts +1 -0
- package/dist/app/resolveTerminalTheme.d.ts +5 -0
- package/dist/app/runApp.d.ts +27 -0
- package/dist/app/runClipboardCommand.d.ts +8 -0
- package/dist/app/sanitizeTerminalText.d.ts +1 -0
- package/dist/app/shortenHomePath.d.ts +2 -0
- package/dist/app/sortSubagentsForDisplay.d.ts +2 -0
- package/dist/app/subagentElapsedMs.d.ts +2 -0
- package/dist/app/subagentLogMessageText.d.ts +2 -0
- package/dist/app/surfaceThemedLine.d.ts +3 -0
- package/dist/app/truncatePathToWidth.d.ts +1 -0
- package/dist/app/truncateTextForDisplay.d.ts +5 -0
- package/dist/app/truncateUtf8BytesForDisplay.d.ts +1 -0
- package/dist/app/upsertSubagentSummary.d.ts +2 -0
- package/dist/app/workflowDisplay.d.ts +2 -0
- package/dist/client/HappyAgentEventHub.d.ts +25 -0
- package/dist/client/RemoteAgent.d.ts +74 -0
- package/dist/client/RemoteAgentRunError.d.ts +4 -0
- package/dist/client/RemoteTerminalAttachment.d.ts +19 -0
- package/dist/client/RemoteTerminalClientReplica.d.ts +14 -0
- package/dist/client/ensureLocalProtocolServer.d.ts +10 -0
- package/dist/client/fetchProviderQuotas.d.ts +10 -0
- package/dist/client/index.d.ts +8 -0
- package/dist/client/loadAgentCatalog.d.ts +32 -0
- package/dist/config/createProjectConfigSecurityNotice.d.ts +10 -0
- package/dist/config/defaultConfig.d.ts +2 -0
- package/dist/config/getDefaultGlobalConfigPath.d.ts +1 -0
- package/dist/config/getDefaultLocalConfigPath.d.ts +1 -0
- package/dist/config/getDefaultRuntimeConfigPath.d.ts +1 -0
- package/dist/config/getHappyConfigDirectory.d.ts +1 -0
- package/dist/config/getHappyTerminalHome.d.ts +1 -0
- package/dist/config/index.d.ts +15 -0
- package/dist/config/loadConfig.d.ts +2 -0
- package/dist/config/mergeConfigValues.d.ts +2 -0
- package/dist/config/parseConfigToml.d.ts +7 -0
- package/dist/config/readConfigFile.d.ts +2 -0
- package/dist/config/readProjectConfigFile.d.ts +2 -0
- package/dist/config/resolveConfigPaths.d.ts +2 -0
- package/dist/config/runtimeConfigLock.d.ts +1 -0
- package/dist/config/types.d.ts +74 -0
- package/dist/config/updateRuntimeConfig.d.ts +2 -0
- package/dist/config/updateRuntimePreferences.d.ts +2 -0
- package/dist/config/withoutProjectMachineSettings.d.ts +7 -0
- package/dist/config/writeRuntimeConfig.d.ts +3 -0
- package/dist/config/writeRuntimeConfigDefaults.d.ts +2 -0
- package/dist/daemon/createUnixSocketFetch.d.ts +2 -0
- package/dist/daemon/daemonPid.d.ts +11 -0
- package/dist/daemon/ensureHappyAgentBinary.d.ts +15 -0
- package/dist/daemon/ensureLocalProtocolServer.d.ts +24 -0
- package/dist/daemon/getHappyDaemonPaths.d.ts +16 -0
- package/dist/daemon/happyAgentBinaryConfig.d.ts +15 -0
- package/dist/daemon/index.d.ts +5 -0
- package/dist/daemon/runDaemonCommand.d.ts +4 -0
- package/dist/debug/DebugLog.d.ts +11 -0
- package/dist/debug/closeNodeInspector.d.ts +1 -0
- package/dist/debug/createDebugJsonReplacer.d.ts +1 -0
- package/dist/debug/createRequestDebugDirectory.d.ts +1 -0
- package/dist/debug/getDebugRootDirectory.d.ts +1 -0
- package/dist/debug/getNodeInspectorUrl.d.ts +1 -0
- package/dist/debug/index.d.ts +8 -0
- package/dist/debug/openNodeInspector.d.ts +1 -0
- package/dist/debug/registerHappyTerminalDebugRoot.d.ts +5 -0
- package/dist/docs/DESIGN.md +2191 -0
- package/dist/docs/README.md +93 -0
- package/dist/docs/agents-and-collaboration.md +365 -0
- package/dist/docs/architecture.md +468 -0
- package/dist/docs/extending.md +561 -0
- package/dist/docs/happy.md +386 -0
- package/dist/docs/permissions-and-sandbox.md +342 -0
- package/dist/docs/workspaces.md +281 -0
- package/dist/errorToMessage.d.ts +1 -0
- package/dist/formatCliFailure.d.ts +10 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17151 -0
- package/dist/main.js +18946 -0
- package/dist/observability/daemonContext.d.ts +16 -0
- package/dist/observability/index.d.ts +1 -0
- package/dist/processes/BoundedOutputBuffer.d.ts +20 -0
- package/dist/processes/NativeProcessManager.d.ts +66 -0
- package/dist/processes/ProcessGroupReaper.d.ts +32 -0
- package/dist/processes/index.d.ts +7 -0
- package/dist/processes/isProcessRunning.d.ts +1 -0
- package/dist/processes/isTargetProcessAlive.d.ts +1 -0
- package/dist/processes/killProcessTree.d.ts +2 -0
- package/dist/processes/resolveSystemShell.d.ts +1 -0
- package/dist/processes/startProcessTransport.d.ts +33 -0
- package/dist/processes/types.d.ts +41 -0
- package/dist/processes/waitForProcessExit.d.ts +2 -0
- package/dist/protocol/AppletProtocol.d.ts +101 -0
- package/dist/protocol/Attachment.d.ts +96 -0
- package/dist/protocol/ClientProtocolTypes.d.ts +481 -0
- package/dist/protocol/DocumentProtocol.d.ts +109 -0
- package/dist/protocol/EventId.d.ts +1 -0
- package/dist/protocol/FolderProtocol.d.ts +236 -0
- package/dist/protocol/FolderSharingProtocol.d.ts +97 -0
- package/dist/protocol/GitHubPluginProtocol.d.ts +43 -0
- package/dist/protocol/GlobalSecurityProtocol.d.ts +7 -0
- package/dist/protocol/HappyCloudProtocol.d.ts +178 -0
- package/dist/protocol/InstallationProtocol.d.ts +80 -0
- package/dist/protocol/OnboardingProtocol.d.ts +47 -0
- package/dist/protocol/P2pCredentialProtocol.d.ts +273 -0
- package/dist/protocol/P2pIdentityProtocol.d.ts +8 -0
- package/dist/protocol/P2pPairingProtocol.d.ts +68 -0
- package/dist/protocol/P2pProtocol.d.ts +185 -0
- package/dist/protocol/PluginWireTypes.d.ts +81 -0
- package/dist/protocol/ProfileProtocol.d.ts +127 -0
- package/dist/protocol/ProjectFileProtocol.d.ts +63 -0
- package/dist/protocol/ProjectProtocol.d.ts +646 -0
- package/dist/protocol/ProtocolVersion.d.ts +8 -0
- package/dist/protocol/ServiceNotice.d.ts +175 -0
- package/dist/protocol/SessionProtocol.d.ts +1156 -0
- package/dist/protocol/SharingProtocol.d.ts +159 -0
- package/dist/protocol/SlotProtocol.d.ts +270 -0
- package/dist/protocol/TimelineProtocol.d.ts +88 -0
- package/dist/protocol/WorkletProtocol.d.ts +159 -0
- package/dist/protocol/createEventIdFactory.d.ts +7 -0
- package/dist/protocol/index.d.ts +34 -0
- package/dist/readPackageVersion.d.ts +1 -0
- package/dist/readPackageVersion.js +16 -0
- package/dist/reportCliFailure.d.ts +2 -0
- package/dist/runHappyTerminal.d.ts +6 -0
- package/dist/terminal/index.d.ts +2 -0
- package/dist/terminal/types.d.ts +39 -0
- package/dist/types.d.ts +6 -0
- package/dist/writeStderrSync.d.ts +5 -0
- package/package.json +97 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Component } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { SubagentSummary } from "../protocol/index.js";
|
|
3
|
+
import type { WorkflowRun } from "../protocol/index.js";
|
|
4
|
+
import type { TerminalTheme } from "./TerminalTheme.js";
|
|
5
|
+
export interface CreateWorkflowMonitorOptions {
|
|
6
|
+
getSubagents(): readonly SubagentSummary[];
|
|
7
|
+
getWorkflows(): readonly WorkflowRun[];
|
|
8
|
+
initialRunId?: string;
|
|
9
|
+
now?: () => number;
|
|
10
|
+
onCancel(): void;
|
|
11
|
+
onRequestRender?(): void;
|
|
12
|
+
onStop(runId: string): void | Promise<void>;
|
|
13
|
+
theme?: TerminalTheme;
|
|
14
|
+
}
|
|
15
|
+
export declare function createWorkflowMonitor(options: CreateWorkflowMonitorOptions): Component;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_TERMINAL_THEME: import("./TerminalTheme.js").TerminalTheme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function detectCodexDiffLanguage(path: string): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodeModelChoice(providerId: string, modelId: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function endsAfterOpeningCodeFence(text: string): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FileMentionPrefix } from "./findFileMentionPrefix.js";
|
|
2
|
+
export interface FileMentionContext extends FileMentionPrefix {
|
|
3
|
+
afterCursor: string;
|
|
4
|
+
key: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function findFileMentionContext(lines: readonly string[], cursor: {
|
|
7
|
+
line: number;
|
|
8
|
+
col: number;
|
|
9
|
+
}): FileMentionContext | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatActivityElapsedTime(elapsedMs: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatCompactTokens(value: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatFileMention(path: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatResetDuration(milliseconds: number): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentCatalogEntry } from "../client/index.js";
|
|
2
|
+
export interface SessionPickerEntry {
|
|
3
|
+
/** Short badge for sessions that need attention or ended unexpectedly. */
|
|
4
|
+
badge?: string;
|
|
5
|
+
/** Last activity plus context size, shown right-aligned next to the title. */
|
|
6
|
+
meta: string;
|
|
7
|
+
/** The most recent thing that happened, or the directory when titles are missing. */
|
|
8
|
+
detail?: string;
|
|
9
|
+
title: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function formatSessionPickerEntry(entry: AgentCatalogEntry, options: {
|
|
12
|
+
now: number;
|
|
13
|
+
showDirectory: boolean;
|
|
14
|
+
}): SessionPickerEntry;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { GetSessionUsageResponse } from "../protocol/index.js";
|
|
2
|
+
import type { CodingAssistantModelChoice } from "./CodingAssistantAgentBackend.js";
|
|
3
|
+
export declare function formatSessionUsageSummary(summary: GetSessionUsageResponse, modelChoices: readonly CodingAssistantModelChoice[], now?: number): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Model } from "../protocol/index.js";
|
|
2
|
+
import type { CodingAssistantModelChoice } from "./CodingAssistantAgentBackend.js";
|
|
3
|
+
export declare function formatSubagentToolCall(options: {
|
|
4
|
+
args: Readonly<Record<string, unknown>>;
|
|
5
|
+
currentModel: Model;
|
|
6
|
+
currentProviderId: string;
|
|
7
|
+
modelChoices: readonly CodingAssistantModelChoice[];
|
|
8
|
+
resolvedModelId?: string;
|
|
9
|
+
toolName: string;
|
|
10
|
+
}): string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Usage } from "../protocol/index.js";
|
|
2
|
+
type WorkUsage = Pick<Usage, "cacheRead" | "input" | "output">;
|
|
3
|
+
type DetailedUsage = WorkUsage & Pick<Usage, "cacheWrite">;
|
|
4
|
+
/** Human-scale work volume for compact status rows. */
|
|
5
|
+
export declare function formatWorkUsageSummary(usage: WorkUsage, options?: {
|
|
6
|
+
readonly contextTokens?: number;
|
|
7
|
+
readonly usedTokens?: number;
|
|
8
|
+
}): string;
|
|
9
|
+
/** Full provider counters for multiline usage views. */
|
|
10
|
+
export declare function formatWorkUsageDetails(usage: DetailedUsage): string[];
|
|
11
|
+
/** Keep one decimal at token-display scales so usage remains informative. */
|
|
12
|
+
export declare function formatUsageTokens(value: number): string;
|
|
13
|
+
export declare function calculateUsedTokens(usage: WorkUsage): number;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function highlightAgentCode(code: string, lang?: string): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function highlightShellCommand(command: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function humanizeMcpName(value: string, fallback?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function humanizeProviderId(providerId: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function humanizeReasoningLevel(level: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function humanizeToolName(name: string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface ResumeInstructions {
|
|
2
|
+
/** Reports the instructions now, on the ordinary exit path. */
|
|
3
|
+
report(): void;
|
|
4
|
+
/** Drops the instructions without reporting them, for a reload that reopens the session. */
|
|
5
|
+
suppress(): void;
|
|
6
|
+
uninstall(): void;
|
|
7
|
+
}
|
|
8
|
+
export interface ResumeInstructionsProcessEvents {
|
|
9
|
+
off(event: "exit", listener: () => void): void;
|
|
10
|
+
on(event: "exit", listener: () => void): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Keeps the way back into a session on screen no matter how Happy Terminal leaves it.
|
|
14
|
+
*
|
|
15
|
+
* The session id is the only handle a user has on a session once the TUI is gone, so losing it
|
|
16
|
+
* loses the work. Printing it from the shutdown path alone is not enough: a hangup, a fatal
|
|
17
|
+
* error, or a failure between opening the session and starting the app all skip that path. This
|
|
18
|
+
* installs one hook that fires on any exit once the id is known, reports at most once, and writes
|
|
19
|
+
* synchronously so an immediate `process.exit` cannot truncate it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function installResumeInstructions(options: {
|
|
22
|
+
processEvents?: ResumeInstructionsProcessEvents;
|
|
23
|
+
resumeCommand: string;
|
|
24
|
+
sessionId: string;
|
|
25
|
+
write?: (text: string) => void;
|
|
26
|
+
}): ResumeInstructions;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface TerminalCrashCleanup {
|
|
2
|
+
restore(): void;
|
|
3
|
+
/**
|
|
4
|
+
* Restores the terminal and briefly swallows late answers to Happy Terminal's terminal queries, so
|
|
5
|
+
* focus events and background-colour replies never land in the shell as escape garbage.
|
|
6
|
+
*/
|
|
7
|
+
restoreAndDrain(): Promise<void>;
|
|
8
|
+
uninstall(): void;
|
|
9
|
+
}
|
|
10
|
+
export type TerminalCrashCleanupEvent = "uncaughtExceptionMonitor" | "unhandledRejection";
|
|
11
|
+
export interface TerminalCrashCleanupProcessEvents {
|
|
12
|
+
off(event: TerminalCrashCleanupEvent, listener: () => void): void;
|
|
13
|
+
on(event: "uncaughtExceptionMonitor", listener: () => void): void;
|
|
14
|
+
prependListener(event: "unhandledRejection", listener: () => void): void;
|
|
15
|
+
}
|
|
16
|
+
export declare function installTerminalCrashCleanup(options: {
|
|
17
|
+
processEvents?: TerminalCrashCleanupProcessEvents;
|
|
18
|
+
terminal: {
|
|
19
|
+
drainInput?(maxMs?: number, idleMs?: number): Promise<void>;
|
|
20
|
+
stop(): void;
|
|
21
|
+
write(data: string): void;
|
|
22
|
+
};
|
|
23
|
+
tui: {
|
|
24
|
+
stop(): void;
|
|
25
|
+
};
|
|
26
|
+
}): TerminalCrashCleanup;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CodexFileDiff, CodexFileDiffLineKind } from "./CodexFileDiff.js";
|
|
2
|
+
export interface LaidOutCodexDiffLine {
|
|
3
|
+
kind: CodexFileDiffLineKind;
|
|
4
|
+
lineNumber: number;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export type LaidOutCodexDiffRow = {
|
|
8
|
+
readonly type: "hunk_separator";
|
|
9
|
+
} | {
|
|
10
|
+
readonly line: LaidOutCodexDiffLine;
|
|
11
|
+
readonly type: "line";
|
|
12
|
+
};
|
|
13
|
+
export declare function layoutCodexFileDiff(diff: CodexFileDiff): Generator<LaidOutCodexDiffRow>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ProviderQuota } from "@slopus/happy-providers";
|
|
2
|
+
import type { StartupStatusCardUsage } from "./StartupStatusCardModel.js";
|
|
3
|
+
export declare function providerQuotaToStartupStatusUsage(quota: ProviderQuota | undefined, now?: number): StartupStatusCardUsage | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ClipboardImage {
|
|
2
|
+
data: string;
|
|
3
|
+
mediaType: string;
|
|
4
|
+
path: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ReadClipboardImageOptions {
|
|
7
|
+
outputDirectory?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function readClipboardImage(options?: ReadClipboardImageOptions): Promise<ClipboardImage | undefined>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TerminalTheme } from "./TerminalTheme.js";
|
|
2
|
+
export interface RenderAgentMarkdownOptions {
|
|
3
|
+
text: string;
|
|
4
|
+
width: number;
|
|
5
|
+
cwd: string;
|
|
6
|
+
theme?: TerminalTheme;
|
|
7
|
+
}
|
|
8
|
+
export declare function renderAgentMarkdown(options: RenderAgentMarkdownOptions): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderBackgroundTerminalCompletion(command: string, width: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderBackgroundTerminalSummary(count: number, width: number): string | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ChildRow {
|
|
2
|
+
lineLimit?: number;
|
|
3
|
+
prefix?: string;
|
|
4
|
+
suffix?: string;
|
|
5
|
+
text: string;
|
|
6
|
+
wrap?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function renderChildRows(rows: readonly ChildRow[], options: {
|
|
9
|
+
afterMarker?: string;
|
|
10
|
+
markerStyle?: string;
|
|
11
|
+
pad?: boolean;
|
|
12
|
+
width: number;
|
|
13
|
+
}): string[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CodexDiffPalette } from "./CodexFileDiff.js";
|
|
2
|
+
import type { LaidOutCodexDiffLine } from "./layoutCodexFileDiff.js";
|
|
3
|
+
export declare function renderCodexDiffLine(line: LaidOutCodexDiffLine, lineNumberWidth: number, language: string | undefined, palette: CodexDiffPalette, width: number): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CodexDiffPalette, CodexFileDiff } from "./CodexFileDiff.js";
|
|
2
|
+
export interface RenderCodexFileDiffOptions {
|
|
3
|
+
readonly maxRows?: number;
|
|
4
|
+
readonly palette?: CodexDiffPalette;
|
|
5
|
+
readonly width?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function renderCodexFileDiff(diff: CodexFileDiff, options?: RenderCodexFileDiffOptions): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExecCommandPresentation } from "../protocol/index.js";
|
|
2
|
+
export declare function renderExecCommand(presentation: ExecCommandPresentation, options: {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
brand: string;
|
|
5
|
+
detail?: string;
|
|
6
|
+
primary: string;
|
|
7
|
+
review?: string;
|
|
8
|
+
status: string;
|
|
9
|
+
verb: string;
|
|
10
|
+
width: number;
|
|
11
|
+
}): string[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ExplorationToolCallPresentation } from "../protocol/index.js";
|
|
2
|
+
export declare function renderExploration(presentations: readonly ExplorationToolCallPresentation[], options: {
|
|
3
|
+
accent: string;
|
|
4
|
+
brand: string;
|
|
5
|
+
primary: string;
|
|
6
|
+
status: string;
|
|
7
|
+
title: "Awaiting approval" | "Explored" | "Exploring";
|
|
8
|
+
width: number;
|
|
9
|
+
}): string[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Component } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { TerminalTheme } from "./TerminalTheme.js";
|
|
3
|
+
export declare function renderFullscreenComponent(options: {
|
|
4
|
+
component: Component;
|
|
5
|
+
height: number;
|
|
6
|
+
theme: TerminalTheme;
|
|
7
|
+
width: number;
|
|
8
|
+
}): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderHappyTerminalVersion(version: string, width: number): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderPendingSteeringMessages(messages: readonly string[], width: number): string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StartupStatusCardModel } from "./StartupStatusCardModel.js";
|
|
2
|
+
import type { TerminalTheme } from "./TerminalTheme.js";
|
|
3
|
+
export declare function renderStartupStatusCard(options: {
|
|
4
|
+
model: StartupStatusCardModel;
|
|
5
|
+
theme: TerminalTheme;
|
|
6
|
+
width: number;
|
|
7
|
+
}): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderTurnCompletionSeparator(elapsedMs: number, width: number, usageSummary?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderWorkflowSummary(count: number, width: number): string | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const STARTUP_PROVIDER_QUOTA_BUDGET_MS = 200;
|
|
2
|
+
/** Startup shows quota only when the probe answers within its budget; it never blocks. */
|
|
3
|
+
export declare function resolveStartupProviderQuota<T>(load: () => Promise<T>, budgetMs?: number): Promise<T | undefined>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HappyAgentClient } from "@slopus/happy-agent-client";
|
|
2
|
+
import type { SessionCommandOptions } from "./parseSessionCommand.js";
|
|
3
|
+
import type { StartupStatusApp } from "./StartupStatusApp.js";
|
|
4
|
+
export interface StartupSessionSelection {
|
|
5
|
+
command: "fork" | "resume";
|
|
6
|
+
selection: SessionCommandOptions;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Turns a `happy-terminal resume` or `happy-terminal fork` invocation into the session the TUI should open, asking the
|
|
10
|
+
* user on the startup screen when the command did not name one. Returns undefined when the user
|
|
11
|
+
* dismisses the picker, which is a decision rather than a failure.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveStartupSessionId(options: {
|
|
14
|
+
client: HappyAgentClient;
|
|
15
|
+
cwd: string;
|
|
16
|
+
selection: StartupSessionSelection;
|
|
17
|
+
startup: StartupStatusApp;
|
|
18
|
+
}): Promise<string | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveTerminalStyle(value: string, role: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RgbColor } from "@earendil-works/pi-tui";
|
|
2
|
+
import type { ConfigTheme } from "../config/index.js";
|
|
3
|
+
import type { TerminalTheme } from "./TerminalTheme.js";
|
|
4
|
+
import type { TerminalColorLevel } from "./TerminalColorLevel.js";
|
|
5
|
+
export declare function resolveTerminalTheme(config: ConfigTheme, terminalBackground?: RgbColor, colorLevel?: TerminalColorLevel): TerminalTheme;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Context } from "@steve.kite/stdlib";
|
|
2
|
+
import type { PermissionMode } from "../protocol/index.js";
|
|
3
|
+
import { type StartupSessionSelection } from "./resolveStartupSessionId.js";
|
|
4
|
+
export interface RunAppOptions {
|
|
5
|
+
/** Command the host exposes for reopening a session, normally `happy`. */
|
|
6
|
+
commandName?: string;
|
|
7
|
+
compactCompletedTurns?: boolean;
|
|
8
|
+
cwd?: string;
|
|
9
|
+
debug?: boolean;
|
|
10
|
+
effort?: string;
|
|
11
|
+
instructions?: string;
|
|
12
|
+
modelId?: string;
|
|
13
|
+
onError?: (error: unknown) => void;
|
|
14
|
+
providerId?: string;
|
|
15
|
+
permissionMode?: PermissionMode;
|
|
16
|
+
resumeSessionId?: string;
|
|
17
|
+
sessionSelection?: StartupSessionSelection;
|
|
18
|
+
showReasoning?: boolean;
|
|
19
|
+
showUsage?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type RunAppResult = {
|
|
22
|
+
action: "exit";
|
|
23
|
+
} | {
|
|
24
|
+
action: "reload";
|
|
25
|
+
sessionId: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function runApp(ctx: Context, options?: RunAppOptions): Promise<RunAppResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sanitizeTerminalText(text: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function truncatePathToWidth(path: string, width: number): string;
|