@guildai/cli 0.10.0 → 0.12.0

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 (203) hide show
  1. package/dist/auth-CRMO5O3N.js +29 -0
  2. package/dist/auth-CRMO5O3N.js.map +7 -0
  3. package/dist/chat-5VX2WJH2.js +303 -0
  4. package/dist/chat-5VX2WJH2.js.map +7 -0
  5. package/dist/chat-SIKDYZQK.js +31 -0
  6. package/dist/chat-SIKDYZQK.js.map +7 -0
  7. package/dist/chunk-56YCMGL3.js +522 -0
  8. package/dist/chunk-56YCMGL3.js.map +7 -0
  9. package/dist/chunk-6EX6E7WP.js +7042 -0
  10. package/dist/chunk-6EX6E7WP.js.map +7 -0
  11. package/dist/chunk-B7VAF5UG.js +532 -0
  12. package/dist/chunk-B7VAF5UG.js.map +7 -0
  13. package/dist/chunk-DOIYVBNY.js +3057 -0
  14. package/dist/chunk-DOIYVBNY.js.map +7 -0
  15. package/dist/chunk-ENKEEJ45.js +17 -0
  16. package/dist/chunk-ENKEEJ45.js.map +7 -0
  17. package/dist/chunk-IBRKVGMZ.js +97041 -0
  18. package/dist/chunk-IBRKVGMZ.js.map +7 -0
  19. package/dist/chunk-LFMQJOKC.js +19778 -0
  20. package/dist/chunk-LFMQJOKC.js.map +7 -0
  21. package/dist/chunk-M347HP6M.js +22896 -0
  22. package/dist/chunk-M347HP6M.js.map +7 -0
  23. package/dist/chunk-OYQ476FQ.js +44 -0
  24. package/dist/chunk-OYQ476FQ.js.map +7 -0
  25. package/dist/chunk-PNCUR4OB.js +257 -0
  26. package/dist/chunk-PNCUR4OB.js.map +7 -0
  27. package/dist/chunk-RIG2HZWM.js +317 -0
  28. package/dist/chunk-RIG2HZWM.js.map +7 -0
  29. package/dist/chunk-SPZPZXUN.js +826 -0
  30. package/dist/chunk-SPZPZXUN.js.map +7 -0
  31. package/dist/chunk-VVSOU6ON.js +53 -0
  32. package/dist/chunk-VVSOU6ON.js.map +7 -0
  33. package/dist/chunk-X3ADGWOF.js +3643 -0
  34. package/dist/chunk-X3ADGWOF.js.map +7 -0
  35. package/dist/commands/agent/logs.d.ts +3 -0
  36. package/dist/commands/setup.d.ts +16 -0
  37. package/dist/commands/skill/create.d.ts +3 -0
  38. package/dist/commands/skill/get.d.ts +3 -0
  39. package/dist/commands/skill/list.d.ts +3 -0
  40. package/dist/commands/skill/update.d.ts +3 -0
  41. package/dist/commands/skill/version/create.d.ts +3 -0
  42. package/dist/commands/skill/version/get.d.ts +3 -0
  43. package/dist/commands/skill/version/list.d.ts +3 -0
  44. package/dist/devtools-AO7YSDOD.js +67 -0
  45. package/dist/devtools-AO7YSDOD.js.map +7 -0
  46. package/dist/dist-4CBK6X5H.js +1566 -0
  47. package/dist/dist-4CBK6X5H.js.map +7 -0
  48. package/dist/esm-FRAVZP4J.js +13 -0
  49. package/dist/esm-FRAVZP4J.js.map +7 -0
  50. package/dist/execa-XQMWSABC.js +35 -0
  51. package/dist/execa-XQMWSABC.js.map +7 -0
  52. package/dist/index.js +8231 -253
  53. package/dist/index.js.map +7 -0
  54. package/dist/lib/api-types.d.ts +44 -0
  55. package/dist/lib/auth.d.ts +1 -1
  56. package/dist/lib/config.d.ts +9 -0
  57. package/dist/lib/errors.d.ts +1 -1
  58. package/dist/lib/output-mode.d.ts +9 -2
  59. package/dist/lib/output.d.ts +17 -1
  60. package/dist/lib/session-events.d.ts +14 -3
  61. package/dist/lib/session-polling.d.ts +24 -1
  62. package/dist/lib/session-resume.d.ts +15 -1
  63. package/dist/lib/stdin.d.ts +5 -1
  64. package/dist/lib/websocket-client.d.ts +46 -0
  65. package/dist/open-RF4X5MOP.js +13 -0
  66. package/dist/open-RF4X5MOP.js.map +7 -0
  67. package/dist/server-JYVH64FD.js +27659 -0
  68. package/dist/server-JYVH64FD.js.map +7 -0
  69. package/dist/test-SNIYRJ32.js +692 -0
  70. package/dist/test-SNIYRJ32.js.map +7 -0
  71. package/docs/skills/codex-agent-dev.md +2 -2
  72. package/package.json +8 -12
  73. package/dist/commands/agent/chat.js +0 -278
  74. package/dist/commands/agent/clone.js +0 -116
  75. package/dist/commands/agent/code.js +0 -87
  76. package/dist/commands/agent/fork.js +0 -218
  77. package/dist/commands/agent/get.js +0 -37
  78. package/dist/commands/agent/grep.js +0 -107
  79. package/dist/commands/agent/init.js +0 -390
  80. package/dist/commands/agent/list.js +0 -110
  81. package/dist/commands/agent/owners.js +0 -74
  82. package/dist/commands/agent/publish.js +0 -91
  83. package/dist/commands/agent/pull.js +0 -198
  84. package/dist/commands/agent/revalidate.js +0 -56
  85. package/dist/commands/agent/save.js +0 -346
  86. package/dist/commands/agent/search.js +0 -61
  87. package/dist/commands/agent/tags/add.js +0 -73
  88. package/dist/commands/agent/tags/list.js +0 -43
  89. package/dist/commands/agent/tags/remove.js +0 -84
  90. package/dist/commands/agent/tags/set.js +0 -71
  91. package/dist/commands/agent/test.js +0 -486
  92. package/dist/commands/agent/unpublish.js +0 -64
  93. package/dist/commands/agent/update.js +0 -110
  94. package/dist/commands/agent/versions.js +0 -55
  95. package/dist/commands/agent/workspaces.js +0 -54
  96. package/dist/commands/auth/login.js +0 -33
  97. package/dist/commands/auth/logout.js +0 -24
  98. package/dist/commands/auth/status.js +0 -38
  99. package/dist/commands/auth/token.js +0 -19
  100. package/dist/commands/chat.js +0 -1345
  101. package/dist/commands/config/get.js +0 -64
  102. package/dist/commands/config/list.js +0 -47
  103. package/dist/commands/config/path.js +0 -38
  104. package/dist/commands/config/set.js +0 -132
  105. package/dist/commands/credentials/endpoint-list.js +0 -88
  106. package/dist/commands/credentials/list.js +0 -50
  107. package/dist/commands/credentials/policy-create.js +0 -66
  108. package/dist/commands/credentials/policy-delete.js +0 -33
  109. package/dist/commands/credentials/policy-list.js +0 -45
  110. package/dist/commands/credentials/policy-update.js +0 -66
  111. package/dist/commands/doctor.js +0 -233
  112. package/dist/commands/integration/connect.js +0 -76
  113. package/dist/commands/integration/create.js +0 -298
  114. package/dist/commands/integration/get.js +0 -95
  115. package/dist/commands/integration/list.js +0 -62
  116. package/dist/commands/integration/operation/create.js +0 -164
  117. package/dist/commands/integration/operation/list.js +0 -92
  118. package/dist/commands/integration/update.js +0 -139
  119. package/dist/commands/integration/version/build.js +0 -86
  120. package/dist/commands/integration/version/create.js +0 -45
  121. package/dist/commands/integration/version/get.js +0 -72
  122. package/dist/commands/integration/version/list.js +0 -45
  123. package/dist/commands/integration/version/publish.js +0 -79
  124. package/dist/commands/integration/version/test.js +0 -104
  125. package/dist/commands/job/get-step.js +0 -40
  126. package/dist/commands/job/get.js +0 -44
  127. package/dist/commands/mcp.js +0 -34
  128. package/dist/commands/session/create.js +0 -59
  129. package/dist/commands/session/events.js +0 -56
  130. package/dist/commands/session/get.js +0 -33
  131. package/dist/commands/session/interrupt.js +0 -33
  132. package/dist/commands/session/list.js +0 -59
  133. package/dist/commands/session/send.js +0 -54
  134. package/dist/commands/session/tasks.js +0 -45
  135. package/dist/commands/setup.js +0 -230
  136. package/dist/commands/trigger/activate.js +0 -41
  137. package/dist/commands/trigger/create.js +0 -197
  138. package/dist/commands/trigger/deactivate.js +0 -41
  139. package/dist/commands/trigger/get.js +0 -33
  140. package/dist/commands/trigger/list.js +0 -57
  141. package/dist/commands/trigger/sessions.js +0 -48
  142. package/dist/commands/trigger/update.js +0 -128
  143. package/dist/commands/version.js +0 -24
  144. package/dist/commands/workspace/agent/add.js +0 -114
  145. package/dist/commands/workspace/agent/list.js +0 -78
  146. package/dist/commands/workspace/agent/remove.js +0 -78
  147. package/dist/commands/workspace/clear.js +0 -45
  148. package/dist/commands/workspace/context/edit.js +0 -107
  149. package/dist/commands/workspace/context/get.js +0 -47
  150. package/dist/commands/workspace/context/list.js +0 -51
  151. package/dist/commands/workspace/context/publish.js +0 -42
  152. package/dist/commands/workspace/create.js +0 -51
  153. package/dist/commands/workspace/current.js +0 -63
  154. package/dist/commands/workspace/get.js +0 -39
  155. package/dist/commands/workspace/list.js +0 -70
  156. package/dist/commands/workspace/select.js +0 -184
  157. package/dist/components/AgentInstallPrompt.js +0 -97
  158. package/dist/components/SplashAnimation.js +0 -321
  159. package/dist/components/TaskView.js +0 -268
  160. package/dist/lib/agent-helpers.js +0 -306
  161. package/dist/lib/alternate-screen.js +0 -59
  162. package/dist/lib/api-client.js +0 -154
  163. package/dist/lib/api-types.js +0 -10
  164. package/dist/lib/auth.js +0 -284
  165. package/dist/lib/braille-canvas.js +0 -321
  166. package/dist/lib/colors.js +0 -46
  167. package/dist/lib/config-cache.js +0 -45
  168. package/dist/lib/config.js +0 -153
  169. package/dist/lib/did-you-mean.js +0 -144
  170. package/dist/lib/errors.js +0 -375
  171. package/dist/lib/event-filter.js +0 -91
  172. package/dist/lib/generated-types.js +0 -56
  173. package/dist/lib/git.js +0 -176
  174. package/dist/lib/gk.js +0 -91
  175. package/dist/lib/guild-config.js +0 -178
  176. package/dist/lib/iap.js +0 -117
  177. package/dist/lib/integration-helpers.js +0 -38
  178. package/dist/lib/loading-messages.js +0 -72
  179. package/dist/lib/logo.js +0 -141
  180. package/dist/lib/lottie-serverside.js +0 -181
  181. package/dist/lib/markdown.js +0 -38
  182. package/dist/lib/npmrc.js +0 -59
  183. package/dist/lib/output-mode.js +0 -33
  184. package/dist/lib/output.js +0 -591
  185. package/dist/lib/owner-helpers.js +0 -112
  186. package/dist/lib/polling.js +0 -76
  187. package/dist/lib/progress.js +0 -324
  188. package/dist/lib/session-events-fetch.js +0 -25
  189. package/dist/lib/session-events.js +0 -112
  190. package/dist/lib/session-polling.js +0 -160
  191. package/dist/lib/session-resume.js +0 -96
  192. package/dist/lib/spinners.js +0 -770
  193. package/dist/lib/splash.js +0 -41
  194. package/dist/lib/stdin.js +0 -84
  195. package/dist/lib/svg-to-braille.js +0 -76
  196. package/dist/lib/table.js +0 -59
  197. package/dist/lib/update-check.js +0 -65
  198. package/dist/lib/validate-input-schema.js +0 -208
  199. package/dist/lib/version-helpers.js +0 -121
  200. package/dist/lib/workspace-helpers.js +0 -49
  201. package/dist/mcp/resources.js +0 -67
  202. package/dist/mcp/server.js +0 -64
  203. package/dist/mcp/tools.js +0 -753
