@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
package/dist/lib/iap.js DELETED
@@ -1,117 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * IAP (Identity-Aware Proxy) authentication for accessing IAP-protected hosts
5
- *
6
- * IAP-protected hosts:
7
- * - *.guildai.dev (shared/staging environments)
8
- *
9
- * Users must:
10
- * 1. Have a Google account added to the IAP allowlist
11
- * 2. Run `gcloud auth login` to authenticate
12
- *
13
- * This module fetches identity tokens via gcloud CLI for programmatic access.
14
- */
15
- import { execSync } from 'child_process';
16
- import { getIapConfig } from './config.js';
17
- import { debug } from './errors.js';
18
- /**
19
- * Cache for IAP tokens, keyed by service account to avoid repeated gcloud calls
20
- * Tokens are valid for ~1 hour, we cache for 50 minutes to be safe
21
- */
22
- const tokenCache = new Map();
23
- const TOKEN_CACHE_MS = 50 * 60 * 1000; // 50 minutes
24
- /**
25
- * Get an IAP identity token for accessing the given URL
26
- *
27
- * Uses `gcloud auth print-identity-token` to get a token with the correct audience.
28
- * Requires the user to have run `gcloud auth login` with an authorized Google account.
29
- *
30
- * @param url The URL being accessed (used to determine IAP credentials)
31
- * @returns Identity token string, or null if URL is not IAP-protected
32
- * @throws Error if gcloud is not available, not authenticated, or lacks permissions
33
- */
34
- export async function getIapToken(url) {
35
- const iapConfig = getIapConfig(url);
36
- if (!iapConfig) {
37
- return null;
38
- }
39
- const { clientId, serviceAccount } = iapConfig;
40
- // Check cache first (keyed by service account since different envs use different SAs)
41
- const cached = tokenCache.get(serviceAccount);
42
- if (cached && Date.now() < cached.expiresAt) {
43
- debug('Using cached IAP token for %s', serviceAccount);
44
- return cached.token;
45
- }
46
- try {
47
- debug('Fetching IAP token via gcloud with service account impersonation: %s', serviceAccount);
48
- // User accounts can't directly get tokens with custom audiences.
49
- // We impersonate a service account that has IAP access, which allows us to
50
- // get an identity token with the correct audience for IAP validation.
51
- // --include-email is required for IAP to validate the token.
52
- const cmd = `gcloud auth print-identity-token ` +
53
- `--impersonate-service-account=${serviceAccount} ` +
54
- `--audiences=${clientId} ` +
55
- `--include-email`;
56
- const token = execSync(cmd, {
57
- encoding: 'utf-8',
58
- timeout: 15000, // 15 second timeout (impersonation takes longer)
59
- stdio: ['pipe', 'pipe', 'pipe'], // Capture stderr
60
- }).trim();
61
- if (!token) {
62
- throw new Error('gcloud returned empty token. Please try again.');
63
- }
64
- tokenCache.set(serviceAccount, {
65
- token,
66
- expiresAt: Date.now() + TOKEN_CACHE_MS,
67
- });
68
- debug('Successfully fetched IAP token for %s', serviceAccount);
69
- return token;
70
- }
71
- catch (error) {
72
- debug('Failed to get IAP token: %s', error);
73
- // Parse error to provide specific guidance
74
- const errorMessage = error instanceof Error ? error.message : String(error);
75
- if (errorMessage.includes('not found') || errorMessage.includes('ENOENT')) {
76
- throw new Error('gcloud CLI not found.\n\n' +
77
- 'Please install the Google Cloud SDK:\n' +
78
- ' https://cloud.google.com/sdk/docs/install');
79
- }
80
- else if (errorMessage.includes('not logged in') ||
81
- errorMessage.includes('Could not automatically determine credentials') ||
82
- errorMessage.includes('Reauthentication')) {
83
- throw new Error('Not authenticated to Google Cloud.\n\n' +
84
- 'Please run: gcloud auth login\n' +
85
- 'Make sure to use the Google account provided by your Guild contact.');
86
- }
87
- else if (errorMessage.includes('does not have permission') ||
88
- errorMessage.includes('Permission') ||
89
- errorMessage.includes('403')) {
90
- throw new Error('Access denied to service account impersonation.\n\n' +
91
- 'Make sure you are using the Google account provided by your Guild contact.\n' +
92
- 'Run `gcloud auth login` to re-authenticate.');
93
- }
94
- // Unknown error - rethrow with context
95
- throw new Error(`Failed to get IAP token: ${errorMessage}`);
96
- }
97
- }
98
- /**
99
- * Get IAP headers for a request to the given URL
100
- *
101
- * If the URL is IAP-protected, returns headers with Proxy-Authorization
102
- * containing the identity token.
103
- *
104
- * @param url The URL being requested
105
- * @returns Headers object to merge with request headers, or empty object
106
- * @throws Error if IAP token cannot be obtained
107
- */
108
- export async function getIapHeaders(url) {
109
- const token = await getIapToken(url);
110
- if (!token) {
111
- return {};
112
- }
113
- return {
114
- 'Proxy-Authorization': `Bearer ${token}`,
115
- };
116
- }
117
- //# sourceMappingURL=iap.js.map
@@ -1,38 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * Resolve a version ID from an integration identifier and optional semver.
5
- *
6
- * 1. GET /integrations/<identifier> to resolve the integration
7
- * 2. GET /integrations/<id>/versions to list versions
8
- * 3. If semver provided, find matching version_number; otherwise use latest (first)
9
- */
10
- export async function resolveVersionId(client, identifier, versionNumber) {
11
- const integration = await client.get(`/integrations/${identifier}`);
12
- const versions = await client.get(`/integrations/${integration.id}/versions?limit=100`);
13
- if (versions.items.length === 0) {
14
- throw new Error('No versions found for this integration');
15
- }
16
- if (versionNumber) {
17
- const match = versions.items.find((v) => v.version_number === versionNumber);
18
- if (!match) {
19
- throw new Error(`Version ${versionNumber} not found`);
20
- }
21
- return match.id;
22
- }
23
- return versions.items[0].id;
24
- }
25
- /**
26
- * Resolve the latest draft version ID for an integration.
27
- * Used by the build command where --version is not applicable (drafts have no semver).
28
- */
29
- export async function resolveLatestDraftId(client, identifier) {
30
- const integration = await client.get(`/integrations/${identifier}`);
31
- const versions = await client.get(`/integrations/${integration.id}/versions?limit=100`);
32
- const draft = versions.items.find((v) => v.version_number === null);
33
- if (!draft) {
34
- throw new Error('No draft version found for this integration');
35
- }
36
- return draft.id;
37
- }
38
- //# sourceMappingURL=integration-helpers.js.map
@@ -1,72 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * Loading messages for the CLI splash animation
5
- * Guild/fantasy adventure themed, matching www
6
- */
7
- export const LOADING_MESSAGES = [
8
- // Entering/Arriving
9
- 'Entering the guild hall...',
10
- 'Stepping through the portal...',
11
- 'Crossing the threshold...',
12
- 'Approaching the guild...',
13
- 'The gates are opening...',
14
- 'Guild doors unlocking...',
15
- // Gathering/Assembling
16
- 'Gathering your party...',
17
- 'Assembling your crew...',
18
- 'Rallying the troops...',
19
- 'Mustering your forces...',
20
- 'Calling your companions...',
21
- 'The fellowship gathers...',
22
- // Preparing/Crafting
23
- 'Stoking the forge...',
24
- 'Sharpening your tools...',
25
- 'Polishing your armor...',
26
- 'Preparing the workbench...',
27
- 'Lighting the forge fires...',
28
- 'Readying your gear...',
29
- // Magic/Summoning
30
- 'Summoning your agents...',
31
- 'Channeling the magic...',
32
- 'Weaving enchantments...',
33
- 'The ritual begins...',
34
- 'Arcane forces gathering...',
35
- 'Conjuring your allies...',
36
- // Quest/Adventure
37
- 'Quest accepted...',
38
- 'Adventure awaits...',
39
- 'The journey begins...',
40
- 'Destiny calls...',
41
- 'The tale unfolds...',
42
- 'A new chapter begins...',
43
- // Guild-Specific
44
- 'Consulting the guild masters...',
45
- 'The guild convenes...',
46
- 'Guild charter signed...',
47
- 'Your guild awaits...',
48
- 'The council gathers...',
49
- // Playful/Quirky
50
- 'Rolling for initiative...',
51
- 'Checking the quest log...',
52
- 'Brewing a potion...',
53
- 'Feeding the dragon...',
54
- 'Polishing your badge...',
55
- 'Tuning the lute...',
56
- ];
57
- /**
58
- * Get a random loading message
59
- */
60
- export function getRandomMessage() {
61
- return LOADING_MESSAGES[Math.floor(Math.random() * LOADING_MESSAGES.length)];
62
- }
63
- /**
64
- * Timing configuration (matching www)
65
- */
66
- export const LOADING_TIMINGS = {
67
- messageRotation: 2500, // 2.5s per message
68
- messageFade: 300, // 300ms crossfade
69
- minLoadingDwell: 3000, // 3s minimum before transition
70
- logoAssembly: 1200, // 1.2s for logo pieces to fly in
71
- };
72
- //# sourceMappingURL=loading-messages.js.map
package/dist/lib/logo.js DELETED
@@ -1,141 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- // Guild logo & variations
4
- // Small logos from main branch (too small for CLI startup, preserved for reference/spinners)
5
- // const LOGO_3 = ['⣌⠿⣡', '⢋⣶⡙'];
6
- // const LOGO_6 = ['⡰⠎⣷⣞⠱⢆', '⣹⣾⠀⠀⡿⣏', '⠱⢆⡽⢿⡰⠎'];
7
- // const LOGO_9 = ['⠀⣤⠛⣿⣴⠾⠛⣤⠀', '⣿⠁⣤⠿⠿⠷⣤⣭⣿', '⣘⣷⣿⠀⠀⠀⣿⢿⡍', '⣿⡛⠛⣶⣶⣶⠛⢀⣿', '⠀⠛⣤⡶⠟⣿⣤⠛⠀'];
8
- const LOGO_12 = [
9
- '⠀⢀⡸⠿⣿⣇⣴⠿⠿⣇⡀ ',
10
- '⣶⡎⠁⠀⣿⣿⣷⣶⠀⠉⢱⣶',
11
- '⠻⣧⣸⣿⠀⠀⠀⠀⣿⣿⡿⠿',
12
- '⣶⣾⣿⣿⠀⠀⠀⠀⣿⡏⢿⣆',
13
- '⠿⣇⡀⠀⠿⢿⣿⣿⠀⣀⡸⠿',
14
- '⠀⠉⢱⣶⣾⠟⢹⣿⣶⡏⠁⠀',
15
- ];
16
- // Medium/Large logos
17
- const LOGO_14 = [
18
- '⠀⠀⠀⢸⣿⣿⡇⠀⣠⣶⣿⡇⠀⠀⠀',
19
- '⠀⠀⣿⡇⠀⣿⣧⣿⠟⠁⠀⠀⣿⡇⠀',
20
- '⣿⣿⠀⠀⠀⣿⣿⣿⣿⣿⠀⠀⠀⢸⣿',
21
- '⠸⣿⡀⢸⣿⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿',
22
- '⠀⠹⣿⣾⣿⠀⠀⠀⠀⠀⣿⣿⣷⣄⠀',
23
- '⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⣿⡇⠈⣿⡆',
24
- '⣿⣿⠀⠀⠀⣿⣿⣿⣿⣿⠀⠀⠀⣿⣿',
25
- '⠀⠀⣿⡇⠀⠀⣠⣿⢻⣿⠀⠀⣿⡇⠀',
26
- '⠀⠀⠀⢸⣿⠿⠟⠁⢸⣿⣿⡇⠀⠀⠀',
27
- ];
28
- const LOGO_17_BLK = [
29
- ' █ ■ ■ ■ ',
30
- ' █ ■ ■ ■ ',
31
- '█ ■ ■ ■ ■',
32
- '█ █ █ █ █',
33
- ' █ █ █ █ ',
34
- '█ █ █ █ █',
35
- '■ ■ ■ ■ █',
36
- ' ■ ■ ■ █ ',
37
- ' ■ ■ ■ █ ',
38
- ];
39
- const LOGO_17_DOT = [
40
- ' ■ ■ ■ ■ ',
41
- ' ■ ■ ■ ■ ',
42
- '■ ■ ■ ■ ■',
43
- '■ ■ ■ ■ ■',
44
- ' ■ ■ ■ ■ ',
45
- '■ ■ ■ ■ ■',
46
- '■ ■ ■ ■ ■',
47
- ' ■ ■ ■ ■ ',
48
- ' ■ ■ ■ ■ ',
49
- ];
50
- const LOGO_20_ENV = [
51
- '⣿⣿⣿⣿⡇⠀⠀⠀⠀⣿⣿⠟⠉⠁⠀⣿⣿⣿⣿⣿',
52
- '⣿⣿⡟⠛⢳⣶⣦⠀⠀⠏⠀⠀⣠⣤⣶⡟⠛⢻⣿⣿',
53
- '⠿⠿⣇⣀⣸⣿⣿⠀⠀⠀⠠⠿⠿⣿⣿⣇⣀⡸⠿⢿',
54
- '⠀⠀⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⡇⠀⢸',
55
- '⣇⠀⠘⣿⡇⠀⢸⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⢸',
56
- '⣿⣄⠀⠈⠇⠀⢸⣿⣿⣿⣿⣿⣿⠀⠀⠀⠐⢶⣶⣾',
57
- '⠿⠿⠷⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⠀⠀⣦⡀⠀⠻⣿',
58
- '⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⠀⠀⣿⣿⠀⠀⣿',
59
- '⠀⠀⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⡇⠀⢸',
60
- '⣿⣿⡏⠉⢹⣿⣿⣿⡿⠀⠀⠀⠀⣿⣿⡏⠉⢹⣿⣿',
61
- '⣿⣿⣧⣤⡜⠛⠛⠉⠀⠀⣾⠀⠀⠛⠛⣧⣤⣼⣿⣿',
62
- '⣿⣿⣿⣿⣇⣀⣠⣤⣶⣿⣿⣀⣀⣀⣀⣿⣿⣿⣿⣿',
63
- ];
64
- const LOGO_20 = [
65
- '⠀⠀⠀⠀⢸⣿⣿⣿⣿⠀⠀⣠⣶⣾⣿⠀⠀⠀⠀⠀',
66
- '⠀⠀⢠⣤⡌⠉⠙⣿⣿⣰⣿⣿⠟⠛⠉⢠⣤⡄⠀⠀',
67
- '⣀⣀⠸⠿⠇⠀⠀⣿⣿⣿⣟⣀⣀⠀⠀⠸⠿⢇⣀⡀',
68
- '⣿⣿⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⢸⣿⡇',
69
- '⠸⣿⣧⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⡇',
70
- '⠀⠻⣿⣷⣸⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⣿⣯⡉⠉⠁',
71
- '⣀⣀⣈⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⠙⢿⣿⣄⠀',
72
- '⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⣿⣿⠀⠀⣿⣿⠀',
73
- '⣿⣿⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⢸⣿⡇',
74
- '⠀⠀⢰⣶⡆⠀⠀⠀⢀⣿⣿⣿⣿⠀⠀⢲⣶⡆⠀⠀',
75
- '⠀⠀⠘⠛⢣⣤⣤⣶⣿⣿⠁⣿⣿⣤⣤⠚⠛⠃⠀⠀',
76
- '⠀⠀⠀⠀⠸⠿⠟⠛⠉⠀⠀⠿⠿⠿⠿⠀⠀⠀⠀⠀',
77
- ];
78
- const LOGO_15_A = [
79
- ' ⠀⠀⠀⢸⣿⣿⡇⣠⣶⣿⡇⠀ ',
80
- '⠀⠀⣿⡇⠀⣿⣧⣿⠟⠁⠀⠀ ⣿⡇',
81
- '⣿⣿⠀⠀⠀⣿⣿⣿⣿⣿⠀⠀⠀⢸⣿',
82
- '⠸⣿⡀⢸⣿⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿',
83
- '⠀⠹⣿⣾⣿⠀⠀⠀⠀⠀⣿⣿⣷⣄⠀',
84
- '⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⣿⡇⠈⣿⡆',
85
- '⣿⣿⠀⠀⠀⣿⣿⣿⣿⣿⠀⠀⠀⣿ ',
86
- '⠀⠀⣿⡇⠀⠀⣠⣿⢻⣿⠀⠀⣿⠀⠀',
87
- '⠀⠀⠀⢸⣿⠿⠟⠁⢸⣿⣿⡇⠀⠀ ',
88
- ];
89
- const LOGO_15_B = [
90
- '⠀⠀⠀⢸⣿⣿⡇⠀⣤⣶⣿⠅⠀⠀⠀',
91
- '⠀⠀⣿⡂⠀⣿⣧⣿⠟⠁⠀⢸⣿⠀⠀',
92
- '⣿⣿⠀⠀⠀⣿⣿⣿⣿⣿⠀⠀⠀⣿⡇',
93
- '⠸⣿⡀⢸⣿⠀⠀⠀⠀⠀⣿⣿⣿⣿⡇',
94
- '⠀⠙⣿⣿⣿⠀⠀⠀⠀⠀⣿⣿⣿⡄⠀',
95
- '⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⣿⠆⠘⣿⡀',
96
- '⣿⡿⠀⠀⠀⣿⣿⣿⣿⣿⠀⠀⠀⣿⡇',
97
- '⠀⠀⡿⠅⠀⣀⣼⡿⣿⣿⠀⢸⡿⠀⠀',
98
- '⠀⠀⠀⠸⠿⠟⠋⠀⠿⠿⠿⠅⠀⠀⠀',
99
- ];
100
- const LOGO_18 = [
101
- '⠀⠀⠀⠀⣿⣿⣿⣿⠀⣠⣴⣾⣿⣿⠀ ',
102
- '⠀⠀⣿⣿⠀⠀⣿⣿⣾⣿⠋⠁⠀⠀⣿⣿⠀⠀',
103
- '⣿⣿⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⣿⣿',
104
- '⠹⣿⣆⠀⣿⣿⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿',
105
- '⠀⠙⢿⣿⣿⣿⠀⠀⠀⠀⠀⠀⣿⣿⣿⣷⡄⠀',
106
- '⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⣿⣿⠈⠻⣿⣄',
107
- '⣿⣿⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⣿⣿',
108
- '⠀⠀⣿⣿⠀⠀⢀⣴⣿⡿⣿⣿⠀⠀⣿⣿⠀⠀',
109
- '⠀⠀⠀⠀⣿⣿⡿⠟⠉⠀⣿⣿⣿⣿⠀⠀⠀⠀',
110
- ];
111
- const LOGO_18_INV = [
112
- '⣿⣿⣿⣿⠀⠀⠀⠀⣿⠟⠉⠀⠀⠀⣿⣿⣿⣿',
113
- '⣿⣿⠀⠀⣿⣿⠀⠀⠁⢀⣤⣾⣿⣿⠀⠀⣿⣿',
114
- '⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀',
115
- '⡄⠀⠹⣿⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀',
116
- '⣿⣆⡀⠈⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⡀⠉⠻⣿',
117
- '⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⠀⠀⣿⣄⠀⠘',
118
- '⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀',
119
- '⣿⣿⠀⠀⣿⣿⡿⠟⠁⢀⠀⠀⣿⣿⠀⠀⣿⣿',
120
- '⣿⣿⣿⣿⠀⠀⠀⣀⣴⣾⠀⠀⠀⠀⣿⣿⣿⣿',
121
- ];
122
- const ALL_LOGOS = [
123
- // LOGO_3, LOGO_6, LOGO_9 are too small (commented out above, kept for reference)
124
- LOGO_12,
125
- LOGO_14,
126
- LOGO_17_BLK,
127
- LOGO_17_DOT,
128
- LOGO_20_ENV,
129
- LOGO_20,
130
- LOGO_15_A,
131
- LOGO_15_B,
132
- LOGO_18,
133
- LOGO_18_INV,
134
- ];
135
- // Pick a random logo each time the CLI starts
136
- function getRandomLogo() {
137
- const randomIndex = Math.floor(Math.random() * ALL_LOGOS.length);
138
- return ALL_LOGOS[randomIndex];
139
- }
140
- export default getRandomLogo();
141
- //# sourceMappingURL=logo.js.map
@@ -1,181 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * Server-side Lottie renderer using svgdom + lottie-web
5
- * Based on: https://medium.com/@facuparedes/server-side-lottie-rendering-a-technical-journey-3bee81d7b6c8
6
- */
7
- import { createRequire } from 'module';
8
- import { JSDOM } from 'jsdom';
9
- import { createHTMLWindow } from 'svgdom';
10
- import { svgToBraille } from './svg-to-braille.js';
11
- // Create require function for CommonJS modules in ESM
12
- const require = createRequire(import.meta.url);
13
- // Setup must happen BEFORE lottie-web is loaded
14
- let isInitialized = false;
15
- let lottie = null;
16
- // Cache for reusing animation instances (keyed by animation data reference)
17
- const animationCache = new WeakMap();
18
- function initializeGlobals() {
19
- if (isInitialized)
20
- return;
21
- // Create svgdom window and jsdom navigator
22
- const window = createHTMLWindow();
23
- const dom = new JSDOM();
24
- const document = window.document;
25
- // Polyfill canvas for lottie-web (it checks for canvas support even when using SVG renderer)
26
- const originalCreateElement = document.createElement.bind(document);
27
- document.createElement = function (tagName) {
28
- const element = originalCreateElement(tagName);
29
- if (tagName === 'canvas') {
30
- // Add minimal canvas API polyfill
31
- element.getContext = function () {
32
- return {
33
- fillStyle: '',
34
- fillRect: () => { },
35
- clearRect: () => { },
36
- getImageData: () => ({ data: [] }),
37
- putImageData: () => { },
38
- createImageData: () => ({ data: [] }),
39
- setTransform: () => { },
40
- drawImage: () => { },
41
- save: () => { },
42
- restore: () => { },
43
- beginPath: () => { },
44
- moveTo: () => { },
45
- lineTo: () => { },
46
- closePath: () => { },
47
- stroke: () => { },
48
- fill: () => { },
49
- translate: () => { },
50
- rotate: () => { },
51
- scale: () => { },
52
- arc: () => { },
53
- arcTo: () => { },
54
- quadraticCurveTo: () => { },
55
- bezierCurveTo: () => { },
56
- rect: () => { },
57
- };
58
- };
59
- element.width = 0;
60
- element.height = 0;
61
- }
62
- return element;
63
- };
64
- // Set global variables required by Lottie
65
- // Use Object.defineProperty to override read-only properties
66
- Object.defineProperty(globalThis, 'window', {
67
- value: window,
68
- writable: true,
69
- configurable: true,
70
- });
71
- Object.defineProperty(globalThis, 'document', {
72
- value: document,
73
- writable: true,
74
- configurable: true,
75
- });
76
- Object.defineProperty(globalThis, 'navigator', {
77
- value: dom.window.navigator,
78
- writable: true,
79
- configurable: true,
80
- });
81
- isInitialized = true;
82
- }
83
- function getLottie() {
84
- if (!lottie) {
85
- // Initialize globals first
86
- initializeGlobals();
87
- // Load lottie-web synchronously using require (works in Node.js ESM with createRequire)
88
- // We need to use require here because lottie-web expects a browser environment
89
- // and we've shimmed the globals
90
- const module = require('lottie-web/build/player/lottie.js');
91
- lottie =
92
- 'default' in module && module.default ? module.default : module;
93
- }
94
- if (!lottie) {
95
- throw new Error('Failed to load lottie-web');
96
- }
97
- return lottie;
98
- }
99
- /**
100
- * Get or create a cached animation instance for the given animation data
101
- */
102
- function getOrCreateAnimation(animationData) {
103
- const cached = animationCache.get(animationData);
104
- if (cached) {
105
- return cached;
106
- }
107
- const lottiePlayer = getLottie();
108
- const containerElement = globalThis.document.createElement('div');
109
- const animation = lottiePlayer.loadAnimation({
110
- container: containerElement,
111
- renderer: 'svg',
112
- loop: false,
113
- autoplay: false,
114
- animationData: animationData,
115
- });
116
- const entry = { animation, container: containerElement };
117
- animationCache.set(animationData, entry);
118
- return entry;
119
- }
120
- /**
121
- * Render a Lottie animation frame to SVG string
122
- */
123
- export function renderLottieFrameToSVG(animationData, frameNumber) {
124
- const { animation, container } = getOrCreateAnimation(animationData);
125
- // Go to specific frame
126
- animation.goToAndStop(frameNumber, true);
127
- // Get the rendered SVG
128
- return container.innerHTML;
129
- }
130
- /**
131
- * Pre-render all frames of a Lottie animation to SVG strings
132
- */
133
- export function renderLottieAnimationToSVGs(animationData) {
134
- const totalFrames = Math.floor(animationData.op || 0);
135
- const svgs = [];
136
- for (let i = 0; i < totalFrames; i++) {
137
- svgs.push(renderLottieFrameToSVG(animationData, i));
138
- }
139
- return svgs;
140
- }
141
- // Cache for rendered braille frames (keyed by frame number + dimensions)
142
- const brailleFrameCache = new Map();
143
- /**
144
- * Render a Lottie animation frame to braille strings
145
- * Uses the official lottie-web renderer + sharp-based SVG to braille converter
146
- */
147
- export async function renderLottieFrameToBraille(animationData, frameNumber, widthChars, heightChars) {
148
- // Check cache first
149
- const cacheKey = `${frameNumber}-${widthChars}x${heightChars}`;
150
- const cached = brailleFrameCache.get(cacheKey);
151
- if (cached) {
152
- return cached;
153
- }
154
- // Get SVG from lottie-web
155
- const svg = renderLottieFrameToSVG(animationData, frameNumber);
156
- // Convert SVG to braille using sharp-based bitmap renderer
157
- // This properly handles all SVG features: masks, clipping, opacity, transforms, etc.
158
- const result = await svgToBraille(svg, widthChars, heightChars);
159
- // Cache the result (limit cache size to avoid memory issues)
160
- if (brailleFrameCache.size > 200) {
161
- // Clear old entries when cache gets too large
162
- const firstKey = brailleFrameCache.keys().next().value;
163
- if (firstKey)
164
- brailleFrameCache.delete(firstKey);
165
- }
166
- brailleFrameCache.set(cacheKey, result);
167
- return result;
168
- }
169
- /**
170
- * Pre-render all frames of a Lottie animation to braille
171
- */
172
- export async function renderLottieAnimationToBraille(animationData, widthChars, heightChars) {
173
- const totalFrames = Math.floor(animationData.op || 0);
174
- const frames = [];
175
- // Render all frames
176
- for (let i = 0; i < totalFrames; i++) {
177
- frames.push(await renderLottieFrameToBraille(animationData, i, widthChars, heightChars));
178
- }
179
- return frames;
180
- }
181
- //# sourceMappingURL=lottie-serverside.js.map
@@ -1,38 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { marked } from 'marked';
4
- import { markedTerminal } from 'marked-terminal';
5
- import chalk from 'chalk';
6
- import { code } from './colors.js';
7
- // Configure marked for terminal output
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- marked.use(markedTerminal({}, { theme: {} }));
10
- /**
11
- * Post-process markdown to fix unrendered inline markdown in list items.
12
- * marked-terminal has a bug where it uses parse() instead of parseInline()
13
- * for list items, leaving **bold** and `code` unrendered.
14
- */
15
- export function fixListItemMarkdown(text) {
16
- // Handle bold/strong: **text** -> bold text
17
- text = text.replace(/\*\*([^*]+)\*\*/g, (_, content) => chalk.bold(content));
18
- // Handle inline code: `text` -> highlighted text
19
- text = text.replace(/`([^`]+)`/g, (_, content) => code(content));
20
- // Handle italic: _text_ -> italic (underscore style, less ambiguous)
21
- text = text.replace(/(?<![\\w])_([^_]+)_(?![\\w])/g, (_, content) => chalk.italic(content));
22
- return text;
23
- }
24
- /**
25
- * Render markdown to terminal-formatted string
26
- */
27
- export async function renderMarkdown(content) {
28
- const rendered = await marked(content);
29
- return fixListItemMarkdown(rendered);
30
- }
31
- /**
32
- * Render markdown synchronously (for use in non-async contexts)
33
- */
34
- export function renderMarkdownSync(content) {
35
- const rendered = marked.parse(content);
36
- return fixListItemMarkdown(rendered);
37
- }
38
- //# sourceMappingURL=markdown.js.map
package/dist/lib/npmrc.js DELETED
@@ -1,59 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { execa } from 'execa';
4
- import { getGuildcoreUrl } from './config.js';
5
- import { getAuthToken } from './auth.js';
6
- import { debug } from './errors.js';
7
- function getRegistryUrl() {
8
- const url = getGuildcoreUrl();
9
- return url.replace('/api', '/npm') + (url.endsWith('/') ? '' : '/');
10
- }
11
- const SCOPES = ['@guildai-services', '@guildai-agents'];
12
- const LEGACY_SCOPES = ['@guildai'];
13
- export async function configureNpmrc() {
14
- const registryUrl = getRegistryUrl();
15
- const scope = registryUrl.split(':').slice(1).join(':');
16
- const authToken = await getAuthToken();
17
- if (!authToken) {
18
- throw new Error('No authentication token found');
19
- }
20
- try {
21
- await execa('npm', [
22
- '--workspaces=false',
23
- 'config',
24
- 'set',
25
- '--location',
26
- 'user',
27
- ...SCOPES.map((s) => `${s}:registry=${registryUrl}`),
28
- `${scope}:_authToken=${authToken}`,
29
- ]);
30
- }
31
- catch (error) {
32
- debug('Failed to configure npm registry:', error);
33
- throw new Error('Failed to configure npm registry. Is npm installed?');
34
- }
35
- }
36
- export async function cleanupNpmrc() {
37
- const registryUrl = getRegistryUrl();
38
- const scope = registryUrl.split(':').slice(1).join(':');
39
- const keys = [
40
- ...[...SCOPES, ...LEGACY_SCOPES].map((s) => `${s}:registry`),
41
- `${scope}:_authToken`,
42
- ];
43
- for (const key of keys) {
44
- try {
45
- await execa('npm', [
46
- '--workspaces=false',
47
- 'config',
48
- 'delete',
49
- '--location',
50
- 'user',
51
- key,
52
- ]);
53
- }
54
- catch {
55
- // Key may not exist, that's fine
56
- }
57
- }
58
- }
59
- //# sourceMappingURL=npmrc.js.map
@@ -1,33 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- /**
4
- * Output mode detection for the CLI
5
- *
6
- * Interactive mode (default): Colors, tables, spinners, interactive
7
- * JSON mode (--json): Pure JSON, non-interactive, machine-readable
8
- */
9
- import { getConfigFlag } from './config-cache.js';
10
- /**
11
- * Detect output mode from CLI flags or config
12
- *
13
- * Checks --json flag and config. CLI flag overrides config.
14
- * Does NOT auto-detect pipes (user must request JSON explicitly).
15
- */
16
- export function getOutputMode() {
17
- if (process.argv.includes('--json') || getConfigFlag('json')) {
18
- return 'json';
19
- }
20
- return 'interactive';
21
- }
22
- /**
23
- * Check if quiet mode is enabled (CLI flag or config)
24
- *
25
- * Quiet mode suppresses progress and log messages to stderr.
26
- * Errors are still shown.
27
- */
28
- export function isQuietMode() {
29
- return (process.argv.includes('--quiet') ||
30
- process.argv.includes('-q') ||
31
- getConfigFlag('quiet'));
32
- }
33
- //# sourceMappingURL=output-mode.js.map