@allternit/gizzi-code 1.0.0 → 1.0.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.
Files changed (158) hide show
  1. package/bin/gizzi +4 -0
  2. package/bin/gizzi-ink +5 -0
  3. package/package.json +137 -31
  4. package/src/Tool.ts +26 -0
  5. package/src/bootstrap/state.ts +165 -322
  6. package/src/commands.ts +209 -0
  7. package/src/context/QueuedMessageContext.tsx +63 -0
  8. package/src/context/fpsMetrics.tsx +30 -0
  9. package/src/context/mailbox.tsx +38 -0
  10. package/src/context/modalContext.tsx +58 -0
  11. package/src/context/notifications.tsx +240 -0
  12. package/src/context/overlayContext.tsx +151 -0
  13. package/src/context/promptOverlayContext.tsx +125 -0
  14. package/src/context/stats.tsx +220 -0
  15. package/src/context/voice.tsx +88 -0
  16. package/src/hooks/useCanUseTool.ts +11 -0
  17. package/src/hooks/useExitOnCtrlCD.ts +40 -187
  18. package/src/hooks/useExitOnCtrlCDWithKeybindings.ts +68 -0
  19. package/src/hooks/useKeybinding.ts +68 -209
  20. package/src/hooks/useTerminalSize.ts +31 -99
  21. package/src/hooks.ts +37 -0
  22. package/src/ink.ts +204 -0
  23. package/src/main.ts +7 -0
  24. package/src/types/command.ts +216 -0
  25. package/src/types/connectorText.ts +39 -0
  26. package/src/types/fileSuggestion.ts +15 -0
  27. package/src/types/generated/events_mono/claude_code/v1/claude_code_internal_event.ts +865 -0
  28. package/src/types/generated/events_mono/common/v1/auth.ts +100 -0
  29. package/src/types/generated/events_mono/growthbook/v1/growthbook_experiment_event.ts +223 -0
  30. package/src/types/generated/google/protobuf/timestamp.ts +187 -0
  31. package/src/types/hooks.ts +319 -0
  32. package/src/types/ids.ts +44 -0
  33. package/src/types/logs.ts +331 -0
  34. package/src/types/merged/index.ts +5 -0
  35. package/src/types/merged/message.ts +552 -0
  36. package/src/types/message.ts +927 -186
  37. package/src/types/messageQueueTypes.ts +21 -0
  38. package/src/types/notebook.ts +72 -0
  39. package/src/types/permissions.ts +447 -0
  40. package/src/types/plugin.ts +363 -0
  41. package/src/types/statusLine.ts +15 -0
  42. package/src/types/textInputTypes.ts +387 -0
  43. package/src/types/tools.ts +149 -0
  44. package/src/types/utils.ts +20 -0
  45. package/src/utils/advisor.ts +12 -0
  46. package/src/utils/api.ts +29 -0
  47. package/src/utils/array.ts +7 -0
  48. package/src/utils/attachments.ts +60 -0
  49. package/src/utils/auth.ts +3 -0
  50. package/src/utils/claudeInChrome/chromeNativeHost.ts +15 -0
  51. package/src/utils/claudeInChrome/common.ts +12 -0
  52. package/src/utils/claudeInChrome/mcpServer.ts +15 -0
  53. package/src/utils/computerUse/common.ts +19 -0
  54. package/src/utils/computerUse/mcpServer.ts +15 -0
  55. package/src/utils/config.ts +35 -0
  56. package/src/utils/context.ts +19 -0
  57. package/src/utils/cwd.ts +3 -0
  58. package/src/utils/debug.ts +3 -0
  59. package/src/utils/earlyInput.ts +7 -0
  60. package/src/utils/effort.ts +13 -0
  61. package/src/utils/embeddedTools.ts +12 -0
  62. package/src/utils/envUtils.ts +3 -0
  63. package/src/utils/errors.ts +3 -0
  64. package/src/utils/execFileNoThrow.ts +24 -0
  65. package/src/utils/feature-flags.ts +112 -0
  66. package/src/utils/file.ts +3 -0
  67. package/src/utils/fileHistory.ts +17 -0
  68. package/src/utils/fingerprint.ts +7 -0
  69. package/src/utils/format.ts +75 -305
  70. package/src/utils/frontmatterParser.ts +33 -0
  71. package/src/utils/fsOperations.ts +31 -0
  72. package/src/utils/fullscreen.ts +40 -350
  73. package/src/utils/git.ts +15 -0
  74. package/src/utils/imageResizer.ts +30 -0
  75. package/src/utils/lazySchema.ts +9 -0
  76. package/src/utils/log.ts +3 -0
  77. package/src/utils/markdownConfigLoader.ts +12 -0
  78. package/src/utils/messages.ts +13 -0
  79. package/src/utils/migration.ts +137 -0
  80. package/src/utils/model/providers.ts +15 -0
  81. package/src/utils/path.ts +3 -0
  82. package/src/utils/permissions/PermissionResult.ts +14 -0
  83. package/src/utils/permissions/autoModeState.ts +12 -0
  84. package/src/utils/permissions/filesystem.ts +12 -0
  85. package/src/utils/plugins/loadPluginOutputStyles.ts +12 -0
  86. package/src/utils/plugins/schemas.ts +25 -0
  87. package/src/utils/process.ts +16 -0
  88. package/src/utils/sandbox/sandbox-adapter.ts +19 -0
  89. package/src/utils/sessionStorage.ts +238 -472
  90. package/src/utils/settings/constants.ts +10 -0
  91. package/src/utils/settings/settings.ts +19 -0
  92. package/src/utils/settings/types.ts +18 -0
  93. package/src/utils/shell/shellToolUtils.ts +9 -0
  94. package/src/utils/sinks.ts +11 -0
  95. package/src/utils/sleep.ts +7 -0
  96. package/src/utils/sliceAnsi.ts +7 -0
  97. package/src/utils/slowOperations.ts +3 -0
  98. package/src/utils/startupProfiler.ts +11 -0
  99. package/src/utils/stringUtils.ts +106 -0
  100. package/src/utils/systemPromptType.ts +9 -0
  101. package/src/utils/teleport/api.ts +15 -0
  102. package/src/utils/textHighlighting.ts +16 -0
  103. package/src/utils/theme.ts +17 -0
  104. package/src/utils/thinking.ts +58 -0
  105. package/src/utils/tokens.ts +11 -0
  106. package/src/utils/toolResultStorage.ts +17 -0
  107. package/src/utils/worktreeModeEnabled.ts +7 -0
  108. package/WORKSPACE_INTEGRATION.md +0 -290
  109. package/chat-sessions/sessions-index.json +0 -98
  110. package/package.json.original +0 -31
  111. package/package.json.publish +0 -47
  112. package/src/bootstrap/state.d.ts +0 -169
  113. package/src/bootstrap/state.js +0 -261
  114. package/src/context/pack-builder.d.ts +0 -24
  115. package/src/context/pack-builder.js +0 -281
  116. package/src/hooks/useExitOnCtrlCD.d.ts +0 -86
  117. package/src/hooks/useExitOnCtrlCD.js +0 -130
  118. package/src/hooks/useKeybinding.d.ts +0 -89
  119. package/src/hooks/useKeybinding.js +0 -163
  120. package/src/hooks/useTerminalSize.d.ts +0 -41
  121. package/src/hooks/useTerminalSize.js +0 -90
  122. package/src/index.d.ts +0 -23
  123. package/src/index.js +0 -24
  124. package/src/runtime/brand/brand.d.ts +0 -488
  125. package/src/runtime/brand/brand.js +0 -464
  126. package/src/runtime/brand/brand.ts +0 -667
  127. package/src/runtime/services/tokenEstimation.d.ts +0 -187
  128. package/src/runtime/services/tokenEstimation.js +0 -423
  129. package/src/runtime/services/tokenEstimation.ts +0 -547
  130. package/src/runtime/tools/Tool.d.ts +0 -239
  131. package/src/runtime/tools/Tool.js +0 -285
  132. package/src/runtime/tools/Tool.ts +0 -524
  133. package/src/scheduler/TaskScheduler.d.ts +0 -98
  134. package/src/scheduler/TaskScheduler.js +0 -201
  135. package/src/scheduler/TaskScheduler.ts +0 -259
  136. package/src/state/AppStateStore.d.ts +0 -347
  137. package/src/state/AppStateStore.js +0 -439
  138. package/src/state/AppStateStore.ts +0 -658
  139. package/src/state/WorkspaceStateStore.d.ts +0 -43
  140. package/src/state/WorkspaceStateStore.js +0 -224
  141. package/src/state/WorkspaceStateStore.ts +0 -297
  142. package/src/types/message.d.ts +0 -190
  143. package/src/types/message.js +0 -77
  144. package/src/utils/format.d.ts +0 -126
  145. package/src/utils/format.js +0 -230
  146. package/src/utils/fullscreen.d.ts +0 -161
  147. package/src/utils/fullscreen.js +0 -277
  148. package/src/utils/sessionStorage.d.ts +0 -210
  149. package/src/utils/sessionStorage.js +0 -435
  150. package/src/watcher/WorkspaceWatcher.d.ts +0 -70
  151. package/src/watcher/WorkspaceWatcher.js +0 -191
  152. package/src/watcher/WorkspaceWatcher.ts +0 -251
  153. package/src/workspace/loader.d.ts +0 -30
  154. package/src/workspace/loader.js +0 -117
  155. package/src/workspace/types.d.ts +0 -91
  156. package/src/workspace/types.js +0 -7
  157. package/threads/thread_1775361175022.json +0 -9
  158. package/tsconfig.json +0 -14
