@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.
Files changed (248) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE-CODEX +203 -0
  3. package/LICENSE-GROK-BUILD +204 -0
  4. package/LICENSE-HAPPY +21 -0
  5. package/README.md +60 -0
  6. package/THIRD-PARTY-NOTICES.md +34 -0
  7. package/dist/HappyTerminalUserError.d.ts +12 -0
  8. package/dist/app/AppTranscriptEntry.d.ts +33 -0
  9. package/dist/app/AppendOnlyStreamingRender.d.ts +12 -0
  10. package/dist/app/CodexFileDiff.d.ts +20 -0
  11. package/dist/app/CodexMcpToolCall.d.ts +25 -0
  12. package/dist/app/CodingAssistantAgentBackend.d.ts +81 -0
  13. package/dist/app/CodingAssistantApp.d.ts +128 -0
  14. package/dist/app/CompletedTurn.d.ts +11 -0
  15. package/dist/app/FileMentionAutocomplete.d.ts +30 -0
  16. package/dist/app/HappyTerminalProcessTerminal.d.ts +7 -0
  17. package/dist/app/NoticeChild.d.ts +4 -0
  18. package/dist/app/SecretMenuController.d.ts +31 -0
  19. package/dist/app/SelectionList.d.ts +24 -0
  20. package/dist/app/SessionDraftSync.d.ts +51 -0
  21. package/dist/app/StartupStatusApp.d.ts +34 -0
  22. package/dist/app/StartupStatusCardModel.d.ts +22 -0
  23. package/dist/app/TemporaryFullscreenController.d.ts +9 -0
  24. package/dist/app/TerminalColorLevel.d.ts +1 -0
  25. package/dist/app/TerminalOutputTrace.d.ts +12 -0
  26. package/dist/app/TerminalTheme.d.ts +11 -0
  27. package/dist/app/TranscriptEntryRenderCache.d.ts +10 -0
  28. package/dist/app/applyWorkflowRunUpdate.d.ts +2 -0
  29. package/dist/app/blendComposerBackground.d.ts +2 -0
  30. package/dist/app/boundedJsonStringify.d.ts +1 -0
  31. package/dist/app/calculateCacheHitPercent.d.ts +2 -0
  32. package/dist/app/codexDiffAnsi.d.ts +17 -0
  33. package/dist/app/compactCompletedTurnEntries.d.ts +2 -0
  34. package/dist/app/containsMarkdownTable.d.ts +1 -0
  35. package/dist/app/createAgentMarkdownTheme.d.ts +3 -0
  36. package/dist/app/createBackgroundTerminalViewer.d.ts +16 -0
  37. package/dist/app/createCompletedTurn.d.ts +6 -0
  38. package/dist/app/createEditorTheme.d.ts +3 -0
  39. package/dist/app/createFileMentionAutocompleteItems.d.ts +3 -0
  40. package/dist/app/createSecretInputPanel.d.ts +12 -0
  41. package/dist/app/createSelectionPanel.d.ts +14 -0
  42. package/dist/app/createSerialTaskQueue.d.ts +1 -0
  43. package/dist/app/createSessionPicker.d.ts +17 -0
  44. package/dist/app/createSlashCommands.d.ts +7 -0
  45. package/dist/app/createStopOnceHandler.d.ts +1 -0
  46. package/dist/app/createSubagentMonitor.d.ts +17 -0
  47. package/dist/app/createTerminalInputBurstHandler.d.ts +5 -0
  48. package/dist/app/createWorkflowMonitor.d.ts +15 -0
  49. package/dist/app/defaultTerminalTheme.d.ts +1 -0
  50. package/dist/app/describeModelChoice.d.ts +4 -0
  51. package/dist/app/describeProviderSignIn.d.ts +2 -0
  52. package/dist/app/describeReasoningLevel.d.ts +4 -0
  53. package/dist/app/detectCodexDiffLanguage.d.ts +1 -0
  54. package/dist/app/encodeModelChoice.d.ts +1 -0
  55. package/dist/app/endsAfterOpeningCodeFence.d.ts +1 -0
  56. package/dist/app/findFileMentionContext.d.ts +9 -0
  57. package/dist/app/findFileMentionPrefix.d.ts +5 -0
  58. package/dist/app/formatActivityElapsedTime.d.ts +1 -0
  59. package/dist/app/formatCodexMcpToolResult.d.ts +3 -0
  60. package/dist/app/formatCompactTokens.d.ts +1 -0
  61. package/dist/app/formatFileMention.d.ts +1 -0
  62. package/dist/app/formatProviderError.d.ts +6 -0
  63. package/dist/app/formatRelativeTime.d.ts +2 -0
  64. package/dist/app/formatResetDuration.d.ts +1 -0
  65. package/dist/app/formatSessionPickerEntry.d.ts +14 -0
  66. package/dist/app/formatSessionTokenStatus.d.ts +6 -0
  67. package/dist/app/formatSessionUsageSummary.d.ts +3 -0
  68. package/dist/app/formatStartupStatusUsageRemaining.d.ts +2 -0
  69. package/dist/app/formatStartupStatusUsageRows.d.ts +2 -0
  70. package/dist/app/formatSubagentToolCall.d.ts +10 -0
  71. package/dist/app/formatToolPermissionNotice.d.ts +3 -0
  72. package/dist/app/formatToolResultForDisplay.d.ts +2 -0
  73. package/dist/app/formatTurnUsageSummary.d.ts +2 -0
  74. package/dist/app/formatWorkUsageSummary.d.ts +14 -0
  75. package/dist/app/highlightAgentCode.d.ts +1 -0
  76. package/dist/app/highlightCodexDiffLine.d.ts +2 -0
  77. package/dist/app/highlightShellCommand.d.ts +1 -0
  78. package/dist/app/humanizeGoalStatus.d.ts +2 -0
  79. package/dist/app/humanizeMcpName.d.ts +1 -0
  80. package/dist/app/humanizePermissionMode.d.ts +2 -0
  81. package/dist/app/humanizePermissionReviewLevel.d.ts +2 -0
  82. package/dist/app/humanizeProviderId.d.ts +1 -0
  83. package/dist/app/humanizeReasoningLevel.d.ts +1 -0
  84. package/dist/app/humanizeSubagentStatus.d.ts +2 -0
  85. package/dist/app/humanizeToolName.d.ts +1 -0
  86. package/dist/app/humanizeWorkflowStatus.d.ts +2 -0
  87. package/dist/app/installResumeInstructions.d.ts +26 -0
  88. package/dist/app/installTerminalCrashCleanup.d.ts +26 -0
  89. package/dist/app/isLightTerminalBackground.d.ts +2 -0
  90. package/dist/app/layoutCodexFileDiff.d.ts +13 -0
  91. package/dist/app/looksLikeAuthenticationFailure.d.ts +5 -0
  92. package/dist/app/nearestXtermColorIndex.d.ts +2 -0
  93. package/dist/app/parseCodexMcpToolInvocation.d.ts +2 -0
  94. package/dist/app/parseSessionCommand.d.ts +6 -0
  95. package/dist/app/providerErrorResetAt.d.ts +2 -0
  96. package/dist/app/providerQuotaToStartupStatusUsage.d.ts +3 -0
  97. package/dist/app/readClipboardImage.d.ts +9 -0
  98. package/dist/app/renderActivityWave.d.ts +3 -0
  99. package/dist/app/renderAgentMarkdown.d.ts +8 -0
  100. package/dist/app/renderBackgroundTerminalCompletion.d.ts +1 -0
  101. package/dist/app/renderBackgroundTerminalInteraction.d.ts +2 -0
  102. package/dist/app/renderBackgroundTerminalSummary.d.ts +1 -0
  103. package/dist/app/renderChildRows.d.ts +13 -0
  104. package/dist/app/renderCodexDiffLine.d.ts +3 -0
  105. package/dist/app/renderCodexFileDiff.d.ts +7 -0
  106. package/dist/app/renderCodexMcpToolCall.d.ts +2 -0
  107. package/dist/app/renderCompletedTurnStats.d.ts +2 -0
  108. package/dist/app/renderExecCommand.d.ts +11 -0
  109. package/dist/app/renderExploration.d.ts +9 -0
  110. package/dist/app/renderFullscreenComponent.d.ts +8 -0
  111. package/dist/app/renderHappyTerminalBanner.d.ts +6 -0
  112. package/dist/app/renderHappyTerminalVersion.d.ts +1 -0
  113. package/dist/app/renderNoticeWithChildren.d.ts +7 -0
  114. package/dist/app/renderPendingSteeringMessages.d.ts +1 -0
  115. package/dist/app/renderStartupStatusCard.d.ts +7 -0
  116. package/dist/app/renderSubagentSummary.d.ts +6 -0
  117. package/dist/app/renderTurnCompletionSeparator.d.ts +1 -0
  118. package/dist/app/renderWorkflowSummary.d.ts +1 -0
  119. package/dist/app/resolveInputBackground.d.ts +3 -0
  120. package/dist/app/resolveStartupProviderQuota.d.ts +3 -0
  121. package/dist/app/resolveStartupSessionId.d.ts +18 -0
  122. package/dist/app/resolveTerminalColorLevel.d.ts +2 -0
  123. package/dist/app/resolveTerminalStyle.d.ts +1 -0
  124. package/dist/app/resolveTerminalTheme.d.ts +5 -0
  125. package/dist/app/runApp.d.ts +27 -0
  126. package/dist/app/runClipboardCommand.d.ts +8 -0
  127. package/dist/app/sanitizeTerminalText.d.ts +1 -0
  128. package/dist/app/shortenHomePath.d.ts +2 -0
  129. package/dist/app/sortSubagentsForDisplay.d.ts +2 -0
  130. package/dist/app/subagentElapsedMs.d.ts +2 -0
  131. package/dist/app/subagentLogMessageText.d.ts +2 -0
  132. package/dist/app/surfaceThemedLine.d.ts +3 -0
  133. package/dist/app/truncatePathToWidth.d.ts +1 -0
  134. package/dist/app/truncateTextForDisplay.d.ts +5 -0
  135. package/dist/app/truncateUtf8BytesForDisplay.d.ts +1 -0
  136. package/dist/app/upsertSubagentSummary.d.ts +2 -0
  137. package/dist/app/workflowDisplay.d.ts +2 -0
  138. package/dist/client/HappyAgentEventHub.d.ts +25 -0
  139. package/dist/client/RemoteAgent.d.ts +74 -0
  140. package/dist/client/RemoteAgentRunError.d.ts +4 -0
  141. package/dist/client/RemoteTerminalAttachment.d.ts +19 -0
  142. package/dist/client/RemoteTerminalClientReplica.d.ts +14 -0
  143. package/dist/client/ensureLocalProtocolServer.d.ts +10 -0
  144. package/dist/client/fetchProviderQuotas.d.ts +10 -0
  145. package/dist/client/index.d.ts +8 -0
  146. package/dist/client/loadAgentCatalog.d.ts +32 -0
  147. package/dist/config/createProjectConfigSecurityNotice.d.ts +10 -0
  148. package/dist/config/defaultConfig.d.ts +2 -0
  149. package/dist/config/getDefaultGlobalConfigPath.d.ts +1 -0
  150. package/dist/config/getDefaultLocalConfigPath.d.ts +1 -0
  151. package/dist/config/getDefaultRuntimeConfigPath.d.ts +1 -0
  152. package/dist/config/getHappyConfigDirectory.d.ts +1 -0
  153. package/dist/config/getHappyTerminalHome.d.ts +1 -0
  154. package/dist/config/index.d.ts +15 -0
  155. package/dist/config/loadConfig.d.ts +2 -0
  156. package/dist/config/mergeConfigValues.d.ts +2 -0
  157. package/dist/config/parseConfigToml.d.ts +7 -0
  158. package/dist/config/readConfigFile.d.ts +2 -0
  159. package/dist/config/readProjectConfigFile.d.ts +2 -0
  160. package/dist/config/resolveConfigPaths.d.ts +2 -0
  161. package/dist/config/runtimeConfigLock.d.ts +1 -0
  162. package/dist/config/types.d.ts +74 -0
  163. package/dist/config/updateRuntimeConfig.d.ts +2 -0
  164. package/dist/config/updateRuntimePreferences.d.ts +2 -0
  165. package/dist/config/withoutProjectMachineSettings.d.ts +7 -0
  166. package/dist/config/writeRuntimeConfig.d.ts +3 -0
  167. package/dist/config/writeRuntimeConfigDefaults.d.ts +2 -0
  168. package/dist/daemon/createUnixSocketFetch.d.ts +2 -0
  169. package/dist/daemon/daemonPid.d.ts +11 -0
  170. package/dist/daemon/ensureHappyAgentBinary.d.ts +15 -0
  171. package/dist/daemon/ensureLocalProtocolServer.d.ts +24 -0
  172. package/dist/daemon/getHappyDaemonPaths.d.ts +16 -0
  173. package/dist/daemon/happyAgentBinaryConfig.d.ts +15 -0
  174. package/dist/daemon/index.d.ts +5 -0
  175. package/dist/daemon/runDaemonCommand.d.ts +4 -0
  176. package/dist/debug/DebugLog.d.ts +11 -0
  177. package/dist/debug/closeNodeInspector.d.ts +1 -0
  178. package/dist/debug/createDebugJsonReplacer.d.ts +1 -0
  179. package/dist/debug/createRequestDebugDirectory.d.ts +1 -0
  180. package/dist/debug/getDebugRootDirectory.d.ts +1 -0
  181. package/dist/debug/getNodeInspectorUrl.d.ts +1 -0
  182. package/dist/debug/index.d.ts +8 -0
  183. package/dist/debug/openNodeInspector.d.ts +1 -0
  184. package/dist/debug/registerHappyTerminalDebugRoot.d.ts +5 -0
  185. package/dist/docs/DESIGN.md +2191 -0
  186. package/dist/docs/README.md +93 -0
  187. package/dist/docs/agents-and-collaboration.md +365 -0
  188. package/dist/docs/architecture.md +468 -0
  189. package/dist/docs/extending.md +561 -0
  190. package/dist/docs/happy.md +386 -0
  191. package/dist/docs/permissions-and-sandbox.md +342 -0
  192. package/dist/docs/workspaces.md +281 -0
  193. package/dist/errorToMessage.d.ts +1 -0
  194. package/dist/formatCliFailure.d.ts +10 -0
  195. package/dist/index.d.ts +3 -0
  196. package/dist/index.js +17151 -0
  197. package/dist/main.js +18946 -0
  198. package/dist/observability/daemonContext.d.ts +16 -0
  199. package/dist/observability/index.d.ts +1 -0
  200. package/dist/processes/BoundedOutputBuffer.d.ts +20 -0
  201. package/dist/processes/NativeProcessManager.d.ts +66 -0
  202. package/dist/processes/ProcessGroupReaper.d.ts +32 -0
  203. package/dist/processes/index.d.ts +7 -0
  204. package/dist/processes/isProcessRunning.d.ts +1 -0
  205. package/dist/processes/isTargetProcessAlive.d.ts +1 -0
  206. package/dist/processes/killProcessTree.d.ts +2 -0
  207. package/dist/processes/resolveSystemShell.d.ts +1 -0
  208. package/dist/processes/startProcessTransport.d.ts +33 -0
  209. package/dist/processes/types.d.ts +41 -0
  210. package/dist/processes/waitForProcessExit.d.ts +2 -0
  211. package/dist/protocol/AppletProtocol.d.ts +101 -0
  212. package/dist/protocol/Attachment.d.ts +96 -0
  213. package/dist/protocol/ClientProtocolTypes.d.ts +481 -0
  214. package/dist/protocol/DocumentProtocol.d.ts +109 -0
  215. package/dist/protocol/EventId.d.ts +1 -0
  216. package/dist/protocol/FolderProtocol.d.ts +236 -0
  217. package/dist/protocol/FolderSharingProtocol.d.ts +97 -0
  218. package/dist/protocol/GitHubPluginProtocol.d.ts +43 -0
  219. package/dist/protocol/GlobalSecurityProtocol.d.ts +7 -0
  220. package/dist/protocol/HappyCloudProtocol.d.ts +178 -0
  221. package/dist/protocol/InstallationProtocol.d.ts +80 -0
  222. package/dist/protocol/OnboardingProtocol.d.ts +47 -0
  223. package/dist/protocol/P2pCredentialProtocol.d.ts +273 -0
  224. package/dist/protocol/P2pIdentityProtocol.d.ts +8 -0
  225. package/dist/protocol/P2pPairingProtocol.d.ts +68 -0
  226. package/dist/protocol/P2pProtocol.d.ts +185 -0
  227. package/dist/protocol/PluginWireTypes.d.ts +81 -0
  228. package/dist/protocol/ProfileProtocol.d.ts +127 -0
  229. package/dist/protocol/ProjectFileProtocol.d.ts +63 -0
  230. package/dist/protocol/ProjectProtocol.d.ts +646 -0
  231. package/dist/protocol/ProtocolVersion.d.ts +8 -0
  232. package/dist/protocol/ServiceNotice.d.ts +175 -0
  233. package/dist/protocol/SessionProtocol.d.ts +1156 -0
  234. package/dist/protocol/SharingProtocol.d.ts +159 -0
  235. package/dist/protocol/SlotProtocol.d.ts +270 -0
  236. package/dist/protocol/TimelineProtocol.d.ts +88 -0
  237. package/dist/protocol/WorkletProtocol.d.ts +159 -0
  238. package/dist/protocol/createEventIdFactory.d.ts +7 -0
  239. package/dist/protocol/index.d.ts +34 -0
  240. package/dist/readPackageVersion.d.ts +1 -0
  241. package/dist/readPackageVersion.js +16 -0
  242. package/dist/reportCliFailure.d.ts +2 -0
  243. package/dist/runHappyTerminal.d.ts +6 -0
  244. package/dist/terminal/index.d.ts +2 -0
  245. package/dist/terminal/types.d.ts +39 -0
  246. package/dist/types.d.ts +6 -0
  247. package/dist/writeStderrSync.d.ts +5 -0
  248. package/package.json +97 -0
