langgraph-agent-common 2.0.0__py3-none-any.whl

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 (31) hide show
  1. langgraph_a2a_api/__init__.py +0 -0
  2. langgraph_a2a_api/adaptor/__init__.py +0 -0
  3. langgraph_a2a_api/adaptor/agent_executor.py +421 -0
  4. langgraph_a2a_api/adaptor/conversion.py +167 -0
  5. langgraph_a2a_api/adaptor/sanitize_messages_for_llm.py +34 -0
  6. langgraph_a2a_api/fastapi_application.py +152 -0
  7. langgraph_a2a_api/langgraph/__init__.py +0 -0
  8. langgraph_a2a_api/langgraph/checkpointer.py +102 -0
  9. langgraph_a2a_api/langgraph/graph.py +49 -0
  10. langgraph_a2a_api/langgraph/store.py +64 -0
  11. langgraph_a2a_api/langgraph/validator.py +42 -0
  12. langgraph_a2a_api/resources/openapi_schema.json +277 -0
  13. langgraph_a2a_api/resources/static/css/style.css +480 -0
  14. langgraph_a2a_api/resources/static/index.html +107 -0
  15. langgraph_a2a_api/resources/static/js/app.js +896 -0
  16. langgraph_a2a_api/server.py +149 -0
  17. langgraph_a2a_api/tasks/__init__.py +0 -0
  18. langgraph_a2a_api/tasks/push_notification_config_store.py +24 -0
  19. langgraph_a2a_api/tasks/task_store.py +66 -0
  20. langgraph_a2a_api/utils/__init__.py +0 -0
  21. langgraph_a2a_api/utils/lock.py +31 -0
  22. langgraph_a2a_api/utils/types.py +3 -0
  23. langgraph_agent_common-2.0.0.dist-info/METADATA +67 -0
  24. langgraph_agent_common-2.0.0.dist-info/RECORD +31 -0
  25. langgraph_agent_common-2.0.0.dist-info/WHEEL +5 -0
  26. langgraph_agent_common-2.0.0.dist-info/top_level.txt +2 -0
  27. langgraph_aux/__init__.py +0 -0
  28. langgraph_aux/callbacks/__init__.py +11 -0
  29. langgraph_aux/callbacks/talos_callback_handler.py +340 -0
  30. langgraph_aux/utils/__init__.py +0 -0
  31. langgraph_aux/utils/stream_output.py +13 -0