@@ -0,0 +1,865 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.6.1
4
+ // protoc unknown
5
+ // source: events_mono/claude_code/v1/claude_code_internal_event.proto
6
+
7
+ /* eslint-disable */
8
+ import { Timestamp } from '../../../google/protobuf/timestamp.js'
9
+ import { PublicApiAuth } from '../../common/v1/auth.js'
10
+
11
+ /** GitHubActionsMetadata contains GitHub Actions-specific environment information */
12
+ export interface GitHubActionsMetadata {
13
+ actor_id?: string | undefined
14
+ repository_id?: string | undefined
15
+ repository_owner_id?: string | undefined
16
+ }
17
+
18
+ /**
19
+ * EnvironmentMetadata contains environment and runtime information
20
+ * See claude-cli-internal/src/services/statsig.ts for the source of these fields
21
+ */
22
+ export interface EnvironmentMetadata {
23
+ platform?: string | undefined
24
+ node_version?: string | undefined
25
+ terminal?: string | undefined
26
+ package_managers?: string | undefined
27
+ runtimes?: string | undefined
28
+ is_running_with_bun?: boolean | undefined
29
+ is_ci?: boolean | undefined
30
+ is_claubbit?: boolean | undefined
31
+ is_github_action?: boolean | undefined
32
+ is_claude_code_action?: boolean | undefined
33
+ is_claude_ai_auth?: boolean | undefined
34
+ version?: string | undefined
35
+ /** GitHub Actions specific fields (only present when is_github_action is true) */
36
+ github_event_name?: string | undefined
37
+ github_actions_runner_environment?: string | undefined
38
+ github_actions_runner_os?: string | undefined
39
+ github_action_ref?: string | undefined
40
+ /** WSL specific field */
41
+ wsl_version?: string | undefined
42
+ /** GitHub metadata (only present when is_github_action is true) */
43
+ github_actions_metadata?: GitHubActionsMetadata | undefined
44
+ arch?: string | undefined
45
+ is_claude_code_remote?: boolean | undefined
46
+ remote_environment_type?: string | undefined
47
+ claude_code_container_id?: string | undefined
48
+ claude_code_remote_session_id?: string | undefined
49
+ tags?: string[] | undefined
50
+ deployment_environment?: string | undefined
51
+ is_conductor?: boolean | undefined
52
+ version_base?: string | undefined
53
+ coworker_type?: string | undefined
54
+ build_time?: string | undefined
55
+ is_local_agent_mode?: boolean | undefined
56
+ linux_distro_id?: string | undefined
57
+ linux_distro_version?: string | undefined
58
+ linux_kernel?: string | undefined
59
+ vcs?: string | undefined
60
+ platform_raw?: string | undefined
61
+ }
62
+
63
+ /**
64
+ * SlackContext contains context fields present on every Claude-in-Slack (CIS) event.
65
+ * Event-specific fields (errorType, durationMs, httpStatus, etc.) go in
66
+ * ClaudeCodeInternalEvent.additional_metadata as JSON.
67
+ */
68
+ export interface SlackContext {
69
+ slack_team_id?: string | undefined
70
+ is_enterprise_install?: boolean | undefined
71
+ trigger?: string | undefined
72
+ creation_method?: string | undefined
73
+ }
74
+
75
+ /**
76
+ * ClaudeCodeInternalEvent represents events logged from Gizzi via Statsig
77
+ * This schema matches the structure in claude-cli-internal/src/services/statsig.ts
78
+ * Source table: proj-product-data-nhme.raw_statsig_internal_tools.events
79
+ */
80
+ export interface ClaudeCodeInternalEvent {
81
+ /** Event name (e.g., "tengu_binary_feedback", "tengu_api_success") */
82
+ event_name?: string | undefined
83
+ /** Event timestamp */
84
+ client_timestamp?: Date | undefined
85
+ model?: string | undefined
86
+ session_id?: string | undefined
87
+ user_type?: string | undefined
88
+ betas?: string | undefined
89
+ /** Environment and runtime information */
90
+ env?: EnvironmentMetadata | undefined
91
+ entrypoint?: string | undefined
92
+ agent_sdk_version?: string | undefined
93
+ is_interactive?: boolean | undefined
94
+ client_type?: string | undefined
95
+ /**
96
+ * Process metrics as JSON string (ant-only)
97
+ * Contains: uptime, rss, heapTotal, heapUsed, external, arrayBuffers,
98
+ * constrainedMemory, cpuUsage
99
+ */
100
+ process?: string | undefined
101
+ /**
102
+ * Additional metadata passed to logEvent (event-specific)
103
+ * This includes fields like msg_id_A, msg_id_B, gitBranch, gitHead, etc.
104
+ * that vary per event type
105
+ */
106
+ additional_metadata?: string | undefined
107
+ /** Authentication context automatically injected by the API */
108
+ auth?: PublicApiAuth | undefined
109
+ /** Server timestamp automatically injected by the API */
110
+ server_timestamp?: Date | undefined
111
+ /** Unique identifier for this event (automatically generated by API endpoint) */
112
+ event_id?: string | undefined
113
+ /** Device identifier for the client */
114
+ device_id?: string | undefined
115
+ /** SWE-bench fields */
116
+ swe_bench_run_id?: string | undefined
117
+ swe_bench_instance_id?: string | undefined
118
+ swe_bench_task_id?: string | undefined
119
+ email?: string | undefined
120
+ /** Swarm/team agent identification for analytics attribution */
121
+ agent_id?: string | undefined
122
+ parent_session_id?: string | undefined
123
+ agent_type?: string | undefined
124
+ /** Claude-in-Slack context (only present for cis_* events) */
125
+ slack?: SlackContext | undefined
126
+ team_name?: string | undefined
127
+ skill_name?: string | undefined
128
+ plugin_name?: string | undefined
129
+ marketplace_name?: string | undefined
130
+ }
131
+
132
+ function createBaseGitHubActionsMetadata(): GitHubActionsMetadata {
133
+ return { actor_id: '', repository_id: '', repository_owner_id: '' }
134
+ }
135
+
136
+ export const GitHubActionsMetadata: MessageFns<GitHubActionsMetadata> = {
137
+ fromJSON(object: any): GitHubActionsMetadata {
138
+ return {
139
+ actor_id: isSet(object.actor_id)
140
+ ? globalThis.String(object.actor_id)
141
+ : '',
142
+ repository_id: isSet(object.repository_id)
143
+ ? globalThis.String(object.repository_id)
144
+ : '',
145
+ repository_owner_id: isSet(object.repository_owner_id)
146
+ ? globalThis.String(object.repository_owner_id)
147
+ : '',
148
+ }
149
+ },
150
+
151
+ toJSON(message: GitHubActionsMetadata): unknown {
152
+ const obj: any = {}
153
+ if (message.actor_id !== undefined) {
154
+ obj.actor_id = message.actor_id
155
+ }
156
+ if (message.repository_id !== undefined) {
157
+ obj.repository_id = message.repository_id
158
+ }
159
+ if (message.repository_owner_id !== undefined) {
160
+ obj.repository_owner_id = message.repository_owner_id
161
+ }
162
+ return obj
163
+ },
164
+
165
+ create<I extends Exact<DeepPartial<GitHubActionsMetadata>, I>>(
166
+ base?: I,
167
+ ): GitHubActionsMetadata {
168
+ return GitHubActionsMetadata.fromPartial(base ?? ({} as any))
169
+ },
170
+ fromPartial<I extends Exact<DeepPartial<GitHubActionsMetadata>, I>>(
171
+ object: I,
172
+ ): GitHubActionsMetadata {
173
+ const message = createBaseGitHubActionsMetadata()
174
+ message.actor_id = object.actor_id ?? ''
175
+ message.repository_id = object.repository_id ?? ''
176
+ message.repository_owner_id = object.repository_owner_id ?? ''
177
+ return message
178
+ },
179
+ }
180
+
181
+ function createBaseEnvironmentMetadata(): EnvironmentMetadata {
182
+ return {
183
+ platform: '',
184
+ node_version: '',
185
+ terminal: '',
186
+ package_managers: '',
187
+ runtimes: '',
188
+ is_running_with_bun: false,
189
+ is_ci: false,
190
+ is_claubbit: false,
191
+ is_github_action: false,
192
+ is_claude_code_action: false,
193
+ is_claude_ai_auth: false,
194
+ version: '',
195
+ github_event_name: '',
196
+ github_actions_runner_environment: '',
197
+ github_actions_runner_os: '',
198
+ github_action_ref: '',
199
+ wsl_version: '',
200
+ github_actions_metadata: undefined,
201
+ arch: '',
202
+ is_claude_code_remote: false,
203
+ remote_environment_type: '',
204
+ claude_code_container_id: '',
205
+ claude_code_remote_session_id: '',
206
+ tags: [],
207
+ deployment_environment: '',
208
+ is_conductor: false,
209
+ version_base: '',
210
+ coworker_type: '',
211
+ build_time: '',
212
+ is_local_agent_mode: false,
213
+ linux_distro_id: '',
214
+ linux_distro_version: '',
215
+ linux_kernel: '',
216
+ vcs: '',
217
+ platform_raw: '',
218
+ }
219
+ }
220
+
221
+ export const EnvironmentMetadata: MessageFns<EnvironmentMetadata> = {
222
+ fromJSON(object: any): EnvironmentMetadata {
223
+ return {
224
+ platform: isSet(object.platform)
225
+ ? globalThis.String(object.platform)
226
+ : '',
227
+ node_version: isSet(object.node_version)
228
+ ? globalThis.String(object.node_version)
229
+ : '',
230
+ terminal: isSet(object.terminal)
231
+ ? globalThis.String(object.terminal)
232
+ : '',
233
+ package_managers: isSet(object.package_managers)
234
+ ? globalThis.String(object.package_managers)
235
+ : '',
236
+ runtimes: isSet(object.runtimes)
237
+ ? globalThis.String(object.runtimes)
238
+ : '',
239
+ is_running_with_bun: isSet(object.is_running_with_bun)
240
+ ? globalThis.Boolean(object.is_running_with_bun)
241
+ : false,
242
+ is_ci: isSet(object.is_ci) ? globalThis.Boolean(object.is_ci) : false,
243
+ is_claubbit: isSet(object.is_claubbit)
244
+ ? globalThis.Boolean(object.is_claubbit)
245
+ : false,
246
+ is_github_action: isSet(object.is_github_action)
247
+ ? globalThis.Boolean(object.is_github_action)
248
+ : false,
249
+ is_claude_code_action: isSet(object.is_claude_code_action)
250
+ ? globalThis.Boolean(object.is_claude_code_action)
251
+ : false,
252
+ is_claude_ai_auth: isSet(object.is_claude_ai_auth)
253
+ ? globalThis.Boolean(object.is_claude_ai_auth)
254
+ : false,
255
+ version: isSet(object.version) ? globalThis.String(object.version) : '',
256
+ github_event_name: isSet(object.github_event_name)
257
+ ? globalThis.String(object.github_event_name)
258
+ : '',
259
+ github_actions_runner_environment: isSet(
260
+ object.github_actions_runner_environment,
261
+ )
262
+ ? globalThis.String(object.github_actions_runner_environment)
263
+ : '',
264
+ github_actions_runner_os: isSet(object.github_actions_runner_os)
265
+ ? globalThis.String(object.github_actions_runner_os)
266
+ : '',
267
+ github_action_ref: isSet(object.github_action_ref)
268
+ ? globalThis.String(object.github_action_ref)
269
+ : '',
270
+ wsl_version: isSet(object.wsl_version)
271
+ ? globalThis.String(object.wsl_version)
272
+ : '',
273
+ github_actions_metadata: isSet(object.github_actions_metadata)
274
+ ? GitHubActionsMetadata.fromJSON(object.github_actions_metadata)
275
+ : undefined,
276
+ arch: isSet(object.arch) ? globalThis.String(object.arch) : '',
277
+ is_claude_code_remote: isSet(object.is_claude_code_remote)
278
+ ? globalThis.Boolean(object.is_claude_code_remote)
279
+ : false,
280
+ remote_environment_type: isSet(object.remote_environment_type)
281
+ ? globalThis.String(object.remote_environment_type)
282
+ : '',
283
+ claude_code_container_id: isSet(object.claude_code_container_id)
284
+ ? globalThis.String(object.claude_code_container_id)
285
+ : '',
286
+ claude_code_remote_session_id: isSet(object.claude_code_remote_session_id)
287
+ ? globalThis.String(object.claude_code_remote_session_id)
288
+ : '',
289
+ tags: globalThis.Array.isArray(object?.tags)
290
+ ? object.tags.map((e: any) => globalThis.String(e))
291
+ : [],
292
+ deployment_environment: isSet(object.deployment_environment)
293
+ ? globalThis.String(object.deployment_environment)
294
+ : '',
295
+ is_conductor: isSet(object.is_conductor)
296
+ ? globalThis.Boolean(object.is_conductor)
297
+ : false,
298
+ version_base: isSet(object.version_base)
299
+ ? globalThis.String(object.version_base)
300
+ : '',
301
+ coworker_type: isSet(object.coworker_type)
302
+ ? globalThis.String(object.coworker_type)
303
+ : '',
304
+ build_time: isSet(object.build_time)
305
+ ? globalThis.String(object.build_time)
306
+ : '',
307
+ is_local_agent_mode: isSet(object.is_local_agent_mode)
308
+ ? globalThis.Boolean(object.is_local_agent_mode)
309
+ : false,
310
+ linux_distro_id: isSet(object.linux_distro_id)
311
+ ? globalThis.String(object.linux_distro_id)
312
+ : '',
313
+ linux_distro_version: isSet(object.linux_distro_version)
314
+ ? globalThis.String(object.linux_distro_version)
315
+ : '',
316
+ linux_kernel: isSet(object.linux_kernel)
317
+ ? globalThis.String(object.linux_kernel)
318
+ : '',
319
+ vcs: isSet(object.vcs) ? globalThis.String(object.vcs) : '',
320
+ platform_raw: isSet(object.platform_raw)
321
+ ? globalThis.String(object.platform_raw)
322
+ : '',
323
+ }
324
+ },
325
+
326
+ toJSON(message: EnvironmentMetadata): unknown {
327
+ const obj: any = {}
328
+ if (message.platform !== undefined) {
329
+ obj.platform = message.platform
330
+ }
331
+ if (message.node_version !== undefined) {
332
+ obj.node_version = message.node_version
333
+ }
334
+ if (message.terminal !== undefined) {
335
+ obj.terminal = message.terminal
336
+ }
337
+ if (message.package_managers !== undefined) {
338
+ obj.package_managers = message.package_managers
339
+ }
340
+ if (message.runtimes !== undefined) {
341
+ obj.runtimes = message.runtimes
342
+ }
343
+ if (message.is_running_with_bun !== undefined) {
344
+ obj.is_running_with_bun = message.is_running_with_bun
345
+ }
346
+ if (message.is_ci !== undefined) {
347
+ obj.is_ci = message.is_ci
348
+ }
349
+ if (message.is_claubbit !== undefined) {
350
+ obj.is_claubbit = message.is_claubbit
351
+ }
352
+ if (message.is_github_action !== undefined) {
353
+ obj.is_github_action = message.is_github_action
354
+ }
355
+ if (message.is_claude_code_action !== undefined) {
356
+ obj.is_claude_code_action = message.is_claude_code_action
357
+ }
358
+ if (message.is_claude_ai_auth !== undefined) {
359
+ obj.is_claude_ai_auth = message.is_claude_ai_auth
360
+ }
361
+ if (message.version !== undefined) {
362
+ obj.version = message.version
363
+ }
364
+ if (message.github_event_name !== undefined) {
365
+ obj.github_event_name = message.github_event_name
366
+ }
367
+ if (message.github_actions_runner_environment !== undefined) {
368
+ obj.github_actions_runner_environment =
369
+ message.github_actions_runner_environment
370
+ }
371
+ if (message.github_actions_runner_os !== undefined) {
372
+ obj.github_actions_runner_os = message.github_actions_runner_os
373
+ }
374
+ if (message.github_action_ref !== undefined) {
375
+ obj.github_action_ref = message.github_action_ref
376
+ }
377
+ if (message.wsl_version !== undefined) {
378
+ obj.wsl_version = message.wsl_version
379
+ }
380
+ if (message.github_actions_metadata !== undefined) {
381
+ obj.github_actions_metadata = GitHubActionsMetadata.toJSON(
382
+ message.github_actions_metadata,
383
+ )
384
+ }
385
+ if (message.arch !== undefined) {
386
+ obj.arch = message.arch
387
+ }
388
+ if (message.is_claude_code_remote !== undefined) {
389
+ obj.is_claude_code_remote = message.is_claude_code_remote
390
+ }
391
+ if (message.remote_environment_type !== undefined) {
392
+ obj.remote_environment_type = message.remote_environment_type
393
+ }
394
+ if (message.claude_code_container_id !== undefined) {
395
+ obj.claude_code_container_id = message.claude_code_container_id
396
+ }
397
+ if (message.claude_code_remote_session_id !== undefined) {
398
+ obj.claude_code_remote_session_id = message.claude_code_remote_session_id
399
+ }
400
+ if (message.tags?.length) {
401
+ obj.tags = message.tags
402
+ }
403
+ if (message.deployment_environment !== undefined) {
404
+ obj.deployment_environment = message.deployment_environment
405
+ }
406
+ if (message.is_conductor !== undefined) {
407
+ obj.is_conductor = message.is_conductor
408
+ }
409
+ if (message.version_base !== undefined) {
410
+ obj.version_base = message.version_base
411
+ }
412
+ if (message.coworker_type !== undefined) {
413
+ obj.coworker_type = message.coworker_type
414
+ }
415
+ if (message.build_time !== undefined) {
416
+ obj.build_time = message.build_time
417
+ }
418
+ if (message.is_local_agent_mode !== undefined) {
419
+ obj.is_local_agent_mode = message.is_local_agent_mode
420
+ }
421
+ if (message.linux_distro_id !== undefined) {
422
+ obj.linux_distro_id = message.linux_distro_id
423
+ }
424
+ if (message.linux_distro_version !== undefined) {
425
+ obj.linux_distro_version = message.linux_distro_version
426
+ }
427
+ if (message.linux_kernel !== undefined) {
428
+ obj.linux_kernel = message.linux_kernel
429
+ }
430
+ if (message.vcs !== undefined) {
431
+ obj.vcs = message.vcs
432
+ }
433
+ if (message.platform_raw !== undefined) {
434
+ obj.platform_raw = message.platform_raw
435
+ }
436
+ return obj
437
+ },
438
+
439
+ create<I extends Exact<DeepPartial<EnvironmentMetadata>, I>>(
440
+ base?: I,
441
+ ): EnvironmentMetadata {
442
+ return EnvironmentMetadata.fromPartial(base ?? ({} as any))
443
+ },
444
+ fromPartial<I extends Exact<DeepPartial<EnvironmentMetadata>, I>>(
445
+ object: I,
446
+ ): EnvironmentMetadata {
447
+ const message = createBaseEnvironmentMetadata()
448
+ message.platform = object.platform ?? ''
449
+ message.node_version = object.node_version ?? ''
450
+ message.terminal = object.terminal ?? ''
451
+ message.package_managers = object.package_managers ?? ''
452
+ message.runtimes = object.runtimes ?? ''
453
+ message.is_running_with_bun = object.is_running_with_bun ?? false
454
+ message.is_ci = object.is_ci ?? false
455
+ message.is_claubbit = object.is_claubbit ?? false
456
+ message.is_github_action = object.is_github_action ?? false
457
+ message.is_claude_code_action = object.is_claude_code_action ?? false
458
+ message.is_claude_ai_auth = object.is_claude_ai_auth ?? false
459
+ message.version = object.version ?? ''
460
+ message.github_event_name = object.github_event_name ?? ''
461
+ message.github_actions_runner_environment =
462
+ object.github_actions_runner_environment ?? ''
463
+ message.github_actions_runner_os = object.github_actions_runner_os ?? ''
464
+ message.github_action_ref = object.github_action_ref ?? ''
465
+ message.wsl_version = object.wsl_version ?? ''
466
+ message.github_actions_metadata =
467
+ object.github_actions_metadata !== undefined &&
468
+ object.github_actions_metadata !== null
469
+ ? GitHubActionsMetadata.fromPartial(object.github_actions_metadata)
470
+ : undefined
471
+ message.arch = object.arch ?? ''
472
+ message.is_claude_code_remote = object.is_claude_code_remote ?? false
473
+ message.remote_environment_type = object.remote_environment_type ?? ''
474
+ message.claude_code_container_id = object.claude_code_container_id ?? ''
475
+ message.claude_code_remote_session_id =
476
+ object.claude_code_remote_session_id ?? ''
477
+ message.tags = object.tags?.map(e => e) || []
478
+ message.deployment_environment = object.deployment_environment ?? ''
479
+ message.is_conductor = object.is_conductor ?? false
480
+ message.version_base = object.version_base ?? ''
481
+ message.coworker_type = object.coworker_type ?? ''
482
+ message.build_time = object.build_time ?? ''
483
+ message.is_local_agent_mode = object.is_local_agent_mode ?? false
484
+ message.linux_distro_id = object.linux_distro_id ?? ''
485
+ message.linux_distro_version = object.linux_distro_version ?? ''
486
+ message.linux_kernel = object.linux_kernel ?? ''
487
+ message.vcs = object.vcs ?? ''
488
+ message.platform_raw = object.platform_raw ?? ''
489
+ return message
490
+ },
491
+ }
492
+
493
+ function createBaseSlackContext(): SlackContext {
494
+ return {
495
+ slack_team_id: '',
496
+ is_enterprise_install: false,
497
+ trigger: '',
498
+ creation_method: '',
499
+ }
500
+ }
501
+
502
+ export const SlackContext: MessageFns<SlackContext> = {
503
+ fromJSON(object: any): SlackContext {
504
+ return {
505
+ slack_team_id: isSet(object.slack_team_id)
506
+ ? globalThis.String(object.slack_team_id)
507
+ : '',
508
+ is_enterprise_install: isSet(object.is_enterprise_install)
509
+ ? globalThis.Boolean(object.is_enterprise_install)
510
+ : false,
511
+ trigger: isSet(object.trigger) ? globalThis.String(object.trigger) : '',
512
+ creation_method: isSet(object.creation_method)
513
+ ? globalThis.String(object.creation_method)
514
+ : '',
515
+ }
516
+ },
517
+
518
+ toJSON(message: SlackContext): unknown {
519
+ const obj: any = {}
520
+ if (message.slack_team_id !== undefined) {
521
+ obj.slack_team_id = message.slack_team_id
522
+ }
523
+ if (message.is_enterprise_install !== undefined) {
524
+ obj.is_enterprise_install = message.is_enterprise_install
525
+ }
526
+ if (message.trigger !== undefined) {
527
+ obj.trigger = message.trigger
528
+ }
529
+ if (message.creation_method !== undefined) {
530
+ obj.creation_method = message.creation_method
531
+ }
532
+ return obj
533
+ },
534
+
535
+ create<I extends Exact<DeepPartial<SlackContext>, I>>(
536
+ base?: I,
537
+ ): SlackContext {
538
+ return SlackContext.fromPartial(base ?? ({} as any))
539
+ },
540
+ fromPartial<I extends Exact<DeepPartial<SlackContext>, I>>(
541
+ object: I,
542
+ ): SlackContext {
543
+ const message = createBaseSlackContext()
544
+ message.slack_team_id = object.slack_team_id ?? ''
545
+ message.is_enterprise_install = object.is_enterprise_install ?? false
546
+ message.trigger = object.trigger ?? ''
547
+ message.creation_method = object.creation_method ?? ''
548
+ return message
549
+ },
550
+ }
551
+
552
+ function createBaseClaudeCodeInternalEvent(): ClaudeCodeInternalEvent {
553
+ return {
554
+ event_name: '',
555
+ client_timestamp: undefined,
556
+ model: '',
557
+ session_id: '',
558
+ user_type: '',
559
+ betas: '',
560
+ env: undefined,
561
+ entrypoint: '',
562
+ agent_sdk_version: '',
563
+ is_interactive: false,
564
+ client_type: '',
565
+ process: '',
566
+ additional_metadata: '',
567
+ auth: undefined,
568
+ server_timestamp: undefined,
569
+ event_id: '',
570
+ device_id: '',
571
+ swe_bench_run_id: '',
572
+ swe_bench_instance_id: '',
573
+ swe_bench_task_id: '',
574
+ email: '',
575
+ agent_id: '',
576
+ parent_session_id: '',
577
+ agent_type: '',
578
+ slack: undefined,
579
+ team_name: '',
580
+ skill_name: '',
581
+ plugin_name: '',
582
+ marketplace_name: '',
583
+ }
584
+ }
585
+
586
+ export const ClaudeCodeInternalEvent: MessageFns<ClaudeCodeInternalEvent> = {
587
+ fromJSON(object: any): ClaudeCodeInternalEvent {
588
+ return {
589
+ event_name: isSet(object.event_name)
590
+ ? globalThis.String(object.event_name)
591
+ : '',
592
+ client_timestamp: isSet(object.client_timestamp)
593
+ ? fromJsonTimestamp(object.client_timestamp)
594
+ : undefined,
595
+ model: isSet(object.model) ? globalThis.String(object.model) : '',
596
+ session_id: isSet(object.session_id)
597
+ ? globalThis.String(object.session_id)
598
+ : '',
599
+ user_type: isSet(object.user_type)
600
+ ? globalThis.String(object.user_type)
601
+ : '',
602
+ betas: isSet(object.betas) ? globalThis.String(object.betas) : '',
603
+ env: isSet(object.env)
604
+ ? EnvironmentMetadata.fromJSON(object.env)
605
+ : undefined,
606
+ entrypoint: isSet(object.entrypoint)
607
+ ? globalThis.String(object.entrypoint)
608
+ : '',
609
+ agent_sdk_version: isSet(object.agent_sdk_version)
610
+ ? globalThis.String(object.agent_sdk_version)
611
+ : '',
612
+ is_interactive: isSet(object.is_interactive)
613
+ ? globalThis.Boolean(object.is_interactive)
614
+ : false,
615
+ client_type: isSet(object.client_type)
616
+ ? globalThis.String(object.client_type)
617
+ : '',
618
+ process: isSet(object.process) ? globalThis.String(object.process) : '',
619
+ additional_metadata: isSet(object.additional_metadata)
620
+ ? globalThis.String(object.additional_metadata)
621
+ : '',
622
+ auth: isSet(object.auth)
623
+ ? PublicApiAuth.fromJSON(object.auth)
624
+ : undefined,
625
+ server_timestamp: isSet(object.server_timestamp)
626
+ ? fromJsonTimestamp(object.server_timestamp)
627
+ : undefined,
628
+ event_id: isSet(object.event_id)
629
+ ? globalThis.String(object.event_id)
630
+ : '',
631
+ device_id: isSet(object.device_id)
632
+ ? globalThis.String(object.device_id)
633
+ : '',
634
+ swe_bench_run_id: isSet(object.swe_bench_run_id)
635
+ ? globalThis.String(object.swe_bench_run_id)
636
+ : '',
637
+ swe_bench_instance_id: isSet(object.swe_bench_instance_id)
638
+ ? globalThis.String(object.swe_bench_instance_id)
639
+ : '',
640
+ swe_bench_task_id: isSet(object.swe_bench_task_id)
641
+ ? globalThis.String(object.swe_bench_task_id)
642
+ : '',
643
+ email: isSet(object.email) ? globalThis.String(object.email) : '',
644
+ agent_id: isSet(object.agent_id)
645
+ ? globalThis.String(object.agent_id)
646
+ : '',
647
+ parent_session_id: isSet(object.parent_session_id)
648
+ ? globalThis.String(object.parent_session_id)
649
+ : '',
650
+ agent_type: isSet(object.agent_type)
651
+ ? globalThis.String(object.agent_type)
652
+ : '',
653
+ slack: isSet(object.slack)
654
+ ? SlackContext.fromJSON(object.slack)
655
+ : undefined,
656
+ team_name: isSet(object.team_name)
657
+ ? globalThis.String(object.team_name)
658
+ : '',
659
+ skill_name: isSet(object.skill_name)
660
+ ? globalThis.String(object.skill_name)
661
+ : '',
662
+ plugin_name: isSet(object.plugin_name)
663
+ ? globalThis.String(object.plugin_name)
664
+ : '',
665
+ marketplace_name: isSet(object.marketplace_name)
666
+ ? globalThis.String(object.marketplace_name)
667
+ : '',
668
+ }
669
+ },
670
+
671
+ toJSON(message: ClaudeCodeInternalEvent): unknown {
672
+ const obj: any = {}
673
+ if (message.event_name !== undefined) {
674
+ obj.event_name = message.event_name
675
+ }
676
+ if (message.client_timestamp !== undefined) {
677
+ obj.client_timestamp = message.client_timestamp.toISOString()
678
+ }
679
+ if (message.model !== undefined) {
680
+ obj.model = message.model
681
+ }
682
+ if (message.session_id !== undefined) {
683
+ obj.session_id = message.session_id
684
+ }
685
+ if (message.user_type !== undefined) {
686
+ obj.user_type = message.user_type
687
+ }
688
+ if (message.betas !== undefined) {
689
+ obj.betas = message.betas
690
+ }
691
+ if (message.env !== undefined) {
692
+ obj.env = EnvironmentMetadata.toJSON(message.env)
693
+ }
694
+ if (message.entrypoint !== undefined) {
695
+ obj.entrypoint = message.entrypoint
696
+ }
697
+ if (message.agent_sdk_version !== undefined) {
698
+ obj.agent_sdk_version = message.agent_sdk_version
699
+ }
700
+ if (message.is_interactive !== undefined) {
701
+ obj.is_interactive = message.is_interactive
702
+ }
703
+ if (message.client_type !== undefined) {
704
+ obj.client_type = message.client_type
705
+ }
706
+ if (message.process !== undefined) {
707
+ obj.process = message.process
708
+ }
709
+ if (message.additional_metadata !== undefined) {
710
+ obj.additional_metadata = message.additional_metadata
711
+ }
712
+ if (message.auth !== undefined) {
713
+ obj.auth = PublicApiAuth.toJSON(message.auth)
714
+ }
715
+ if (message.server_timestamp !== undefined) {
716
+ obj.server_timestamp = message.server_timestamp.toISOString()
717
+ }
718
+ if (message.event_id !== undefined) {
719
+ obj.event_id = message.event_id
720
+ }
721
+ if (message.device_id !== undefined) {
722
+ obj.device_id = message.device_id
723
+ }
724
+ if (message.swe_bench_run_id !== undefined) {
725
+ obj.swe_bench_run_id = message.swe_bench_run_id
726
+ }
727
+ if (message.swe_bench_instance_id !== undefined) {
728
+ obj.swe_bench_instance_id = message.swe_bench_instance_id
729
+ }
730
+ if (message.swe_bench_task_id !== undefined) {
731
+ obj.swe_bench_task_id = message.swe_bench_task_id
732
+ }
733
+ if (message.email !== undefined) {
734
+ obj.email = message.email
735
+ }
736
+ if (message.agent_id !== undefined) {
737
+ obj.agent_id = message.agent_id
738
+ }
739
+ if (message.parent_session_id !== undefined) {
740
+ obj.parent_session_id = message.parent_session_id
741
+ }
742
+ if (message.agent_type !== undefined) {
743
+ obj.agent_type = message.agent_type
744
+ }
745
+ if (message.slack !== undefined) {
746
+ obj.slack = SlackContext.toJSON(message.slack)
747
+ }
748
+ if (message.team_name !== undefined) {
749
+ obj.team_name = message.team_name
750
+ }
751
+ if (message.skill_name !== undefined) {
752
+ obj.skill_name = message.skill_name
753
+ }
754
+ if (message.plugin_name !== undefined) {
755
+ obj.plugin_name = message.plugin_name
756
+ }
757
+ if (message.marketplace_name !== undefined) {
758
+ obj.marketplace_name = message.marketplace_name
759
+ }
760
+ return obj
761
+ },
762
+
763
+ create<I extends Exact<DeepPartial<ClaudeCodeInternalEvent>, I>>(
764
+ base?: I,
765
+ ): ClaudeCodeInternalEvent {
766
+ return ClaudeCodeInternalEvent.fromPartial(base ?? ({} as any))
767
+ },
768
+ fromPartial<I extends Exact<DeepPartial<ClaudeCodeInternalEvent>, I>>(
769
+ object: I,
770
+ ): ClaudeCodeInternalEvent {
771
+ const message = createBaseClaudeCodeInternalEvent()
772
+ message.event_name = object.event_name ?? ''
773
+ message.client_timestamp = object.client_timestamp ?? undefined
774
+ message.model = object.model ?? ''
775
+ message.session_id = object.session_id ?? ''
776
+ message.user_type = object.user_type ?? ''
777
+ message.betas = object.betas ?? ''
778
+ message.env =
779
+ object.env !== undefined && object.env !== null
780
+ ? EnvironmentMetadata.fromPartial(object.env)
781
+ : undefined
782
+ message.entrypoint = object.entrypoint ?? ''
783
+ message.agent_sdk_version = object.agent_sdk_version ?? ''
784
+ message.is_interactive = object.is_interactive ?? false
785
+ message.client_type = object.client_type ?? ''
786
+ message.process = object.process ?? ''
787
+ message.additional_metadata = object.additional_metadata ?? ''
788
+ message.auth =
789
+ object.auth !== undefined && object.auth !== null
790
+ ? PublicApiAuth.fromPartial(object.auth)
791
+ : undefined
792
+ message.server_timestamp = object.server_timestamp ?? undefined
793
+ message.event_id = object.event_id ?? ''
794
+ message.device_id = object.device_id ?? ''
795
+ message.swe_bench_run_id = object.swe_bench_run_id ?? ''
796
+ message.swe_bench_instance_id = object.swe_bench_instance_id ?? ''
797
+ message.swe_bench_task_id = object.swe_bench_task_id ?? ''
798
+ message.email = object.email ?? ''
799
+ message.agent_id = object.agent_id ?? ''
800
+ message.parent_session_id = object.parent_session_id ?? ''
801
+ message.agent_type = object.agent_type ?? ''
802
+ message.slack =
803
+ object.slack !== undefined && object.slack !== null
804
+ ? SlackContext.fromPartial(object.slack)
805
+ : undefined
806
+ message.team_name = object.team_name ?? ''
807
+ message.skill_name = object.skill_name ?? ''
808
+ message.plugin_name = object.plugin_name ?? ''
809
+ message.marketplace_name = object.marketplace_name ?? ''
810
+ return message
811
+ },
812
+ }
813
+
814
+ type Builtin =
815
+ | Date
816
+ | Function
817
+ | Uint8Array
818
+ | string
819
+ | number
820
+ | boolean
821
+ | undefined
822
+
823
+ type DeepPartial<T> = T extends Builtin
824
+ ? T
825
+ : T extends globalThis.Array<infer U>
826
+ ? globalThis.Array<DeepPartial<U>>
827
+ : T extends ReadonlyArray<infer U>
828
+ ? ReadonlyArray<DeepPartial<U>>
829
+ : T extends {}
830
+ ? { [K in keyof T]?: DeepPartial<T[K]> }
831
+ : Partial<T>
832
+
833
+ type KeysOfUnion<T> = T extends T ? keyof T : never
834
+ type Exact<P, I extends P> = P extends Builtin
835
+ ? P
836
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & {
837
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never
838
+ }
839
+
840
+ function fromTimestamp(t: Timestamp): Date {
841
+ let millis = (t.seconds || 0) * 1_000
842
+ millis += (t.nanos || 0) / 1_000_000
843
+ return new globalThis.Date(millis)
844
+ }
845
+
846
+ function fromJsonTimestamp(o: any): Date {
847
+ if (o instanceof globalThis.Date) {
848
+ return o
849
+ } else if (typeof o === 'string') {
850
+ return new globalThis.Date(o)
851
+ } else {
852
+ return fromTimestamp(Timestamp.fromJSON(o))
853
+ }
854
+ }
855
+
856
+ function isSet(value: any): boolean {
857
+ return value !== null && value !== undefined
858
+ }
859
+
860
+ interface MessageFns<T> {
861
+ fromJSON(object: any): T
862
+ toJSON(message: T): unknown
863
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T
864
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T
865
+ }