@grackle-ai/web-components 0.107.2 → 0.108.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 (34) hide show
  1. package/.rush/temp/c8da732c75a50be68d2a40b1c14aeab2654cc1af.tar.log +240 -0
  2. package/.rush/temp/{3ae72563f781afd72723475938136f113846603e.untar.log → c8da732c75a50be68d2a40b1c14aeab2654cc1af.untar.log} +2 -2
  3. package/.rush/temp/chunked-rush-logs/web-components._phase_build.chunks.jsonl +18 -0
  4. package/.rush/temp/chunked-rush-logs/web-components._phase_test.chunks.jsonl +121 -0
  5. package/.rush/temp/fb761ea36fead333e4d2b59ce5ade8fb1bc8d724.tar.log +12 -0
  6. package/.rush/temp/{bc1d5bf9201ce71abeaeaddd096deb9b0805d703.untar.log → fb761ea36fead333e4d2b59ce5ade8fb1bc8d724.untar.log} +2 -2
  7. package/.rush/temp/operation/_phase_build/all.log +5 -5
  8. package/.rush/temp/operation/_phase_build/log-chunks.jsonl +5 -5
  9. package/.rush/temp/operation/_phase_build/state.json +1 -1
  10. package/.rush/temp/operation/_phase_test/all.log +17 -17
  11. package/.rush/temp/operation/_phase_test/log-chunks.jsonl +17 -17
  12. package/.rush/temp/operation/_phase_test/state.json +1 -1
  13. package/dist/index.js +7038 -6764
  14. package/package.json +2 -2
  15. package/rush-logs/web-components._phase_build.cache.log +1 -1
  16. package/rush-logs/web-components._phase_build.log +18 -0
  17. package/rush-logs/web-components._phase_test.cache.log +1 -1
  18. package/rush-logs/web-components._phase_test.log +121 -0
  19. package/src/components/panels/EnvironmentEditPanel.stories.tsx +1 -0
  20. package/src/components/panels/EnvironmentEditPanel.tsx +65 -8
  21. package/src/components/panels/GitHubAccountsPanel.tsx +223 -0
  22. package/src/components/panels/index.ts +2 -0
  23. package/src/components/settings/SettingsNav.stories.tsx +11 -10
  24. package/src/components/settings/SettingsNav.tsx +2 -1
  25. package/src/context/GrackleContextTypes.ts +3 -0
  26. package/src/hooks/types.ts +36 -3
  27. package/src/index.ts +4 -3
  28. package/src/mocks/MockGrackleProvider.tsx +21 -0
  29. package/src/mocks/mockData.ts +5 -0
  30. package/src/test-utils/storybook-helpers.ts +1 -0
  31. package/src/utils/breadcrumbs.test.ts +1 -0
  32. package/src/utils/dashboard.test.ts +1 -0
  33. package/src/utils/navigation.ts +3 -0
  34. package/temp/build/lint/_eslint-5eVG3S6w.json +810 -0
@@ -32,6 +32,8 @@ export interface Environment {
32
32
  adapterConfig: string;
33
33
  status: string;
34
34
  bootstrapped: boolean;
35
+ /** ID of the GitHub account to use for gh CLI operations, or empty string for default. */
36
+ githubAccountId: string;
35
37
  }
36
38
 
37
39
 
@@ -223,11 +225,12 @@ export interface UseEnvironmentsResult {
223
225
  displayName: string,
224
226
  adapterType: string,
225
227
  adapterConfig?: Record<string, unknown>,
228
+ githubAccountId?: string,
226
229
  ) => Promise<void>;
227
230
  /** Update an existing environment's mutable fields. */
228
231
  updateEnvironment: (
229
232
  environmentId: string,
230
- fields: { displayName?: string; adapterConfig?: Record<string, unknown> },
233
+ fields: { displayName?: string; adapterConfig?: Record<string, unknown>; githubAccountId?: string },
231
234
  ) => Promise<void>;
232
235
  /** Provision an environment by ID. When force is true, kills active sessions and forces full provision. */
233
236
  provisionEnvironment: (environmentId: string, force?: boolean) => Promise<void>;
@@ -269,6 +272,7 @@ export interface UseSessionsResult {
269
272
  prompt: string,
270
273
  personaId?: string,
271
274
  workingDirectory?: string,
275
+ workspaceId?: string,
272
276
  ) => Promise<void>;
273
277
  /** Send text input to a running session. */
274
278
  sendInput: (sessionId: string, text: string) => Promise<void>;