@@ -0,0 +1,646 @@
1
+ import type { HappyComputePreparationEvent, HappyComputePreparationPhase, HappyComputeProviderContribution, HappyPluginAppContribution, HappyPluginCategory } from "./PluginWireTypes.js";
2
+ import { type Static } from "@sinclair/typebox";
3
+ import type { EventId } from "./EventId.js";
4
+ import type { BaseSessionEvent, DaemonIdentity, ModelCatalog, SessionEvent, SessionSummary } from "./SessionProtocol.js";
5
+ import type { RemoteTerminalSummary } from "../terminal/types.js";
6
+ import type { SlotsChangedEvent } from "./SlotProtocol.js";
7
+ import type { AppletsChangedEvent } from "./AppletProtocol.js";
8
+ import type { WorkletsChangedEvent } from "./WorkletProtocol.js";
9
+ import type { Folder, FolderEvent, FolderItem } from "./FolderProtocol.js";
10
+ import type { DocumentEvent } from "./DocumentProtocol.js";
11
+ import type { HappyCloudChangedEvent } from "./HappyCloudProtocol.js";
12
+ import type { P2pStatusChangedEvent } from "./P2pProtocol.js";
13
+ import type { HappyAgentProfileChangedEvent } from "./ProfileProtocol.js";
14
+ import type { SharingChangedEvent } from "./SharingProtocol.js";
15
+ export type ProjectKind = "regular" | "home";
16
+ export type ProjectInitializationStatus = "initializing" | "ready" | "failed";
17
+ export type ProjectNameSource = "folder" | "git_remote" | "user";
18
+ export type ProjectAvatarSource = "repository" | "hosting" | "user";
19
+ export declare const projectRemoteSourceSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
20
+ kind: import("@sinclair/typebox").TLiteral<"github">;
21
+ repository: import("@sinclair/typebox").TString;
22
+ }>, import("@sinclair/typebox").TObject<{
23
+ kind: import("@sinclair/typebox").TLiteral<"git">;
24
+ url: import("@sinclair/typebox").TString;
25
+ }>]>;
26
+ export type ProjectRemoteSource = Static<typeof projectRemoteSourceSchema>;
27
+ export declare const projectGitSecretSchema: import("@sinclair/typebox").TObject<{
28
+ kind: import("@sinclair/typebox").TLiteral<"github">;
29
+ }>;
30
+ export type ProjectGitSecret = Static<typeof projectGitSecretSchema>;
31
+ export declare const projectCreatorSchema: import("@sinclair/typebox").TObject<{
32
+ instanceId: import("@sinclair/typebox").TString;
33
+ profileId: import("@sinclair/typebox").TString;
34
+ }>;
35
+ export type ProjectCreator = Static<typeof projectCreatorSchema>;
36
+ /** A folder-backed operation targets either a project root or one workspace inside it. */
37
+ export interface ProjectScope {
38
+ projectId: string;
39
+ workspaceId?: string;
40
+ }
41
+ /** Whether the directory backing a project or workspace still exists on disk. */
42
+ export type ProjectPresence = "present" | "missing";
43
+ /** Whether a managed workspace can be created from a project. */
44
+ export type ProjectWorktreeSupport = "supported" | "unsupported" | "unknown";
45
+ /** Slow-moving Git facts cached on a project or workspace row. */
46
+ export interface GitRepositoryFacts {
47
+ ahead: number;
48
+ behind: number;
49
+ branch?: string;
50
+ detached: boolean;
51
+ head?: string;
52
+ upstream?: string;
53
+ }
54
+ export type GitFileChangeStatus = "added" | "conflicted" | "copied" | "deleted" | "modified" | "renamed" | "submodule" | "type_changed" | "untracked";
55
+ export interface GitFileChange {
56
+ binary: boolean;
57
+ /**
58
+ * Opaque identity of this file's content, to be compared for equality against the one carried
59
+ * by an earlier snapshot. The same value means the bytes a client already fetched are still
60
+ * current; a different value means it should read the file again. It is the only per-file
61
+ * re-fetch signal there is: the snapshot's own version changes whenever anything in the
62
+ * repository does, and the line counts stay put across an edit that leaves them equal.
63
+ *
64
+ * It is never to be parsed, ordered, or read as a hash, a size, or a time — its shape is not
65
+ * part of this contract. A file the branch deleted has no content, which is itself an identity,
66
+ * and it holds steady until the file comes back.
67
+ *
68
+ * It describes what the scan can observe about a file rather than its bytes, so it cannot see a
69
+ * write that replaces a file with content of the same size within the same clock tick.
70
+ *
71
+ * Absent when the file could not be examined at all, which is not a claim that it is unchanged:
72
+ * a client that finds no identity should read the file again rather than keep what it holds.
73
+ */
74
+ contentToken?: string;
75
+ /** Absent for binary files, submodule pointers, and files a cap left uncounted. */
76
+ deletions?: number;
77
+ insertions?: number;
78
+ path: string;
79
+ /** Original path of a rename or copy. */
80
+ previousPath?: string;
81
+ staged: boolean;
82
+ status: GitFileChangeStatus;
83
+ unstaged: boolean;
84
+ }
85
+ export type GitComparisonState = "ready" | "unavailable";
86
+ /** Everything a change snapshot reports, before the tracker stamps it with an identity. */
87
+ export interface GitChangeState {
88
+ /** Commit the comparison is measured against. */
89
+ base?: string;
90
+ /** Total changed files, including any the list cap omitted. */
91
+ changedFiles: number;
92
+ comparison: GitComparisonState;
93
+ /** True while a merge or rebase is unresolved, so a client can suppress a misleading total. */
94
+ conflicted: boolean;
95
+ /** False when any cap or failure prevented exact line counting. */
96
+ countsExact: boolean;
97
+ deletions: number;
98
+ /** Human-readable explanation of a failed scan or an unavailable comparison. */
99
+ error?: string;
100
+ facts: GitRepositoryFacts;
101
+ files: readonly GitFileChange[];
102
+ filesTruncated: boolean;
103
+ insertions: number;
104
+ scannedAt: number;
105
+ }
106
+ export interface ProjectAvatar {
107
+ hash: string;
108
+ height: number;
109
+ mediaType: "image/webp";
110
+ source: ProjectAvatarSource;
111
+ url: string;
112
+ width: number;
113
+ }
114
+ export declare const projectWorkspaceComputeInputSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
115
+ type: import("@sinclair/typebox").TLiteral<"local">;
116
+ }>, import("@sinclair/typebox").TObject<{
117
+ image: import("@sinclair/typebox").TString;
118
+ type: import("@sinclair/typebox").TLiteral<"docker">;
119
+ }>]>;
120
+ export type ProjectWorkspaceComputeInput = Static<typeof projectWorkspaceComputeInputSchema>;
121
+ export declare const projectWorkspaceComputeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
122
+ generation: import("@sinclair/typebox").TInteger;
123
+ type: import("@sinclair/typebox").TLiteral<"local">;
124
+ }>, import("@sinclair/typebox").TObject<{
125
+ generation: import("@sinclair/typebox").TInteger;
126
+ image: import("@sinclair/typebox").TString;
127
+ type: import("@sinclair/typebox").TLiteral<"docker">;
128
+ }>]>;
129
+ export type ProjectWorkspaceCompute = Static<typeof projectWorkspaceComputeSchema>;
130
+ export declare const projectSettingsSchema: import("@sinclair/typebox").TObject<{
131
+ defaultWorkspaceCompute: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
132
+ generation: import("@sinclair/typebox").TInteger;
133
+ type: import("@sinclair/typebox").TLiteral<"local">;
134
+ }>, import("@sinclair/typebox").TObject<{
135
+ generation: import("@sinclair/typebox").TInteger;
136
+ image: import("@sinclair/typebox").TString;
137
+ type: import("@sinclair/typebox").TLiteral<"docker">;
138
+ }>]>>;
139
+ }>;
140
+ export type ProjectSettings = Static<typeof projectSettingsSchema>;
141
+ export declare const projectSettingsUpdateSchema: import("@sinclair/typebox").TObject<{
142
+ defaultWorkspaceCompute: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
143
+ type: import("@sinclair/typebox").TLiteral<"local">;
144
+ }>, import("@sinclair/typebox").TObject<{
145
+ image: import("@sinclair/typebox").TString;
146
+ type: import("@sinclair/typebox").TLiteral<"docker">;
147
+ }>]>>;
148
+ }>;
149
+ export type ProjectSettingsUpdate = Static<typeof projectSettingsUpdateSchema>;
150
+ export declare const updateProjectSettingsRequestSchema: import("@sinclair/typebox").TObject<{
151
+ defaultWorkspaceCompute: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
152
+ type: import("@sinclair/typebox").TLiteral<"local">;
153
+ }>, import("@sinclair/typebox").TObject<{
154
+ image: import("@sinclair/typebox").TString;
155
+ type: import("@sinclair/typebox").TLiteral<"docker">;
156
+ }>]>>;
157
+ mutationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
158
+ }>;
159
+ export type UpdateProjectSettingsRequest = Static<typeof updateProjectSettingsRequestSchema>;
160
+ export interface Project {
161
+ archivedAt?: number;
162
+ avatar?: ProjectAvatar;
163
+ avatarBuiltin?: "home";
164
+ createdAt: number;
165
+ createdBy?: ProjectCreator;
166
+ /** Branch new workspaces are cut from, decided once when the project was added. */
167
+ defaultBranch?: string;
168
+ git?: GitRepositoryFacts;
169
+ id: string;
170
+ initializationAttempt: number;
171
+ initializationError?: string;
172
+ initializationStatus: ProjectInitializationStatus;
173
+ kind: ProjectKind;
174
+ name: string;
175
+ nameSource: ProjectNameSource;
176
+ orderKey: string;
177
+ path: string;
178
+ presence: ProjectPresence;
179
+ /** Remote repository Happy Terminal manages in this project's fixed folder. */
180
+ remoteSource?: ProjectRemoteSource;
181
+ /** Credential kind needed to retry the clone. Secret material is never persisted. */
182
+ requiredSecretKind?: "github";
183
+ settings: ProjectSettings;
184
+ storageKey: string;
185
+ updatedAt: number;
186
+ version: number;
187
+ worktreeSupport: ProjectWorktreeSupport;
188
+ /** Human-readable explanation, present only when worktreeSupport is "unsupported". */
189
+ worktreeSupportReason?: string;
190
+ }
191
+ export type ProjectWorkspaceKind = "git_worktree";
192
+ export type ProjectWorkspaceStatus = "initializing" | "ready" | "failed" | "archiving" | "archived";
193
+ /** Maximum human-readable failure detail persisted and sent for one project or workspace. */
194
+ export declare const PROJECT_ERROR_MAX_LENGTH = 500;
195
+ export interface ProjectWorkspace {
196
+ archivedAt?: number;
197
+ /** Immutable commit the workspace was created from; the anchor for its comparison base. */
198
+ baseCommit?: string;
199
+ baseRef?: string;
200
+ /** Branch Happy Terminal manages for this worktree; it follows the workspace name. */
201
+ branch: string;
202
+ createdAt: number;
203
+ /** Human profile that owns this remote workspace. */
204
+ createdBy?: ProjectCreator;
205
+ error?: string;
206
+ git?: GitRepositoryFacts;
207
+ gitCommonDir: string;
208
+ id: string;
209
+ kind: ProjectWorkspaceKind;
210
+ name: string;
211
+ orderKey: string;
212
+ path: string;
213
+ presence: ProjectPresence;
214
+ projectId: string;
215
+ status: ProjectWorkspaceStatus;
216
+ storageKey: string;
217
+ updatedAt: number;
218
+ version: number;
219
+ }
220
+ export interface CreateProjectWorkspaceRequest {
221
+ /** Explicit base to fork; the project's trunk on `origin` is used when it is absent. */
222
+ baseRef?: string;
223
+ /** Client-chosen cuid2 identity. Repeating it returns the same workspace. */
224
+ id?: string;
225
+ /** Human profile that owns the workspace. Required for remote creation. */
226
+ identity?: string;
227
+ name: string;
228
+ /** Whether `name` was chosen deliberately, which keeps the first chat from replacing it. */
229
+ nameConfigured?: boolean;
230
+ /** Credential kind to share temporarily with a remote Happy Terminal. */
231
+ secret?: ProjectGitSecret;
232
+ }
233
+ export declare const registerProjectRequestSchema: import("@sinclair/typebox").TObject<{
234
+ path: import("@sinclair/typebox").TString;
235
+ projectId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
236
+ }>;
237
+ export type RegisterProjectRequest = Static<typeof registerProjectRequestSchema>;
238
+ export declare const createRemoteProjectRequestSchema: import("@sinclair/typebox").TObject<{
239
+ identity: import("@sinclair/typebox").TString;
240
+ name: import("@sinclair/typebox").TString;
241
+ projectId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
242
+ secret: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
243
+ kind: import("@sinclair/typebox").TLiteral<"github">;
244
+ }>>;
245
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
246
+ kind: import("@sinclair/typebox").TLiteral<"github">;
247
+ repository: import("@sinclair/typebox").TString;
248
+ }>, import("@sinclair/typebox").TObject<{
249
+ kind: import("@sinclair/typebox").TLiteral<"git">;
250
+ url: import("@sinclair/typebox").TString;
251
+ }>]>;
252
+ }>;
253
+ export type CreateRemoteProjectRequest = Static<typeof createRemoteProjectRequestSchema>;
254
+ export declare const projectRegistrationErrorCodeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"invalid_request">, import("@sinclair/typebox").TLiteral<"path_missing">, import("@sinclair/typebox").TLiteral<"not_directory">, import("@sinclair/typebox").TLiteral<"path_inaccessible">, import("@sinclair/typebox").TLiteral<"not_git_repository">, import("@sinclair/typebox").TLiteral<"not_git_top_level">, import("@sinclair/typebox").TLiteral<"project_id_conflict">, import("@sinclair/typebox").TLiteral<"project_path_conflict">, import("@sinclair/typebox").TLiteral<"secret_unavailable">, import("@sinclair/typebox").TLiteral<"unsupported_git_source">, import("@sinclair/typebox").TLiteral<"managed_workspace_unavailable">]>;
255
+ export type ProjectRegistrationErrorCode = Static<typeof projectRegistrationErrorCodeSchema>;
256
+ export declare const projectRegistrationErrorResponseSchema: import("@sinclair/typebox").TObject<{
257
+ error: import("@sinclair/typebox").TObject<{
258
+ code: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"invalid_request">, import("@sinclair/typebox").TLiteral<"path_missing">, import("@sinclair/typebox").TLiteral<"not_directory">, import("@sinclair/typebox").TLiteral<"path_inaccessible">, import("@sinclair/typebox").TLiteral<"not_git_repository">, import("@sinclair/typebox").TLiteral<"not_git_top_level">, import("@sinclair/typebox").TLiteral<"project_id_conflict">, import("@sinclair/typebox").TLiteral<"project_path_conflict">, import("@sinclair/typebox").TLiteral<"secret_unavailable">, import("@sinclair/typebox").TLiteral<"unsupported_git_source">, import("@sinclair/typebox").TLiteral<"managed_workspace_unavailable">]>;
259
+ message: import("@sinclair/typebox").TString;
260
+ }>;
261
+ }>;
262
+ export type ProjectRegistrationErrorResponse = Static<typeof projectRegistrationErrorResponseSchema>;
263
+ export interface RenameProjectRequest {
264
+ mutationId?: string;
265
+ name: string;
266
+ }
267
+ export interface RenameProjectWorkspaceRequest {
268
+ mutationId?: string;
269
+ name: string;
270
+ }
271
+ export interface ReorderRequest {
272
+ afterId: string | null;
273
+ }
274
+ export interface ListProjectsResponse {
275
+ projects: readonly Project[];
276
+ }
277
+ export interface ProjectResponse {
278
+ project: Project;
279
+ }
280
+ export interface GitStateResponse {
281
+ git: GitChangeSnapshot;
282
+ }
283
+ export interface ListProjectWorkspacesResponse {
284
+ workspaces: readonly ProjectWorkspace[];
285
+ }
286
+ export interface ProjectWorkspaceResponse {
287
+ workspace: ProjectWorkspace;
288
+ }
289
+ export interface GitWatchRequest {
290
+ entities: readonly {
291
+ projectId: string;
292
+ workspaceId?: string;
293
+ }[];
294
+ }
295
+ export interface GitWatchResponse {
296
+ snapshots: readonly GlobalLiveEvent[];
297
+ }
298
+ export interface BaseProjectEvent<TType extends string, TData> {
299
+ createdAt: number;
300
+ data: TData;
301
+ id: EventId;
302
+ projectId: string;
303
+ type: TType;
304
+ }
305
+ export interface BaseProjectWorkspaceEvent<TType extends string, TData> {
306
+ createdAt: number;
307
+ data: TData;
308
+ id: EventId;
309
+ projectId: string;
310
+ type: TType;
311
+ workspaceId: string;
312
+ }
313
+ export type ProjectEvent = BaseProjectEvent<"project_created", {
314
+ mutationId?: string;
315
+ project: Project;
316
+ }> | BaseProjectEvent<"project_updated", {
317
+ mutationId?: string;
318
+ project: Project;
319
+ }>;
320
+ export type ProjectWorkspaceEvent = BaseProjectWorkspaceEvent<"workspace_created", {
321
+ mutationId?: string;
322
+ workspace: ProjectWorkspace;
323
+ }> | BaseProjectWorkspaceEvent<"workspace_updated", {
324
+ mutationId?: string;
325
+ workspace: ProjectWorkspace;
326
+ }>;
327
+ /**
328
+ * Git change snapshots, carrying the detail that is recomputed from disk on demand.
329
+ *
330
+ * These are live-only: delivered to current subscribers, never stored, and never advancing a
331
+ * cursor. Persisting them would grow the durable log without adding recoverable information, since
332
+ * one bounded scan reproduces them exactly. The durable half of Git state — branch, HEAD, upstream,
333
+ * presence — rides on `project_updated` and `workspace_updated` instead.
334
+ */
335
+ export type ProjectGitEvent = BaseProjectEvent<"project_git_changed", {
336
+ git: GitChangeSnapshot;
337
+ }>;
338
+ export type ProjectWorkspaceGitEvent = BaseProjectWorkspaceEvent<"workspace_git_changed", {
339
+ git: GitChangeSnapshot;
340
+ }>;
341
+ export interface GitChangeSnapshot extends GitChangeState {
342
+ /** Identity of the daemon run, so a client can tell a restart from an update. */
343
+ generation: string;
344
+ /** Monotonic within one generation; survives eviction so a client never regresses. */
345
+ version: number;
346
+ }
347
+ export type RemoteTerminalsChangedEvent = BaseProjectEvent<"remote_terminals_changed", {
348
+ terminals: readonly RemoteTerminalSummary[];
349
+ }> | BaseProjectWorkspaceEvent<"remote_terminals_changed", {
350
+ terminals: readonly RemoteTerminalSummary[];
351
+ }>;
352
+ export type SessionCurrentEvent = BaseSessionEvent<"session_current", {
353
+ session: SessionSummary;
354
+ }>;
355
+ export interface RemoteTerminalGroupState {
356
+ projectId: string;
357
+ workspaceId?: string;
358
+ terminals: readonly RemoteTerminalSummary[];
359
+ }
360
+ /** One presence state the user can be in. */
361
+ export interface PresenceSummary {
362
+ /** How long a question may wait for an answer. `null` waits indefinitely, `0` never waits. */
363
+ answerWaitMs: number | null;
364
+ emoji: string;
365
+ id: string;
366
+ prompt: string;
367
+ title: string;
368
+ }
369
+ /** Where the user is right now, and everything they can switch to. */
370
+ export interface PresenceSnapshot {
371
+ /** When the current presence expires and the fallback takes over, when that is known. */
372
+ changesAt?: number;
373
+ fallbackPresenceId?: string;
374
+ presence: PresenceSummary;
375
+ presences: readonly PresenceSummary[];
376
+ since: number;
377
+ }
378
+ /**
379
+ * The user switched presence. It is live-only: presence says where the user is now, and a client
380
+ * that reconnects reads the current state from the catalog rather than replaying old switches.
381
+ */
382
+ export interface PresenceChangedEvent {
383
+ createdAt: number;
384
+ data: {
385
+ presence: PresenceSnapshot;
386
+ };
387
+ id: EventId;
388
+ type: "presence_changed";
389
+ }
390
+ export interface SetPresenceRequestBody {
391
+ fallbackPresenceId?: string;
392
+ presenceId: string;
393
+ /** Expiry in milliseconds since the epoch. Omitted keeps the presence until it is changed. */
394
+ until?: number;
395
+ }
396
+ /** One plugin installed on this machine, as a client should show it. */
397
+ export interface PluginSummary {
398
+ /** Running local MCP Apps, ordered exactly as a navigation host should present them. */
399
+ apps: readonly HappyPluginAppContribution[];
400
+ /** The bounded human-readable publisher/author label from the manifest. */
401
+ author: string;
402
+ /** The one catalog section chosen by the plugin author. */
403
+ category: HappyPluginCategory;
404
+ /** The live compute contribution from this plugin process, when attached. */
405
+ compute?: HappyComputeProviderContribution;
406
+ /** The folder the plugin writes to, which the user can open. */
407
+ dataDirectory: string;
408
+ description: string;
409
+ /** Where Happy Terminal installed the plugin's code. */
410
+ directory: string;
411
+ folder: string;
412
+ /** A private resource handle. It contains no filesystem location or credential. */
413
+ icon: {
414
+ /** SHA-256 identity of the validated icon bytes. */
415
+ generation: string;
416
+ mediaType: "image/png";
417
+ size: number;
418
+ };
419
+ /** Why the current plugin generation is or is not available. */
420
+ status: "failed" | "running" | "stopped";
421
+ /** The plugin's own human-readable description of its current state. */
422
+ statusMessage?: string;
423
+ /** Present for a startup or process failure. */
424
+ error?: string;
425
+ /** Whether a bounded current-run log or startup diagnostic is available. */
426
+ logAvailable: boolean;
427
+ name: string;
428
+ /** The manifest version, normalized to 0.0.0 when the author omitted it. */
429
+ version: string;
430
+ }
431
+ /** One bounded snapshot of the current plugin generation's output. */
432
+ export interface PluginLogSnapshot {
433
+ /** Startup or exit reason when the current generation is unavailable. */
434
+ error?: string;
435
+ folder: string;
436
+ name: string;
437
+ source: "current_run" | "error";
438
+ status: PluginSummary["status"];
439
+ text: string;
440
+ truncated: boolean;
441
+ updatedAt: number;
442
+ }
443
+ export interface ListPluginsResponse {
444
+ /** The live-stream position read immediately before this catalog was assembled. */
445
+ cursor: EventId;
446
+ failures: readonly {
447
+ error: string;
448
+ folder: string;
449
+ }[];
450
+ plugins: readonly PluginSummary[];
451
+ /** Ordered identity of the exact catalog state in this response. */
452
+ version: EventId;
453
+ }
454
+ export interface PluginLogResponse {
455
+ log: PluginLogSnapshot;
456
+ }
457
+ export declare const pluginInstallClassificationSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"fresh-install">, import("@sinclair/typebox").TLiteral<"upgrade">, import("@sinclair/typebox").TLiteral<"downgrade">, import("@sinclair/typebox").TLiteral<"reinstall">]>;
458
+ export type PluginInstallClassification = Static<typeof pluginInstallClassificationSchema>;
459
+ export declare const discoverPluginCatalogRequestSchema: import("@sinclair/typebox").TObject<{
460
+ ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
461
+ repository: import("@sinclair/typebox").TString;
462
+ }>;
463
+ export type DiscoverPluginCatalogRequest = Static<typeof discoverPluginCatalogRequestSchema>;
464
+ export declare const discoverPluginCatalogResponseSchema: import("@sinclair/typebox").TObject<{
465
+ catalogId: import("@sinclair/typebox").TString;
466
+ plugins: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
467
+ availability: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"not-installed">, import("@sinclair/typebox").TLiteral<"update-available">, import("@sinclair/typebox").TLiteral<"downgrade-available">, import("@sinclair/typebox").TLiteral<"reinstall-available">]>;
468
+ description: import("@sinclair/typebox").TString;
469
+ displayName: import("@sinclair/typebox").TString;
470
+ name: import("@sinclair/typebox").TString;
471
+ source: import("@sinclair/typebox").TObject<{
472
+ catalogId: import("@sinclair/typebox").TString;
473
+ plugin: import("@sinclair/typebox").TObject<{
474
+ description: import("@sinclair/typebox").TString;
475
+ displayName: import("@sinclair/typebox").TString;
476
+ name: import("@sinclair/typebox").TString;
477
+ path: import("@sinclair/typebox").TString;
478
+ version: import("@sinclair/typebox").TString;
479
+ }>;
480
+ ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
481
+ repository: import("@sinclair/typebox").TString;
482
+ revision: import("@sinclair/typebox").TString;
483
+ type: import("@sinclair/typebox").TLiteral<"github">;
484
+ }>;
485
+ version: import("@sinclair/typebox").TString;
486
+ }>>;
487
+ ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
488
+ repository: import("@sinclair/typebox").TString;
489
+ revision: import("@sinclair/typebox").TString;
490
+ }>;
491
+ export type DiscoverPluginCatalogResponse = Static<typeof discoverPluginCatalogResponseSchema>;
492
+ export declare const pluginInstallSourceSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
493
+ sourceDirectory: import("@sinclair/typebox").TString;
494
+ type: import("@sinclair/typebox").TLiteral<"local-directory">;
495
+ }>, import("@sinclair/typebox").TObject<{
496
+ catalogId: import("@sinclair/typebox").TString;
497
+ plugin: import("@sinclair/typebox").TObject<{
498
+ description: import("@sinclair/typebox").TString;
499
+ displayName: import("@sinclair/typebox").TString;
500
+ name: import("@sinclair/typebox").TString;
501
+ path: import("@sinclair/typebox").TString;
502
+ version: import("@sinclair/typebox").TString;
503
+ }>;
504
+ ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
505
+ repository: import("@sinclair/typebox").TString;
506
+ revision: import("@sinclair/typebox").TString;
507
+ type: import("@sinclair/typebox").TLiteral<"github">;
508
+ }>]>;
509
+ export type PluginInstallSource = Static<typeof pluginInstallSourceSchema>;
510
+ export declare const installPluginRequestSchema: import("@sinclair/typebox").TObject<{
511
+ requestId: import("@sinclair/typebox").TString;
512
+ source: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
513
+ sourceDirectory: import("@sinclair/typebox").TString;
514
+ type: import("@sinclair/typebox").TLiteral<"local-directory">;
515
+ }>, import("@sinclair/typebox").TObject<{
516
+ catalogId: import("@sinclair/typebox").TString;
517
+ plugin: import("@sinclair/typebox").TObject<{
518
+ description: import("@sinclair/typebox").TString;
519
+ displayName: import("@sinclair/typebox").TString;
520
+ name: import("@sinclair/typebox").TString;
521
+ path: import("@sinclair/typebox").TString;
522
+ version: import("@sinclair/typebox").TString;
523
+ }>;
524
+ ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
525
+ repository: import("@sinclair/typebox").TString;
526
+ revision: import("@sinclair/typebox").TString;
527
+ type: import("@sinclair/typebox").TLiteral<"github">;
528
+ }>]>;
529
+ }>;
530
+ export type InstallPluginRequest = Static<typeof installPluginRequestSchema>;
531
+ export interface InstalledPluginSummary {
532
+ classification: PluginInstallClassification;
533
+ description: string;
534
+ directory: string;
535
+ folder: string;
536
+ name: string;
537
+ version: string;
538
+ }
539
+ export interface UninstalledPluginSummary {
540
+ dataDirectory: string;
541
+ folder: string;
542
+ name: string;
543
+ }
544
+ export interface InstallPluginResponse {
545
+ plugin: InstalledPluginSummary;
546
+ }
547
+ export interface UninstallPluginResponse {
548
+ plugin: UninstalledPluginSummary;
549
+ }
550
+ export type PluginManagementErrorCode = "catalog_invalid" | "catalog_not_found" | "install_failed" | "invalid_request" | "plugin_not_found" | "plugins_unavailable" | "repository_not_found" | "source_changed" | "source_unavailable" | "uninstall_failed";
551
+ export interface PluginManagementErrorResponse {
552
+ error: {
553
+ code: PluginManagementErrorCode;
554
+ message: string;
555
+ };
556
+ }
557
+ /**
558
+ * The installed plugins changed, or one of them started or stopped. It is live-only and carries
559
+ * the whole current set: plugins are folders on disk, so a client that reconnects reads them again
560
+ * rather than replaying every past registration.
561
+ */
562
+ export interface PluginsChangedEvent {
563
+ createdAt: number;
564
+ data: {
565
+ failures: readonly {
566
+ error: string;
567
+ folder: string;
568
+ }[];
569
+ /**
570
+ * Best-effort metadata on the final catalog event for an installation. It may be absent
571
+ * when a concurrent catalog change supersedes that event before publication.
572
+ */
573
+ installation?: InstalledPluginSummary;
574
+ plugins: readonly PluginSummary[];
575
+ version: EventId;
576
+ };
577
+ id: EventId;
578
+ type: "plugins_changed";
579
+ }
580
+ export type ComputePreparationPhase = HappyComputePreparationPhase;
581
+ /** Durable compute materialization progress, also projected into attributed session timelines. */
582
+ export interface ComputePreparationEvent {
583
+ computeInstanceId: string;
584
+ createdAt: number;
585
+ data: Pick<HappyComputePreparationEvent, "elapsedMs" | "error" | "lastProgressAt" | "message" | "percent" | "phase" | "provider" | "startedAt" | "state">;
586
+ id: EventId;
587
+ type: "compute_preparation";
588
+ }
589
+ export type GlobalLiveEvent = HappyCloudChangedEvent | P2pStatusChangedEvent | HappyAgentProfileChangedEvent | SharingChangedEvent | PluginsChangedEvent | PresenceChangedEvent | SlotsChangedEvent | AppletsChangedEvent | WorkletsChangedEvent | ProjectGitEvent | ProjectWorkspaceGitEvent | RemoteTerminalsChangedEvent | SessionCurrentEvent | Extract<SessionEvent, {
590
+ type: "session_draft_changed";
591
+ }>;
592
+ export type GlobalEvent = ComputePreparationEvent | DocumentEvent | SessionEvent | FolderEvent | ProjectEvent | ProjectWorkspaceEvent | GlobalLiveEvent;
593
+ export interface GlobalEventQueueEntry {
594
+ cursor: string;
595
+ event: GlobalEvent;
596
+ }
597
+ /**
598
+ * A live delivery. It carries no cursor, so a client's `Last-Event-Id` keeps pointing at the last
599
+ * durable position and reconnecting never skips stored events.
600
+ */
601
+ export interface GlobalLiveEventDelivery {
602
+ event: GlobalLiveEvent;
603
+ live: true;
604
+ }
605
+ export type GlobalEventDelivery = GlobalEventQueueEntry | GlobalLiveEventDelivery;
606
+ export declare function isLiveGlobalEvent(event: GlobalEvent): event is GlobalLiveEvent;
607
+ export interface ListGlobalEventsResponse {
608
+ events: readonly GlobalEventQueueEntry[];
609
+ }
610
+ /**
611
+ * The catalog snapshot a client loads from `GET /catalog`.
612
+ *
613
+ * It carries the group state a client needs to render immediately — the
614
+ * projects, the workspaces inside them, and the sessions they contain — taken
615
+ * at one point in the event stream, so a client can open the live stream first
616
+ * and rebase this snapshot onto whatever arrived while it was loading.
617
+ *
618
+ * Git snapshots are deliberately absent. They are live-only, and a client
619
+ * declares the entities it cares about with `POST /git/watch`, which answers
620
+ * with their current snapshots.
621
+ */
622
+ export interface GlobalStreamHello {
623
+ /** The queue position this snapshot reflects; events after it follow on the stream. */
624
+ cursor: string;
625
+ catalog: ModelCatalog;
626
+ /** The whole folder tree; virtual nesting is carried by each folder's parent. */
627
+ folders: readonly Folder[];
628
+ folderItems: readonly FolderItem[];
629
+ identity: DaemonIdentity;
630
+ /** Where the user is right now, and every presence they can switch to. */
631
+ presence: PresenceSnapshot;
632
+ protocolVersion: number;
633
+ projects: readonly Project[];
634
+ terminalGroups: readonly RemoteTerminalGroupState[];
635
+ workspaces: readonly ProjectWorkspace[];
636
+ sessions: readonly SessionSummary[];
637
+ /** False when the daemon holds more sessions than this frame carried. */
638
+ sessionsComplete: boolean;
639
+ }
640
+ export interface TrimGlobalEventsRequest {
641
+ through: string;
642
+ }
643
+ export interface TrimGlobalEventsResponse {
644
+ trimmed: number;
645
+ through: string;
646
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Version of the HTTP/SSE contract spoken by this daemon.
3
+ *
4
+ * This is deliberately independent of the Happy Terminal package version: a release may
5
+ * change without changing the wire contract, while an incompatible protocol
6
+ * change must advance this number.
7
+ */
8
+ export declare const HAPPY_TERMINAL_PROTOCOL_VERSION = 17;