@agentconnect/ui 0.1.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 (68) hide show
  1. package/README.md +63 -0
  2. package/dist/client.d.ts +15 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +22 -0
  5. package/dist/components/connect.d.ts +79 -0
  6. package/dist/components/connect.d.ts.map +1 -0
  7. package/dist/components/connect.js +1110 -0
  8. package/dist/components/index.d.ts +8 -0
  9. package/dist/components/index.d.ts.map +1 -0
  10. package/dist/components/index.js +7 -0
  11. package/dist/components/login-button.d.ts +16 -0
  12. package/dist/components/login-button.d.ts.map +1 -0
  13. package/dist/components/login-button.js +69 -0
  14. package/dist/components/model-picker.d.ts +16 -0
  15. package/dist/components/model-picker.d.ts.map +1 -0
  16. package/dist/components/model-picker.js +61 -0
  17. package/dist/components/provider-status.d.ts +10 -0
  18. package/dist/components/provider-status.d.ts.map +1 -0
  19. package/dist/components/provider-status.js +42 -0
  20. package/dist/constants.d.ts +33 -0
  21. package/dist/constants.d.ts.map +1 -0
  22. package/dist/constants.js +156 -0
  23. package/dist/index.d.ts +11 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +13 -0
  26. package/dist/register.d.ts +9 -0
  27. package/dist/register.d.ts.map +1 -0
  28. package/dist/register.js +25 -0
  29. package/dist/styles/base.d.ts +5 -0
  30. package/dist/styles/base.d.ts.map +1 -0
  31. package/dist/styles/base.js +49 -0
  32. package/dist/styles/buttons.d.ts +6 -0
  33. package/dist/styles/buttons.d.ts.map +1 -0
  34. package/dist/styles/buttons.js +206 -0
  35. package/dist/styles/cards.d.ts +5 -0
  36. package/dist/styles/cards.d.ts.map +1 -0
  37. package/dist/styles/cards.js +212 -0
  38. package/dist/styles/index.d.ts +20 -0
  39. package/dist/styles/index.d.ts.map +1 -0
  40. package/dist/styles/index.js +42 -0
  41. package/dist/styles/inputs.d.ts +5 -0
  42. package/dist/styles/inputs.d.ts.map +1 -0
  43. package/dist/styles/inputs.js +79 -0
  44. package/dist/styles/panels.d.ts +5 -0
  45. package/dist/styles/panels.d.ts.map +1 -0
  46. package/dist/styles/panels.js +184 -0
  47. package/dist/styles/responsive.d.ts +5 -0
  48. package/dist/styles/responsive.d.ts.map +1 -0
  49. package/dist/styles/responsive.js +62 -0
  50. package/dist/styles/utilities.d.ts +5 -0
  51. package/dist/styles/utilities.d.ts.map +1 -0
  52. package/dist/styles/utilities.js +86 -0
  53. package/dist/types.d.ts +137 -0
  54. package/dist/types.d.ts.map +1 -0
  55. package/dist/types.js +4 -0
  56. package/dist/utils/dom.d.ts +24 -0
  57. package/dist/utils/dom.d.ts.map +1 -0
  58. package/dist/utils/dom.js +42 -0
  59. package/dist/utils/html.d.ts +8 -0
  60. package/dist/utils/html.d.ts.map +1 -0
  61. package/dist/utils/html.js +11 -0
  62. package/dist/utils/index.d.ts +7 -0
  63. package/dist/utils/index.d.ts.map +1 -0
  64. package/dist/utils/index.js +6 -0
  65. package/dist/utils/storage.d.ts +29 -0
  66. package/dist/utils/storage.d.ts.map +1 -0
  67. package/dist/utils/storage.js +110 -0
  68. package/package.json +40 -0
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Panel, modal, and popover styles.
3
+ */
4
+ export const panelStyles = `
5
+ .ac-overlay {
6
+ position: fixed;
7
+ inset: 0;
8
+ display: none;
9
+ z-index: 9999;
10
+ background: rgba(8, 12, 20, 0.6);
11
+ backdrop-filter: blur(10px);
12
+ }
13
+ .ac-overlay.open {
14
+ display: block;
15
+ }
16
+ .ac-overlay[data-mode="popover"] {
17
+ background: transparent;
18
+ backdrop-filter: none;
19
+ }
20
+ .ac-panel {
21
+ background: linear-gradient(
22
+ 165deg,
23
+ rgba(255, 255, 255, 0.97) 0%,
24
+ rgba(250, 251, 254, 0.95) 50%,
25
+ rgba(255, 255, 255, 0.97) 100%
26
+ );
27
+ color: var(--ac-modal-color, #1a1f2e);
28
+ border-radius: 24px;
29
+ border: 1.5px solid rgba(195, 165, 90, 0.35);
30
+ box-shadow:
31
+ 0 0 0 1px rgba(210, 180, 100, 0.12),
32
+ 0 8px 32px rgba(0, 0, 0, 0.08),
33
+ 0 30px 90px rgba(8, 12, 20, 0.12);
34
+ padding: 20px;
35
+ gap: 16px;
36
+ position: fixed;
37
+ display: none;
38
+ backdrop-filter: blur(20px);
39
+ -webkit-backdrop-filter: blur(20px);
40
+ }
41
+ .ac-panel[data-active="true"] {
42
+ display: grid;
43
+ }
44
+ .ac-modal {
45
+ width: min(420px, 92vw);
46
+ left: 50%;
47
+ top: 50%;
48
+ transform: translate(-50%, -50%);
49
+ padding: 24px;
50
+ box-shadow:
51
+ 0 0 0 1px rgba(210, 180, 100, 0.15),
52
+ 0 12px 40px rgba(0, 0, 0, 0.1),
53
+ 0 40px 110px rgba(8, 12, 20, 0.15);
54
+ }
55
+ .ac-popover {
56
+ width: min(320px, 92vw);
57
+ top: var(--ac-popover-top, 80px);
58
+ left: var(--ac-popover-left, 20px);
59
+ transform-origin: top left;
60
+ padding: 14px 16px;
61
+ gap: 10px;
62
+ box-shadow:
63
+ 0 0 0 1px rgba(210, 180, 100, 0.12),
64
+ 0 8px 28px rgba(0, 0, 0, 0.08),
65
+ 0 24px 70px rgba(8, 12, 20, 0.12);
66
+ }
67
+ .ac-modal-header {
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: space-between;
71
+ gap: 12px;
72
+ }
73
+ .ac-modal-title {
74
+ font-size: 20px;
75
+ font-weight: 700;
76
+ letter-spacing: 0.01em;
77
+ }
78
+ .ac-modal-subtitle {
79
+ font-size: 12px;
80
+ color: var(--ac-muted, #556070);
81
+ text-transform: uppercase;
82
+ letter-spacing: 0.14em;
83
+ }
84
+ .ac-progress {
85
+ display: grid;
86
+ gap: 8px;
87
+ }
88
+ .ac-progress[hidden] {
89
+ display: none;
90
+ }
91
+ .ac-progress-track {
92
+ height: 6px;
93
+ border-radius: 999px;
94
+ background: rgba(200, 170, 90, 0.2);
95
+ overflow: hidden;
96
+ }
97
+ .ac-progress-bar {
98
+ height: 100%;
99
+ width: 35%;
100
+ border-radius: 999px;
101
+ background: var(--ac-accent, #c4542a);
102
+ animation: ac-progress 1.2s ease-in-out infinite;
103
+ }
104
+ .ac-progress-label {
105
+ font-size: 12px;
106
+ color: var(--ac-muted, #556070);
107
+ }
108
+ .ac-popover-title {
109
+ font-size: 16px;
110
+ font-weight: 700;
111
+ }
112
+ .ac-popover-subtitle {
113
+ font-size: 12px;
114
+ color: var(--ac-muted, #556070);
115
+ }
116
+ .ac-section-title {
117
+ font-size: 12px;
118
+ text-transform: uppercase;
119
+ letter-spacing: 0.12em;
120
+ color: var(--ac-muted, #556070);
121
+ font-weight: 700;
122
+ }
123
+ .ac-actions {
124
+ display: flex;
125
+ align-items: center;
126
+ justify-content: space-between;
127
+ gap: 12px;
128
+ flex-wrap: wrap;
129
+ }
130
+ .ac-popover .ac-actions {
131
+ justify-content: flex-end;
132
+ margin-top: 2px;
133
+ padding-top: 6px;
134
+ border-top: 1px solid rgba(195, 165, 90, 0.15);
135
+ }
136
+ .ac-actions-right {
137
+ display: flex;
138
+ gap: 8px;
139
+ }
140
+ .ac-panel {
141
+ opacity: 0;
142
+ transition: opacity 0.2s ease, transform 0.2s ease;
143
+ }
144
+ .ac-panel[data-active="true"] {
145
+ opacity: 1;
146
+ }
147
+ .ac-modal {
148
+ transform: translate(-50%, calc(-50% + 8px));
149
+ }
150
+ .ac-modal[data-active="true"] {
151
+ transform: translate(-50%, -50%);
152
+ }
153
+ .ac-popover {
154
+ transform: translateY(8px);
155
+ }
156
+ .ac-popover[data-active="true"] {
157
+ transform: translateY(0);
158
+ }
159
+ .ac-overlay {
160
+ opacity: 0;
161
+ transition: opacity 0.2s ease;
162
+ pointer-events: none;
163
+ }
164
+ .ac-overlay.open {
165
+ opacity: 1;
166
+ pointer-events: auto;
167
+ }
168
+ .ac-panel[data-busy="true"] .ac-section {
169
+ pointer-events: none;
170
+ opacity: 0.55;
171
+ }
172
+
173
+ @keyframes ac-progress {
174
+ 0% {
175
+ transform: translateX(-120%);
176
+ }
177
+ 50% {
178
+ transform: translateX(40%);
179
+ }
180
+ 100% {
181
+ transform: translateX(180%);
182
+ }
183
+ }
184
+ `;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Responsive and touch-friendly styles.
3
+ */
4
+ export declare const responsiveStyles = "\n @media (max-width: 480px) {\n .ac-modal {\n width: 100vw;\n max-width: 100vw;\n border-radius: 20px 20px 0 0;\n top: auto;\n bottom: 0;\n left: 0;\n transform: none;\n max-height: 85vh;\n overflow-y: auto;\n }\n .ac-popover {\n width: calc(100vw - 24px);\n left: 12px !important;\n }\n .ac-provider-card {\n grid-template-columns: 1fr;\n gap: 10px;\n }\n .ac-provider-actions {\n justify-content: flex-start;\n }\n .ac-actions {\n flex-direction: column;\n }\n .ac-actions .ac-button {\n width: 100%;\n justify-content: center;\n }\n .ac-actions-right {\n width: 100%;\n flex-direction: column;\n }\n }\n @media (pointer: coarse) {\n .ac-button {\n min-height: 44px;\n }\n .ac-input, .ac-select {\n min-height: 48px;\n }\n .ac-provider-card {\n min-height: 72px;\n }\n }\n @media (hover: none) {\n .ac-button:hover:not([disabled]) {\n transform: none;\n box-shadow: none;\n }\n .ac-provider-card:hover {\n transform: none;\n border-color: var(--ac-card-border, #e3e8ef);\n box-shadow: none;\n }\n }\n";
5
+ //# sourceMappingURL=responsive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../src/styles/responsive.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,gBAAgB,qsCA0D5B,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Responsive and touch-friendly styles.
3
+ */
4
+ export const responsiveStyles = `
5
+ @media (max-width: 480px) {
6
+ .ac-modal {
7
+ width: 100vw;
8
+ max-width: 100vw;
9
+ border-radius: 20px 20px 0 0;
10
+ top: auto;
11
+ bottom: 0;
12
+ left: 0;
13
+ transform: none;
14
+ max-height: 85vh;
15
+ overflow-y: auto;
16
+ }
17
+ .ac-popover {
18
+ width: calc(100vw - 24px);
19
+ left: 12px !important;
20
+ }
21
+ .ac-provider-card {
22
+ grid-template-columns: 1fr;
23
+ gap: 10px;
24
+ }
25
+ .ac-provider-actions {
26
+ justify-content: flex-start;
27
+ }
28
+ .ac-actions {
29
+ flex-direction: column;
30
+ }
31
+ .ac-actions .ac-button {
32
+ width: 100%;
33
+ justify-content: center;
34
+ }
35
+ .ac-actions-right {
36
+ width: 100%;
37
+ flex-direction: column;
38
+ }
39
+ }
40
+ @media (pointer: coarse) {
41
+ .ac-button {
42
+ min-height: 44px;
43
+ }
44
+ .ac-input, .ac-select {
45
+ min-height: 48px;
46
+ }
47
+ .ac-provider-card {
48
+ min-height: 72px;
49
+ }
50
+ }
51
+ @media (hover: none) {
52
+ .ac-button:hover:not([disabled]) {
53
+ transform: none;
54
+ box-shadow: none;
55
+ }
56
+ .ac-provider-card:hover {
57
+ transform: none;
58
+ border-color: var(--ac-card-border, #e3e8ef);
59
+ box-shadow: none;
60
+ }
61
+ }
62
+ `;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Utility styles - spinner, skeleton, alerts.
3
+ */
4
+ export declare const utilityStyles = "\n .ac-spinner {\n width: 16px;\n height: 16px;\n border: 2px solid var(--ac-spinner-track, #e3e8ef);\n border-top-color: var(--ac-spinner-color, #2f6bff);\n border-radius: 50%;\n animation: ac-spin 0.8s linear infinite;\n display: inline-block;\n }\n @keyframes ac-spin {\n to { transform: rotate(360deg); }\n }\n .ac-skeleton {\n background: linear-gradient(90deg, #e3e8ef 25%, #f5f8fc 50%, #e3e8ef 75%);\n background-size: 200% 100%;\n animation: ac-shimmer 1.5s ease-in-out infinite;\n border-radius: 8px;\n }\n @keyframes ac-shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n .ac-alert {\n background: linear-gradient(\n 165deg,\n rgba(255, 255, 255, 0.85) 0%,\n rgba(250, 249, 247, 0.8) 100%\n );\n color: rgba(80, 70, 50, 0.9);\n border: 1px solid rgba(195, 165, 90, 0.28);\n border-radius: 12px;\n padding: 12px 14px;\n font-size: 13px;\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.8),\n 0 1px 3px rgba(0, 0, 0, 0.03);\n }\n .ac-alert {\n display: grid;\n gap: 4px;\n }\n .ac-alert-title {\n font-weight: 600;\n font-size: 13px;\n }\n .ac-alert-message {\n font-size: 12px;\n opacity: 0.85;\n line-height: 1.4;\n }\n .ac-alert.error {\n background: linear-gradient(\n 165deg,\n rgba(255, 250, 248, 0.95) 0%,\n rgba(255, 245, 242, 0.9) 100%\n );\n border-color: rgba(200, 140, 120, 0.4);\n color: rgba(160, 80, 60, 0.95);\n }\n .ac-alert-actions {\n margin-top: 8px;\n }\n .ac-alert-actions .ac-button {\n padding: 6px 12px;\n font-size: 12px;\n }\n .ac-model-loading {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 14px;\n font-size: 13px;\n color: var(--ac-muted, #556070);\n background: linear-gradient(\n 165deg,\n rgba(255, 255, 255, 0.9) 0%,\n rgba(250, 251, 254, 0.85) 100%\n );\n border: 1px solid rgba(195, 165, 90, 0.25);\n border-radius: 10px;\n }\n";
5
+ //# sourceMappingURL=utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/styles/utilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa,8gEAkFzB,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Utility styles - spinner, skeleton, alerts.
3
+ */
4
+ export const utilityStyles = `
5
+ .ac-spinner {
6
+ width: 16px;
7
+ height: 16px;
8
+ border: 2px solid var(--ac-spinner-track, #e3e8ef);
9
+ border-top-color: var(--ac-spinner-color, #2f6bff);
10
+ border-radius: 50%;
11
+ animation: ac-spin 0.8s linear infinite;
12
+ display: inline-block;
13
+ }
14
+ @keyframes ac-spin {
15
+ to { transform: rotate(360deg); }
16
+ }
17
+ .ac-skeleton {
18
+ background: linear-gradient(90deg, #e3e8ef 25%, #f5f8fc 50%, #e3e8ef 75%);
19
+ background-size: 200% 100%;
20
+ animation: ac-shimmer 1.5s ease-in-out infinite;
21
+ border-radius: 8px;
22
+ }
23
+ @keyframes ac-shimmer {
24
+ 0% { background-position: 200% 0; }
25
+ 100% { background-position: -200% 0; }
26
+ }
27
+ .ac-alert {
28
+ background: linear-gradient(
29
+ 165deg,
30
+ rgba(255, 255, 255, 0.85) 0%,
31
+ rgba(250, 249, 247, 0.8) 100%
32
+ );
33
+ color: rgba(80, 70, 50, 0.9);
34
+ border: 1px solid rgba(195, 165, 90, 0.28);
35
+ border-radius: 12px;
36
+ padding: 12px 14px;
37
+ font-size: 13px;
38
+ box-shadow:
39
+ inset 0 1px 0 rgba(255, 255, 255, 0.8),
40
+ 0 1px 3px rgba(0, 0, 0, 0.03);
41
+ }
42
+ .ac-alert {
43
+ display: grid;
44
+ gap: 4px;
45
+ }
46
+ .ac-alert-title {
47
+ font-weight: 600;
48
+ font-size: 13px;
49
+ }
50
+ .ac-alert-message {
51
+ font-size: 12px;
52
+ opacity: 0.85;
53
+ line-height: 1.4;
54
+ }
55
+ .ac-alert.error {
56
+ background: linear-gradient(
57
+ 165deg,
58
+ rgba(255, 250, 248, 0.95) 0%,
59
+ rgba(255, 245, 242, 0.9) 100%
60
+ );
61
+ border-color: rgba(200, 140, 120, 0.4);
62
+ color: rgba(160, 80, 60, 0.95);
63
+ }
64
+ .ac-alert-actions {
65
+ margin-top: 8px;
66
+ }
67
+ .ac-alert-actions .ac-button {
68
+ padding: 6px 12px;
69
+ font-size: 12px;
70
+ }
71
+ .ac-model-loading {
72
+ display: flex;
73
+ align-items: center;
74
+ gap: 8px;
75
+ padding: 10px 14px;
76
+ font-size: 13px;
77
+ color: var(--ac-muted, #556070);
78
+ background: linear-gradient(
79
+ 165deg,
80
+ rgba(255, 255, 255, 0.9) 0%,
81
+ rgba(250, 251, 254, 0.85) 100%
82
+ );
83
+ border: 1px solid rgba(195, 165, 90, 0.25);
84
+ border-radius: 10px;
85
+ }
86
+ `;
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Type definitions for AgentConnect UI components.
3
+ */
4
+ export type { ProviderId, ProviderInfo, ModelInfo, ReasoningEffortOption, AgentConnectClient, PackageManager, InstallResult, } from '@agentconnect/sdk';
5
+ import type { ProviderId, ProviderInfo, ModelInfo } from '@agentconnect/sdk';
6
+ /**
7
+ * Extended provider info with loading state for UI rendering.
8
+ */
9
+ export interface ProviderInfoWithPending extends ProviderInfo {
10
+ pending?: boolean;
11
+ }
12
+ /**
13
+ * Configuration for the local provider (Ollama, LM Studio, etc.).
14
+ */
15
+ export interface LocalProviderConfig {
16
+ baseUrl: string;
17
+ apiKey: string;
18
+ model: string;
19
+ models: string[];
20
+ }
21
+ /**
22
+ * Represents the current model selection.
23
+ */
24
+ export interface SelectionInfo {
25
+ provider: ProviderId;
26
+ model: string;
27
+ reasoningEffort: string | null;
28
+ scopeId: string;
29
+ }
30
+ /**
31
+ * Configuration for displaying alerts in the UI.
32
+ */
33
+ export interface AlertConfig {
34
+ type?: 'error' | 'info';
35
+ title?: string;
36
+ message?: string;
37
+ action?: string | null;
38
+ onAction?: () => void;
39
+ }
40
+ /**
41
+ * Views available in the connect component.
42
+ */
43
+ export type ConnectViewType = 'connect' | 'local' | 'connected';
44
+ /**
45
+ * State for the AgentConnectConnect component.
46
+ */
47
+ export interface ConnectComponentState {
48
+ connected: SelectionInfo | null;
49
+ selectedProvider: ProviderId | null;
50
+ selectedModel: string | null;
51
+ selectedReasoningEffort: string | null;
52
+ providers: ProviderInfoWithPending[];
53
+ models: ModelInfo[];
54
+ modelsLoading: boolean;
55
+ view: ConnectViewType;
56
+ loginExperience?: 'embedded' | 'terminal' | null;
57
+ }
58
+ /**
59
+ * Cached DOM elements for the AgentConnectConnect component.
60
+ */
61
+ export interface ConnectComponentElements {
62
+ button: HTMLButtonElement | null;
63
+ overlay: HTMLDivElement | null;
64
+ connectPanel: HTMLDivElement | null;
65
+ localPanel: HTMLDivElement | null;
66
+ popoverPanel: HTMLDivElement | null;
67
+ providerList: HTMLDivElement | null;
68
+ connectedModelSelect: HTMLSelectElement | null;
69
+ connectedEffortSelect: HTMLSelectElement | null;
70
+ effortField: HTMLDivElement | null;
71
+ modelLoading: HTMLDivElement | null;
72
+ localStatus: HTMLDivElement | null;
73
+ closeButtons: HTMLButtonElement[];
74
+ disconnectButtons: HTMLButtonElement[];
75
+ backButton: HTMLButtonElement | null;
76
+ saveLocalButton: HTMLButtonElement | null;
77
+ localBaseInput: HTMLInputElement | null;
78
+ localModelInput: HTMLInputElement | null;
79
+ localKeyInput: HTMLInputElement | null;
80
+ localModelsInput: HTMLInputElement | null;
81
+ popoverTitle: HTMLDivElement | null;
82
+ progressWrap: HTMLDivElement | null;
83
+ progressLabel: HTMLDivElement | null;
84
+ }
85
+ /**
86
+ * Error message configuration for predefined error states.
87
+ */
88
+ export interface ErrorMessageConfig {
89
+ title: string;
90
+ message: string;
91
+ action: string | null;
92
+ }
93
+ /**
94
+ * Field validation error.
95
+ */
96
+ export interface ValidationError {
97
+ field: string;
98
+ message: string;
99
+ }
100
+ /**
101
+ * Event detail for selection-related custom events.
102
+ */
103
+ export interface SelectionEventDetail {
104
+ provider: ProviderId | null;
105
+ model: string | null;
106
+ reasoningEffort: string | null;
107
+ scopeId: string | null;
108
+ previousProvider: ProviderId | null;
109
+ previousModel: string | null;
110
+ previousReasoningEffort: string | null;
111
+ previousScopeId: string | null;
112
+ restored: boolean;
113
+ }
114
+ /**
115
+ * Event detail for provider login events.
116
+ */
117
+ export interface ProviderLoginEventDetail {
118
+ provider: ProviderId;
119
+ loggedIn: boolean;
120
+ }
121
+ /**
122
+ * Event detail for model change events.
123
+ */
124
+ export interface ModelChangeEventDetail {
125
+ model: string;
126
+ }
127
+ /**
128
+ * Custom event types emitted by UI components.
129
+ */
130
+ export interface AgentConnectUIEventMap {
131
+ 'agentconnect:connected': CustomEvent<SelectionEventDetail>;
132
+ 'agentconnect:disconnected': CustomEvent<SelectionEventDetail>;
133
+ 'agentconnect:selection-changed': CustomEvent<SelectionEventDetail>;
134
+ 'provider-login': CustomEvent<ProviderLoginEventDetail>;
135
+ 'model-change': CustomEvent<ModelChangeEventDetail>;
136
+ }
137
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE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2B,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAC/D,gCAAgC,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACpE,gBAAgB,EAAE,WAAW,CAAC,wBAAwB,CAAC,CAAC;IACxD,cAAc,EAAE,WAAW,CAAC,sBAAsB,CAAC,CAAC;CACrD"}
package/dist/types.js ADDED
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Type definitions for AgentConnect UI components.
3
+ */
4
+ export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * DOM utility functions.
3
+ */
4
+ /**
5
+ * Parse a comma-separated string into an array of trimmed, non-empty strings.
6
+ */
7
+ export declare function parseCommaSeparated(raw: string): string[];
8
+ /**
9
+ * Query a single element from a root with type assertion.
10
+ */
11
+ export declare function querySelector<T extends Element>(root: ParentNode, selector: string): T | null;
12
+ /**
13
+ * Query all elements from a root with type assertion.
14
+ */
15
+ export declare function querySelectorAll<T extends Element>(root: ParentNode, selector: string): T[];
16
+ /**
17
+ * Set a CSS custom property on an element.
18
+ */
19
+ export declare function setCssVar(element: HTMLElement, name: string, value: string): void;
20
+ /**
21
+ * Create an element with optional class name.
22
+ */
23
+ export declare function createElement<K extends keyof HTMLElementTagNameMap>(tag: K, className?: string): HTMLElementTagNameMap[K];
24
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAMzD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,EAC7C,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,GACf,CAAC,GAAG,IAAI,CAEV;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,EAChD,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,GACf,CAAC,EAAE,CAEL;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAEjF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,qBAAqB,EACjE,GAAG,EAAE,CAAC,EACN,SAAS,CAAC,EAAE,MAAM,GACjB,qBAAqB,CAAC,CAAC,CAAC,CAM1B"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * DOM utility functions.
3
+ */
4
+ /**
5
+ * Parse a comma-separated string into an array of trimmed, non-empty strings.
6
+ */
7
+ export function parseCommaSeparated(raw) {
8
+ if (!raw)
9
+ return [];
10
+ return raw
11
+ .split(',')
12
+ .map((item) => item.trim())
13
+ .filter(Boolean);
14
+ }
15
+ /**
16
+ * Query a single element from a root with type assertion.
17
+ */
18
+ export function querySelector(root, selector) {
19
+ return root.querySelector(selector);
20
+ }
21
+ /**
22
+ * Query all elements from a root with type assertion.
23
+ */
24
+ export function querySelectorAll(root, selector) {
25
+ return Array.from(root.querySelectorAll(selector));
26
+ }
27
+ /**
28
+ * Set a CSS custom property on an element.
29
+ */
30
+ export function setCssVar(element, name, value) {
31
+ element.style.setProperty(name, value);
32
+ }
33
+ /**
34
+ * Create an element with optional class name.
35
+ */
36
+ export function createElement(tag, className) {
37
+ const el = document.createElement(tag);
38
+ if (className) {
39
+ el.className = className;
40
+ }
41
+ return el;
42
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * HTML utility functions.
3
+ */
4
+ /**
5
+ * Escape HTML special characters to prevent XSS.
6
+ */
7
+ export declare function escapeHtml(text: string): string;
8
+ //# sourceMappingURL=html.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/utils/html.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * HTML utility functions.
3
+ */
4
+ /**
5
+ * Escape HTML special characters to prevent XSS.
6
+ */
7
+ export function escapeHtml(text) {
8
+ const div = document.createElement('div');
9
+ div.textContent = text;
10
+ return div.innerHTML;
11
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utility function exports.
3
+ */
4
+ export { escapeHtml } from './html';
5
+ export { readLocalConfig, persistLocalConfig, readSelection, saveSelection, clearSelection, buildScopeId, } from './storage';
6
+ export { parseCommaSeparated, querySelector, querySelectorAll, setCssVar, createElement, } from './dom';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,aAAa,GACd,MAAM,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Utility function exports.
3
+ */
4
+ export { escapeHtml } from './html';
5
+ export { readLocalConfig, persistLocalConfig, readSelection, saveSelection, clearSelection, buildScopeId, } from './storage';
6
+ export { parseCommaSeparated, querySelector, querySelectorAll, setCssVar, createElement, } from './dom';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * localStorage utility functions with safe fallbacks.
3
+ */
4
+ import type { LocalProviderConfig, SelectionInfo } from '../types';
5
+ /**
6
+ * Read local provider configuration from storage.
7
+ */
8
+ export declare function readLocalConfig(key?: string): LocalProviderConfig;
9
+ /**
10
+ * Persist local provider configuration to storage.
11
+ */
12
+ export declare function persistLocalConfig(config: LocalProviderConfig, key?: string): void;
13
+ /**
14
+ * Read the last selection from storage.
15
+ */
16
+ export declare function readSelection(key?: string): SelectionInfo | null;
17
+ /**
18
+ * Save the current selection to storage.
19
+ */
20
+ export declare function saveSelection(selection: SelectionInfo, key?: string): void;
21
+ /**
22
+ * Clear the saved selection from storage.
23
+ */
24
+ export declare function clearSelection(key?: string): void;
25
+ /**
26
+ * Build a unique scope ID from provider, model, and reasoning effort.
27
+ */
28
+ export declare function buildScopeId(provider: string, model: string, reasoningEffort: string | null): string;
29
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/utils/storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAUnE;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAiC,GAAG,mBAAmB,CAmB3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,EAC3B,GAAG,GAAE,MAAiC,GACrC,IAAI,CAON;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAmC,GAAG,aAAa,GAAG,IAAI,CAsB5F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,aAAa,EACxB,GAAG,GAAE,MAAmC,GACvC,IAAI,CAON;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAmC,GAAG,IAAI,CAO7E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,GAAG,IAAI,GAC7B,MAAM,CAGR"}