@@ -484,8 +488,8 @@ export interface UseCodespacesResult {
484
488
  codespaceListError: string;
485
489
  /** Whether a codespace creation is currently in progress. */
486
490
  codespaceCreating: boolean;
487
- /** Request the current codespace list from the server. */
488
- listCodespaces: () => Promise<void>;
491
+ /** Request the current codespace list from the server, optionally filtered to a GitHub account. */
492
+ listCodespaces: (githubAccountId?: string) => Promise<void>;
489
493
  /** Create a new codespace for the given repo. */
490
494
  createCodespace: (repo: string, machine?: string) => Promise<void>;
491
495
  /** Lifecycle hook for connect/disconnect/event routing. */
@@ -854,6 +858,35 @@ export interface UsePluginsResult {
854
858
  domainHook: DomainHook;
855
859
  }
856
860
 
861
+ /** A registered GitHub account (token is never returned by the server). */
862
+ export interface GitHubAccountData {
863
+ id: string;
864
+ label: string;
865
+ username: string;
866
+ isDefault: boolean;
867
+ createdAt: string;
868
+ }
869
+
870
+ /** Values returned by the GitHub accounts domain hook. */
871
+ export interface UseGitHubAccountsResult {
872
+ /** All registered GitHub accounts. */
873
+ githubAccounts: GitHubAccountData[];
874
+ /** Whether the account list is currently loading. */
875
+ githubAccountsLoading: boolean;
876
+ /** Refresh the account list from the server. */
877
+ loadGitHubAccounts: () => Promise<void>;
878
+ /** Register a new GitHub account. */
879
+ addGitHubAccount: (label: string, token: string, username: string, isDefault: boolean) => Promise<void>;
880
+ /** Update an existing GitHub account. */
881
+ updateGitHubAccount: (id: string, fields: { label?: string; token?: string; isDefault?: boolean }) => Promise<void>;
882
+ /** Remove a GitHub account by ID. */
883
+ removeGitHubAccount: (id: string) => Promise<void>;
884
+ /** Import accounts from the local gh CLI authentication state. */
885
+ importGitHubAccounts: () => Promise<{ imported: number; usernames: string[] }>;
886
+ /** Lifecycle hook for connect/disconnect/event routing. */
887
+ domainHook: DomainHook;
888
+ }
889
+
857
890
  /** Delay in milliseconds before attempting a WebSocket reconnect. */
858
891
  export const WS_RECONNECT_DELAY_MS: number = 3_000;
859
892
 
package/src/index.ts CHANGED
@@ -63,8 +63,8 @@ export type { CalloutVariant } from "./components/notifications/index.js";
63
63
  export { UpdateBanner } from "./components/notifications/UpdateBanner.js";
64
64
 
65
65
  // Panels
66
- export { FindingsPanel, TokensPanel, AppearancePanel, AboutPanel, TaskEditPanel, TaskActionButtons, TaskOverviewPanel, PluginsPanel } from "./components/panels/index.js";
67
- export type { PluginsPanelProps } from "./components/panels/index.js";
66
+ export { FindingsPanel, TokensPanel, AppearancePanel, AboutPanel, TaskEditPanel, TaskActionButtons, TaskOverviewPanel, PluginsPanel, GitHubAccountsPanel } from "./components/panels/index.js";
67
+ export type { PluginsPanelProps, GitHubAccountsPanelProps } from "./components/panels/index.js";
68
68
  export type { TaskActionButtonsProps } from "./components/panels/TaskActionButtons.js";
69
69
  export type { TaskOverviewPanelProps } from "./components/panels/TaskOverviewPanel.js";
70
70
  export { EnvironmentEditPanel } from "./components/panels/EnvironmentEditPanel.js";
@@ -134,6 +134,7 @@ export type {
134
134
  UseCredentialsResult, UseCodespacesResult, UsePersonasResult,
135
135
  UsePluginsResult, PluginData,
136
136
  StreamData, StreamSubscriberData, UseStreamsResult,
137
+ UseGitHubAccountsResult, GitHubAccountData,
137
138
  DomainHook,
138
139
  ConnectionStatus,
139
140
  } from "./hooks/types.js";
@@ -156,7 +157,7 @@ export {
156
157
  useAppNavigate, sessionUrl, workspaceUrl, taskUrl, taskEditUrl,
157
158
  newTaskUrl, newChatUrl, ENVIRONMENTS_URL, NEW_ENVIRONMENT_URL,
158
159
  environmentUrl, environmentEditUrl, SETTINGS_URL,
159
- SETTINGS_ENVIRONMENTS_URL, SETTINGS_CREDENTIALS_URL,
160
+ SETTINGS_ENVIRONMENTS_URL, SETTINGS_CREDENTIALS_URL, SETTINGS_GITHUB_ACCOUNTS_URL,
160
161
  PERSONAS_URL, NEW_PERSONA_URL, personaUrl,
161
162
  SCHEDULES_URL, NEW_SCHEDULE_URL, scheduleUrl,
162
163
  SETTINGS_APPEARANCE_URL, SETTINGS_ABOUT_URL, SETTINGS_SHORTCUTS_URL,
@@ -1300,6 +1300,27 @@ export function MockGrackleProvider({ children }: MockGrackleProviderProps): JSX
1300
1300
  domainHook: NOOP_DOMAIN_HOOK,
1301
1301
  },
1302
1302
 
1303
+ // ── GitHub Accounts ──────────────────────────────
1304
+
1305
+ githubAccounts: {
1306
+ githubAccounts: [],
1307
+ githubAccountsLoading: false,
1308
+ loadGitHubAccounts: async () => { console.log("[MockGrackle] loadGitHubAccounts"); },
1309
+ addGitHubAccount: async (label: string, _token: string, _username: string, _isDefault: boolean) => {
1310
+ console.log("[MockGrackle] addGitHubAccount", label);
1311
+ },
1312
+ updateGitHubAccount: async (id: string, fields: { label?: string; token?: string; isDefault?: boolean }) => {
1313
+ console.log("[MockGrackle] updateGitHubAccount", id, fields);
1314
+ },
1315
+ removeGitHubAccount: async (id: string) => {
1316
+ console.log("[MockGrackle] removeGitHubAccount", id);
1317
+ },
1318
+ importGitHubAccounts: async () => {
1319
+ console.log("[MockGrackle] importGitHubAccounts");
1320
+ return { imported: 0, usernames: [] };
1321
+ },
1322
+ },
1323
+
1303
1324
  // ── Plugins ─────────────────────────────────────
1304
1325
 
1305
1326
  plugins: {
@@ -29,6 +29,7 @@ export const MOCK_ENVIRONMENTS: Environment[] = [
29
29
  adapterConfig: "{}",
30
30
  status: "connected",
31
31
  bootstrapped: true,
32
+ githubAccountId: "",
32
33
  },
33
34
  {
34
35
  id: "env-docker-01",
@@ -37,6 +38,7 @@ export const MOCK_ENVIRONMENTS: Environment[] = [
37
38
  adapterConfig: '{"image":"node:20"}',
38
39
  status: "connected",
39
40
  bootstrapped: true,
41
+ githubAccountId: "",
40
42
  },
41
43
  {
42
44
  id: "env-cs-01",
@@ -45,6 +47,7 @@ export const MOCK_ENVIRONMENTS: Environment[] = [
45
47
  adapterConfig: '{"codespaceName":"my-codespace"}',
46
48
  status: "connected",
47
49
  bootstrapped: true,
50
+ githubAccountId: "",
48
51
  },
49
52
  {
50
53
  id: "env-remote-01",
@@ -53,6 +56,7 @@ export const MOCK_ENVIRONMENTS: Environment[] = [
53
56
  adapterConfig: '{"host":"192.168.1.10","user":"deploy","sshPort":22}',
54
57
  status: "disconnected",
55
58
  bootstrapped: false,
59
+ githubAccountId: "",
56
60
  },
57
61
  {
58
62
  id: "error-env",
@@ -61,6 +65,7 @@ export const MOCK_ENVIRONMENTS: Environment[] = [
61
65
  adapterConfig: "{}",
62
66
  status: "connected",
63
67
  bootstrapped: true,
68
+ githubAccountId: "",
64
69
  },
65
70
  ];
66
71
 
@@ -48,6 +48,7 @@ export function makeEnvironment(overrides: Partial<Environment> = {}): Environme
48
48
  adapterConfig: "{}",
49
49
  status: "connected",
50
50
  bootstrapped: true,
51
+ githubAccountId: "",
51
52
  ...overrides,
52
53
  };
53
54
  }
@@ -43,6 +43,7 @@ function makeEnvironment(id: string, displayName: string): Environment {
43
43
  adapterConfig: "",
44
44
  status: "connected",
45
45
  bootstrapped: true,
46
+ githubAccountId: "",
46
47
  };
47
48
  }
48
49
 
@@ -66,6 +66,7 @@ function makeEnvironment(id: string, displayName: string, status: string): Envir
66
66
  adapterConfig: "{}",
67
67
  status,
68
68
  bootstrapped: true,
69
+ githubAccountId: "",
69
70
  };
70
71
  }
71
72
 
@@ -122,6 +122,9 @@ export const SETTINGS_ENVIRONMENTS_URL: string = "/settings/environments";
122
122
  /** URL for the settings credentials tab. */
123
123
  export const SETTINGS_CREDENTIALS_URL: string = "/settings/credentials";
124
124
 
125
+ /** URL for the GitHub accounts settings tab. */
126
+ export const SETTINGS_GITHUB_ACCOUNTS_URL: string = "/settings/github-accounts";
127
+
125
128
  /** URL for the persona management tab. */
126
129
  export const PERSONAS_URL: string = "/settings/personas";
127
130