@@ -0,0 +1,480 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ :root {
8
+ --bg-primary: #1a1a2e;
9
+ --bg-secondary: #16213e;
10
+ --bg-tertiary: #0f3460;
11
+ --text-primary: #eaeaea;
12
+ --text-secondary: #a0a0a0;
13
+ --accent: #e94560;
14
+ --accent-hover: #ff6b81;
15
+ --success: #4ade80;
16
+ --error: #f87171;
17
+ --warning: #fbbf24;
18
+ --border: #2a2a4a;
19
+ --user-msg: #0f3460;
20
+ --agent-msg: #1e293b;
21
+ }
22
+
23
+ body {
24
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
25
+ background: var(--bg-primary);
26
+ color: var(--text-primary);
27
+ height: 100vh;
28
+ overflow: hidden;
29
+ }
30
+
31
+ .app-container {
32
+ display: flex;
33
+ height: 100vh;
34
+ }
35
+
36
+ .sidebar {
37
+ width: 320px;
38
+ background: var(--bg-secondary);
39
+ border-right: 1px solid var(--border);
40
+ overflow-y: auto;
41
+ padding: 16px;
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: 16px;
45
+ }
46
+
47
+ .sidebar-section {
48
+ background: var(--bg-tertiary);
49
+ border-radius: 8px;
50
+ padding: 12px;
51
+ }
52
+
53
+ .sidebar-section h3 {
54
+ font-size: 14px;
55
+ margin-bottom: 8px;
56
+ color: var(--accent);
57
+ }
58
+
59
+ .context-selector {
60
+ display: flex;
61
+ gap: 8px;
62
+ margin-bottom: 8px;
63
+ }
64
+
65
+ .context-selector select {
66
+ flex: 1;
67
+ padding: 8px;
68
+ background: var(--bg-secondary);
69
+ border: 1px solid var(--border);
70
+ border-radius: 4px;
71
+ color: var(--text-primary);
72
+ }
73
+
74
+ .context-selector button {
75
+ width: 32px;
76
+ height: 32px;
77
+ background: var(--accent);
78
+ border: none;
79
+ border-radius: 4px;
80
+ color: white;
81
+ cursor: pointer;
82
+ font-size: 18px;
83
+ }
84
+
85
+ .context-info {
86
+ margin-bottom: 8px;
87
+ }
88
+
89
+ .context-info label {
90
+ display: block;
91
+ font-size: 12px;
92
+ color: var(--text-secondary);
93
+ margin-bottom: 4px;
94
+ }
95
+
96
+ .context-info input {
97
+ width: 100%;
98
+ padding: 6px 8px;
99
+ background: var(--bg-secondary);
100
+ border: 1px solid var(--border);
101
+ border-radius: 4px;
102
+ color: var(--text-secondary);
103
+ font-size: 12px;
104
+ font-family: monospace;
105
+ }
106
+
107
+ textarea {
108
+ width: 100%;
109
+ padding: 8px;
110
+ background: var(--bg-secondary);
111
+ border: 1px solid var(--border);
112
+ border-radius: 4px;
113
+ color: var(--text-primary);
114
+ font-family: 'Monaco', 'Menlo', monospace;
115
+ font-size: 12px;
116
+ resize: vertical;
117
+ }
118
+
119
+ textarea:focus {
120
+ outline: none;
121
+ border-color: var(--accent);
122
+ }
123
+
124
+ .btn-small {
125
+ padding: 4px 8px;
126
+ background: var(--bg-secondary);
127
+ border: 1px solid var(--border);
128
+ border-radius: 4px;
129
+ color: var(--text-primary);
130
+ cursor: pointer;
131
+ font-size: 12px;
132
+ margin-top: 4px;
133
+ }
134
+
135
+ .btn-small:hover {
136
+ background: var(--border);
137
+ }
138
+
139
+ .btn-primary {
140
+ padding: 8px 16px;
141
+ background: var(--accent);
142
+ border: none;
143
+ border-radius: 4px;
144
+ color: white;
145
+ cursor: pointer;
146
+ font-size: 14px;
147
+ }
148
+
149
+ .btn-primary:hover {
150
+ background: var(--accent-hover);
151
+ }
152
+
153
+ .btn-primary:disabled {
154
+ opacity: 0.5;
155
+ cursor: not-allowed;
156
+ }
157
+
158
+ .status-indicator {
159
+ font-size: 12px;
160
+ margin-left: 8px;
161
+ }
162
+
163
+ .status-indicator.valid {
164
+ color: var(--success);
165
+ }
166
+
167
+ .status-indicator.invalid {
168
+ color: var(--error);
169
+ }
170
+
171
+ .api-settings label {
172
+ display: block;
173
+ font-size: 12px;
174
+ color: var(--text-secondary);
175
+ margin-bottom: 4px;
176
+ }
177
+
178
+ .api-settings input {
179
+ width: 100%;
180
+ padding: 6px 8px;
181
+ background: var(--bg-secondary);
182
+ border: 1px solid var(--border);
183
+ border-radius: 4px;
184
+ color: var(--text-primary);
185
+ font-size: 12px;
186
+ }
187
+
188
+ .chat-container {
189
+ flex: 1;
190
+ display: flex;
191
+ flex-direction: column;
192
+ background: var(--bg-primary);
193
+ }
194
+
195
+ .chat-header {
196
+ padding: 12px 16px;
197
+ background: var(--bg-secondary);
198
+ border-bottom: 1px solid var(--border);
199
+ display: flex;
200
+ justify-content: space-between;
201
+ align-items: center;
202
+ }
203
+
204
+ .chat-header h2 {
205
+ font-size: 18px;
206
+ }
207
+
208
+ .header-actions {
209
+ display: flex;
210
+ gap: 8px;
211
+ }
212
+
213
+ .chat-messages {
214
+ flex: 1;
215
+ overflow-y: auto;
216
+ padding: 16px;
217
+ display: flex;
218
+ flex-direction: column;
219
+ gap: 12px;
220
+ }
221
+
222
+ .message {
223
+ max-width: 80%;
224
+ padding: 12px;
225
+ border-radius: 8px;
226
+ position: relative;
227
+ }
228
+
229
+ .message.user {
230
+ align-self: flex-end;
231
+ background: var(--user-msg);
232
+ border-bottom-right-radius: 2px;
233
+ }
234
+
235
+ .message.agent {
236
+ align-self: flex-start;
237
+ background: var(--agent-msg);
238
+ border-bottom-left-radius: 2px;
239
+ }
240
+
241
+ .message.system {
242
+ align-self: center;
243
+ background: var(--bg-tertiary);
244
+ font-size: 12px;
245
+ color: var(--text-secondary);
246
+ max-width: 90%;
247
+ }
248
+
249
+ .message-header {
250
+ font-size: 11px;
251
+ color: var(--text-secondary);
252
+ margin-bottom: 4px;
253
+ }
254
+
255
+ .message-content {
256
+ white-space: pre-wrap;
257
+ word-break: break-word;
258
+ }
259
+
260
+ .message-content.json-content {
261
+ font-family: 'Monaco', 'Menlo', monospace;
262
+ font-size: 12px;
263
+ background: var(--bg-primary);
264
+ padding: 8px;
265
+ border-radius: 4px;
266
+ max-height: 300px;
267
+ overflow: auto;
268
+ }
269
+
270
+ .message.error {
271
+ background: rgba(248, 113, 113, 0.2);
272
+ border: 1px solid var(--error);
273
+ }
274
+
275
+ .message.loading {
276
+ opacity: 0.7;
277
+ }
278
+
279
+ .typing-indicator::after {
280
+ content: '...';
281
+ animation: typing 1.5s infinite;
282
+ }
283
+
284
+ @keyframes typing {
285
+ 0%, 20% { content: '.'; }
286
+ 40% { content: '..'; }
287
+ 60%, 100% { content: '...'; }
288
+ }
289
+
290
+ .hitl-panel {
291
+ background: var(--bg-secondary);
292
+ border-top: 1px solid var(--border);
293
+ padding: 16px;
294
+ max-height: 50vh;
295
+ overflow-y: auto;
296
+ }
297
+
298
+ .hitl-panel.hidden {
299
+ display: none;
300
+ }
301
+
302
+ .hitl-header {
303
+ display: flex;
304
+ justify-content: space-between;
305
+ align-items: center;
306
+ margin-bottom: 12px;
307
+ }
308
+
309
+ .hitl-header h4 {
310
+ color: var(--warning);
311
+ }
312
+
313
+ .hitl-content {
314
+ display: flex;
315
+ flex-direction: column;
316
+ gap: 12px;
317
+ }
318
+
319
+ .hitl-section h5 {
320
+ font-size: 13px;
321
+ color: var(--text-secondary);
322
+ margin-bottom: 8px;
323
+ }
324
+
325
+ .json-display {
326
+ background: var(--bg-primary);
327
+ padding: 12px;
328
+ border-radius: 4px;
329
+ font-family: 'Monaco', 'Menlo', monospace;
330
+ font-size: 12px;
331
+ max-height: 200px;
332
+ overflow: auto;
333
+ white-space: pre-wrap;
334
+ word-break: break-word;
335
+ }
336
+
337
+ .hitl-decisions {
338
+ display: flex;
339
+ gap: 8px;
340
+ margin-bottom: 8px;
341
+ }
342
+
343
+ .hitl-nav {
344
+ display: flex;
345
+ align-items: center;
346
+ justify-content: space-between;
347
+ margin-bottom: 12px;
348
+ padding: 8px;
349
+ background: var(--bg-primary);
350
+ border-radius: 4px;
351
+ }
352
+
353
+ .hitl-nav-btn {
354
+ padding: 6px 12px;
355
+ background: var(--bg-tertiary);
356
+ border: 1px solid var(--border);
357
+ border-radius: 4px;
358
+ color: var(--text-primary);
359
+ cursor: pointer;
360
+ font-size: 12px;
361
+ }
362
+
363
+ .hitl-nav-btn:hover:not(:disabled) {
364
+ background: var(--border);
365
+ }
366
+
367
+ .hitl-nav-btn:disabled {
368
+ opacity: 0.5;
369
+ cursor: not-allowed;
370
+ }
371
+
372
+ .hitl-nav-info {
373
+ font-size: 13px;
374
+ color: var(--text-secondary);
375
+ }
376
+
377
+ .hitl-btn {
378
+ padding: 8px 16px;
379
+ border: none;
380
+ border-radius: 4px;
381
+ cursor: pointer;
382
+ font-size: 13px;
383
+ color: white;
384
+ }
385
+
386
+ .hitl-btn.approve-btn {
387
+ background: var(--success);
388
+ }
389
+
390
+ .hitl-btn.reject-btn {
391
+ background: var(--error);
392
+ }
393
+
394
+ .hitl-btn.respond-btn {
395
+ background: var(--accent);
396
+ }
397
+
398
+ .hitl-btn:hover {
399
+ opacity: 0.9;
400
+ }
401
+
402
+ .hitl-btn.active {
403
+ box-shadow: 0 0 0 2px white;
404
+ }
405
+
406
+ #hitlResponseForm {
407
+ margin-top: 8px;
408
+ }
409
+
410
+ #hitlResponseForm.hidden {
411
+ display: none;
412
+ }
413
+
414
+ #hitlEditSection {
415
+ margin-top: 8px;
416
+ }
417
+
418
+ #hitlEditSection.hidden {
419
+ display: none;
420
+ }
421
+
422
+ #hitlEditSection h6 {
423
+ font-size: 12px;
424
+ color: var(--text-secondary);
425
+ margin-bottom: 4px;
426
+ }
427
+
428
+ .chat-input-container {
429
+ padding: 12px 16px;
430
+ background: var(--bg-secondary);
431
+ border-top: 1px solid var(--border);
432
+ display: flex;
433
+ gap: 8px;
434
+ }
435
+
436
+ .chat-input-container textarea {
437
+ flex: 1;
438
+ min-height: 40px;
439
+ max-height: 120px;
440
+ }
441
+
442
+ .chat-input-container textarea:focus {
443
+ outline: none;
444
+ border-color: var(--accent);
445
+ }
446
+
447
+ .hidden {
448
+ display: none !important;
449
+ }
450
+
451
+ ::-webkit-scrollbar {
452
+ width: 8px;
453
+ }
454
+
455
+ ::-webkit-scrollbar-track {
456
+ background: var(--bg-primary);
457
+ }
458
+
459
+ ::-webkit-scrollbar-thumb {
460
+ background: var(--border);
461
+ border-radius: 4px;
462
+ }
463
+
464
+ ::-webkit-scrollbar-thumb:hover {
465
+ background: var(--bg-tertiary);
466
+ }
467
+
468
+ .btn-cancel {
469
+ background: var(--error) !important;
470
+ }
471
+
472
+ .btn-cancel:hover {
473
+ opacity: 0.9;
474
+ }
475
+
476
+ .message.thinking {
477
+ background: var(--bg-tertiary);
478
+ opacity: 0.7;
479
+ font-size: 12px;
480
+ }
@@ -0,0 +1,107 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>A2A Chat UI</title>
7
+ <link rel="stylesheet" href="static/css/style.css?v=5">
8
+ </head>
9
+ <body>
10
+ <div class="app-container">
11
+ <aside class="sidebar">
12
+ <div class="sidebar-section">
13
+ <h3>Context Management</h3>
14
+ <div class="context-selector">
15
+ <select id="contextSelect"></select>
16
+ <button id="newContextBtn" title="New Context">+</button>
17
+ </div>
18
+ <div class="context-info">
19
+ <label>Current Context ID:</label>
20
+ <input type="text" id="contextIdInput" readonly>
21
+ </div>
22
+ <div class="context-info">
23
+ <label>Current Task ID:</label>
24
+ <input type="text" id="taskIdInput" readonly>
25
+ </div>
26
+ </div>
27
+
28
+ <div class="sidebar-section">
29
+ <h3>Message Metadata</h3>
30
+ <textarea id="messageMetaInput" rows="6" placeholder='{"key": "value"}'></textarea>
31
+ <button id="validateMetaBtn" class="btn-small">Validate JSON</button>
32
+ <span id="metaStatus" class="status-indicator"></span>
33
+ </div>
34
+
35
+ <div class="sidebar-section">
36
+ <h3>Task Metadata</h3>
37
+ <textarea id="taskMetaInput" rows="6" placeholder='{"key": "value"}'></textarea>
38
+ <button id="validateTaskMetaBtn" class="btn-small">Validate JSON</button>
39
+ <span id="taskMetaStatus" class="status-indicator"></span>
40
+ </div>
41
+
42
+ <div class="sidebar-section">
43
+ <h3>Configuration</h3>
44
+ <textarea id="configInput" rows="8" placeholder='{"historyLength": 10, "returnImmediately": false}'></textarea>
45
+ <button id="validateConfigBtn" class="btn-small">Validate JSON</button>
46
+ <span id="configStatus" class="status-indicator"></span>
47
+ </div>
48
+
49
+ <div class="sidebar-section">
50
+ <h3>API Settings</h3>
51
+ <div class="api-settings">
52
+ <label>Base URL:</label>
53
+ <input type="text" id="apiBaseUrl" value="">
54
+ </div>
55
+ </div>
56
+ </aside>
57
+
58
+ <main class="chat-container">
59
+ <header class="chat-header">
60
+ <h2>A2A Chat</h2>
61
+ <div class="header-actions">
62
+ <button id="clearChatBtn" class="btn-small">Clear Chat</button>
63
+ <button id="exportChatBtn" class="btn-small">Export</button>
64
+ </div>
65
+ </header>
66
+
67
+ <div id="chatMessages" class="chat-messages"></div>
68
+
69
+ <div id="hitlPanel" class="hitl-panel hidden">
70
+ <div class="hitl-header">
71
+ <h4>Input Required (HITL)</h4>
72
+ <button id="closeHitlBtn" class="btn-small">Close</button>
73
+ </div>
74
+ <div class="hitl-content">
75
+ <div class="hitl-section">
76
+ <h5>Agent Response Parts:</h5>
77
+ <pre id="hitlPartsJson" class="json-display"></pre>
78
+ </div>
79
+ <div class="hitl-section">
80
+ <h5>HITL Response:</h5>
81
+ <div class="hitl-decisions">
82
+ <button class="hitl-btn approve-btn" data-type="approve">Approve</button>
83
+ <button class="hitl-btn reject-btn" data-type="reject">Reject</button>
84
+ <button class="hitl-btn respond-btn" data-type="respond">Respond</button>
85
+ </div>
86
+ <div id="hitlResponseForm" class="hidden">
87
+ <textarea id="hitlResponseInput" rows="3" placeholder="Enter response message..."></textarea>
88
+ <div id="hitlEditSection" class="hidden">
89
+ <h6>Edited Action (JSON):</h6>
90
+ <textarea id="hitlEditInput" rows="4" placeholder='{"name": "tool_name", "args": {}}'></textarea>
91
+ </div>
92
+ </div>
93
+ <button id="submitHitlBtn" class="btn-primary hidden">Submit Response</button>
94
+ </div>
95
+ </div>
96
+ </div>
97
+
98
+ <div class="chat-input-container">
99
+ <textarea id="messageInput" rows="2" placeholder="Type your message..."></textarea>
100
+ <button id="sendBtn" class="btn-primary">Send</button>
101
+ </div>
102
+ </main>
103
+ </div>
104
+
105
+ <script src="static/js/app.js?v=5"></script>
106
+ </body>
107
+ </html>