@@ -357,6 +357,50 @@ export interface Organization {
357
357
  viewer_role: 'ADMIN' | 'MEMBER' | null;
358
358
  }
359
359
  export type OrganizationListResponse = PaginatedResponse<Organization>;
360
+ /**
361
+ * Skill entity from the API.
362
+ * Used by: skill list, skill get, skill create, skill update
363
+ */
364
+ export interface Skill {
365
+ id: string;
366
+ entity_type: string;
367
+ type: 'skill';
368
+ full_name: string;
369
+ name: string;
370
+ overview: string;
371
+ is_public: boolean;
372
+ avatar_url: string | null;
373
+ owner: {
374
+ id: string;
375
+ name: string;
376
+ type: string;
377
+ };
378
+ viewer_can_edit: boolean;
379
+ created_at: string;
380
+ updated_at: string;
381
+ latest_version?: SkillVersion | null;
382
+ }
383
+ /**
384
+ * Skill version entity from the API.
385
+ * Used by: skill version list, skill version get, skill version create
386
+ */
387
+ export interface SkillVersion {
388
+ id: string;
389
+ entity_type: string;
390
+ type: 'skill_version';
391
+ version_number: string;
392
+ description: string;
393
+ body?: string;
394
+ skill?: Skill;
395
+ author?: {
396
+ id: string;
397
+ name: string;
398
+ };
399
+ created_at: string;
400
+ updated_at: string;
401
+ }
402
+ export type SkillListResponse = PaginatedResponse<Skill>;
403
+ export type SkillVersionListResponse = PaginatedResponse<SkillVersion>;
360
404
  export interface Credentials {
361
405
  id: string;
362
406
  integration: {
@@ -46,7 +46,7 @@ export declare function pollForToken(authUrl: string, code: string, interval: nu
46
46
  * @param returnLabel - Optional friendly label for return button (e.g., "VSCode")
47
47
  * @returns true if successful, false otherwise
48
48
  */
49
- export declare function login(returnUrl?: string, returnLabel?: string, nonInteractive?: boolean): Promise<boolean>;
49
+ export declare function login(returnUrl?: string, returnLabel?: string): Promise<boolean>;
50
50
  /**
51
51
  * Perform logout
52
52
  */
@@ -48,6 +48,15 @@ export declare function getGuildcoreUrl(): string;
48
48
  * Used to construct clickable links to dashboard pages.
49
49
  */
50
50
  export declare function getDashboardUrl(): string;
51
+ /**
52
+ * Get the Guildcore WebSocket base URL
53
+ *
54
+ * Derives the WebSocket URL from the HTTP guildcore URL:
55
+ * - http:// → ws://, https:// → wss://
56
+ *
57
+ * @returns WebSocket base URL (e.g., "wss://app.guild.ai/api")
58
+ */
59
+ export declare function getGuildcoreWsUrl(): string;
51
60
  /**
52
61
  * Check if the given URL is an IAP-protected host
53
62
  *
@@ -39,7 +39,7 @@ export declare const ErrorCodes: {
39
39
  readonly VALIDATION_ERROR: "VALIDATION_ERROR";
40
40
  };
41
41
  /**
42
- * Check if debug mode is enabled (CLI flag or config)
42
+ * Check if debug mode is enabled (CLI flag, config, or env var)
43
43
  */
44
44
  export declare function isDebugMode(): boolean;
45
45
  /**
@@ -1,11 +1,18 @@
1
- export type OutputMode = 'interactive' | 'json';
1
+ export type OutputMode = 'interactive' | 'json' | 'jsonl';
2
2
  /**
3
3
  * Detect output mode from CLI flags or config
4
4
  *
5
- * Checks --json flag and config. CLI flag overrides config.
5
+ * Priority: --mode <value> > --json (backward compat) > config
6
6
  * Does NOT auto-detect pipes (user must request JSON explicitly).
7
7
  */
8
8
  export declare function getOutputMode(): OutputMode;
9
+ /**
10
+ * Check if the current output mode is machine-readable (json or jsonl).
11
+ *
12
+ * Use this in list/get commands instead of `getOutputMode() === 'json'`
13
+ * so that both --mode json and --mode jsonl trigger non-interactive output.
14
+ */
15
+ export declare function isMachineReadable(): boolean;
9
16
  /**
10
17
  * Check if quiet mode is enabled (CLI flag or config)
11
18
  *
@@ -1,5 +1,5 @@
1
1
  import { type Spinner } from './progress.js';
2
- import type { Agent, AgentVersion, Credentials, CredentialsPolicy, Context, Integration, IntegrationVersion, JobStep, Pagination, Session, Task, Workspace, WorkspaceAgent, Trigger } from './api-types.js';
2
+ import type { Agent, AgentVersion, Credentials, CredentialsPolicy, Context, Integration, IntegrationVersion, JobStep, Pagination, Session, Skill, SkillVersion, Task, ValidationStep, Workspace, WorkspaceAgent, Trigger } from './api-types.js';
3
3
  /**
4
4
  * Format an agent list as a human-readable table.
5
5
  * Shared by agent list and agent search commands.
@@ -10,6 +10,16 @@ export declare function formatAgentTable(agents: Agent[], pagination: Pagination
10
10
  * Used by integration list command.
11
11
  */
12
12
  export declare function formatIntegrationTable(integrations: Integration[], pagination: Pagination): void;
13
+ /**
14
+ * Format a skill list as a human-readable table.
15
+ * Used by skill list command.
16
+ */
17
+ export declare function formatSkillTable(skills: Skill[], pagination: Pagination): void;
18
+ /**
19
+ * Format a skill version list as a human-readable table.
20
+ * Used by skill version list command.
21
+ */
22
+ export declare function formatSkillVersionTable(versions: SkillVersion[], pagination: Pagination, skillName: string): void;
13
23
  /**
14
24
  * Format an integration version list as a human-readable table.
15
25
  * Used by integration version list command.
@@ -57,6 +67,12 @@ export declare function formatPoliciesTable(policies: CredentialsPolicy[], pagin
57
67
  * Used by job get command.
58
68
  */
59
69
  export declare function formatJobStepTable(steps: JobStep[]): void;
70
+ /**
71
+ * Format validation step logs as human-readable output.
72
+ * Prints each step's name, colored status, and full log content.
73
+ * Used by the `guild agent logs` command.
74
+ */
75
+ export declare function formatValidationLogs(steps: ValidationStep[]): void;
60
76
  /**
61
77
  * Output writer interface for consistent CLI output
62
78
  *
@@ -4,7 +4,7 @@
4
4
  * These types match the backend event system from the messaging refactor (PR #819).
5
5
  * All CLI commands should import these types instead of defining their own.
6
6
  */
7
- export type TaskStatus = 'CREATED' | 'STARTED' | 'RUNNING' | 'WAITING' | 'DONE' | 'ERROR' | 'INTERRUPTED';
7
+ export type TaskStatus = 'CREATED' | 'DISPATCHED' | 'STARTED' | 'RUNNING' | 'WAITING' | 'DONE' | 'ERROR' | 'INTERRUPTED';
8
8
  export interface BaseTaskFields {
9
9
  id: string;
10
10
  status: TaskStatus;
@@ -97,14 +97,23 @@ export interface TextContent {
97
97
  type: 'text';
98
98
  data: string;
99
99
  }
100
+ export interface UnknownContent {
101
+ type: string;
102
+ data?: unknown;
103
+ }
104
+ export interface MultipartContent {
105
+ type: 'multipart/mixed';
106
+ parts: UnknownContent[];
107
+ }
100
108
  export interface ResponseStreamContent {
101
109
  type: 'application/guild-response-stream';
102
110
  stream_id: string;
103
111
  sequence: number;
104
- status: 'streaming' | 'done' | 'aborted';
112
+ status: 'streaming' | 'done' | 'continued' | 'aborted';
105
113
  text: string;
114
+ is_delta?: boolean;
106
115
  }
107
- export type AgentNotificationMessageContent = TextContent | ResponseStreamContent;
116
+ export type AgentNotificationMessageContent = TextContent | MultipartContent | ResponseStreamContent;
108
117
  export interface AgentNotificationMessageEvent extends BaseEvent {
109
118
  type: 'agent_notification_message';
110
119
  content: AgentNotificationMessageContent;
@@ -181,6 +190,8 @@ export declare function isDoneResponseStreamEvent(event: SessionEvent): event is
181
190
  status: 'done';
182
191
  };
183
192
  };
193
+ /** Apply a response-stream payload to the accumulated display text. */
194
+ export declare function applyResponseStreamText(currentText: string, content: ResponseStreamContent): string;
184
195
  /** Extract display text from notification content. */
185
196
  export declare function getAgentNotificationText(event: AgentNotificationMessageEvent): string;
186
197
  /** Check if an event belongs to the root task or has no task context. */
@@ -1,11 +1,21 @@
1
1
  import { GuildAPIClient } from './api-client.js';
2
+ import { SessionEvent } from './session-events.js';
2
3
  export interface PollResult {
3
4
  response: string | null;
4
5
  /** Last event ID seen — pass as `afterEventId` on next call. */
5
6
  lastEventId: string | undefined;
6
7
  }
8
+ export interface PollOnceResult {
9
+ events: SessionEvent[];
10
+ lastEventId: string | undefined;
11
+ reason: 'completion' | 'error' | 'ui_prompt' | 'inactivity_timeout';
12
+ }
7
13
  /**
8
- * Poll for agent response using from_id cursor.
14
+ * Poll for agent response using WebSocket streaming with HTTP fallback.
15
+ *
16
+ * Does one initial HTTP GET (using from_id cursor) to check if the response
17
+ * is already available, then opens a WebSocket for real-time events.
18
+ * Falls back to HTTP polling if the WebSocket connection fails.
9
19
  *
10
20
  * Handles both multi-turn agents (which emit agent_notification_message)
11
21
  * and one-shot agents (which may only emit runtime_done with output content).
@@ -23,6 +33,19 @@ export declare function pollForResponse(client: GuildAPIClient, sessionId: strin
23
33
  * Same completion logic as pollForResponse(), but writes each event that
24
34
  * passes the filter to stdout so callers get intermediate output (console.log,
25
35
  * progress, etc.) in JSON/JSONL automation modes.
36
+ *
37
+ * Uses HTTP polling (not WebSocket) since it needs to emit each event
38
+ * individually to stdout as JSONL.
26
39
  */
27
40
  export declare function pollForResponseWithEvents(client: GuildAPIClient, sessionId: string, eventFilter: Set<string>, afterEventId: string | undefined, maxWaitTime?: number): Promise<PollResult>;
41
+ /**
42
+ * Poll for --once mode using WebSocket streaming with HTTP fallback.
43
+ *
44
+ * Accumulates all events (unlike pollForResponse which returns a single response)
45
+ * and checks for completion conditions after each batch.
46
+ */
47
+ export declare function pollForOnce(client: GuildAPIClient, sessionId: string, options?: {
48
+ inactivityTimeoutMs?: number;
49
+ pollIntervalMs?: number;
50
+ }): Promise<PollOnceResult>;
28
51
  //# sourceMappingURL=session-polling.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { GuildAPIClient } from './api-client.js';
2
- import { SessionEvent, Session } from './session-events.js';
2
+ import { type ResponseStreamContent, SessionEvent, Session } from './session-events.js';
3
3
  /**
4
4
  * Print a dimmed resume hint to stderr on session exit.
5
5
  * Only call when a session ID is available.
@@ -19,6 +19,20 @@ export interface DisplayMessage {
19
19
  type: 'user' | 'assistant' | 'progress';
20
20
  timestamp?: string;
21
21
  }
22
+ export interface ResponseStreamResumeState {
23
+ keys: Map<string, string>;
24
+ contents: Map<string, ResponseStreamContent[]>;
25
+ texts: Map<string, string>;
26
+ timestamps: Map<string, string>;
27
+ statuses: Map<string, ResponseStreamContent['status']>;
28
+ keysByTask: Map<string, Set<string>>;
29
+ }
30
+ export interface SessionResumeDisplay {
31
+ displayMessages: DisplayMessage[];
32
+ responseStreamState: ResponseStreamResumeState;
33
+ }
34
+ export declare function responseStreamResumeStateFromEvents(events: SessionEvent[]): ResponseStreamResumeState;
35
+ export declare function prepareSessionResumeDisplay(events: SessionEvent[]): SessionResumeDisplay;
22
36
  /**
23
37
  * Convert session events to display messages for resume.
24
38
  * Maps user_message, agent_notification_message, and agent_notification_error
@@ -1,5 +1,9 @@
1
1
  /**
2
- * Check if stdin is connected to an interactive terminal (TTY).
2
+ * Check if the CLI is running in interactive mode.
3
+ *
4
+ * Returns false when:
5
+ * - stdin is not a TTY (piped input, CI, cron)
6
+ * - the global --non-interactive flag is set
3
7
  */
4
8
  export declare function isInteractive(): boolean;
5
9
  /**
@@ -0,0 +1,46 @@
1
+ type WsState = 'connecting' | 'connected' | 'disconnected' | 'reconnecting';
2
+ export interface WebSocketClientOptions<R> {
3
+ /** WebSocket endpoint path (e.g., "/sessions/{id}/events/ws") */
4
+ path: string;
5
+ /** Query parameters to append to the URL */
6
+ queryParams?: Record<string, string>;
7
+ /** Called for each received JSON message */
8
+ onMessage: (message: R) => void;
9
+ /** Called when the connection fails permanently (auth error, max retries) */
10
+ onError?: (error: Error) => void;
11
+ /** Returns the last seen ID for reconnection resume via from_id */
12
+ getFromId?: () => string | undefined;
13
+ /** Debug label for logging */
14
+ label: string;
15
+ }
16
+ /**
17
+ * Node.js WebSocket client for Guild backend endpoints.
18
+ *
19
+ * Handles auth headers (Bearer + IAP), auto-reconnect with exponential
20
+ * backoff + jitter, connection timeout, and from_id resume on reconnect.
21
+ */
22
+ export declare class GuildWebSocketClient<R> {
23
+ private ws;
24
+ private state;
25
+ private readonly options;
26
+ private reconnectTimer;
27
+ private connectTimeout;
28
+ private reconnectAttempts;
29
+ private constructor();
30
+ /**
31
+ * Create and connect a WebSocket client.
32
+ * Rejects if initial connection or auth fails.
33
+ */
34
+ static create<R>(options: WebSocketClientOptions<R>): Promise<GuildWebSocketClient<R>>;
35
+ private buildUrl;
36
+ private getHeaders;
37
+ private cleanupSocket;
38
+ private connect;
39
+ private scheduleReconnect;
40
+ /** Close the connection cleanly. No reconnection will be attempted. */
41
+ close(): void;
42
+ /** Current connection state */
43
+ getState(): WsState;
44
+ }
45
+ export {};
46
+ //# sourceMappingURL=websocket-client.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { createRequire as _cjsReq } from 'module'; if(typeof require === 'undefined') var require = _cjsReq(import.meta.url);
2
+ import {
3
+ apps,
4
+ openApp,
5
+ open_default
6
+ } from "./chunk-56YCMGL3.js";
7
+ import "./chunk-OYQ476FQ.js";
8
+ export {
9
+ apps,
10
+ open_default as default,
11
+ openApp
12
+ };
13
+ //# sourceMappingURL=open-RF4X5MOP.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }