process-gpt-agent-sdk 0.3.4__py3-none-any.whl → 0.3.6__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.

Potentially problematic release.


This version of process-gpt-agent-sdk might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: process-gpt-agent-sdk
3
- Version: 0.3.4
3
+ Version: 0.3.6
4
4
  Summary: Supabase 기반 이벤트/작업 폴링으로 A2A AgentExecutor를 실행하는 SDK
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/your-org/process-gpt-agent-sdk
@@ -0,0 +1,8 @@
1
+ processgpt_agent_sdk/__init__.py,sha256=9TlgvkRjCsUOmQwsOED0pXVBqUV2cn6Yac8x1gmzzrk,1033
2
+ processgpt_agent_sdk/database.py,sha256=svRdVLxBc2kRP9S9HP_7jQzoEOpRpq58HJTcP6grm00,13283
3
+ processgpt_agent_sdk/processgpt_agent_framework.py,sha256=vue5l3VVCHzH4d9iJbpQYDOEN91KbZCFUtFpvYNjCdI,23685
4
+ processgpt_agent_sdk/utils.py,sha256=pK7plUKGMIHo5lA0e4442qMAmAtCwKrbewjrXdVbFdE,9228
5
+ process_gpt_agent_sdk-0.3.6.dist-info/METADATA,sha256=5o7kiDKap_yZwaia7m-O9lMW4-9Au4eoMXnSSqDjRaM,6840
6
+ process_gpt_agent_sdk-0.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ process_gpt_agent_sdk-0.3.6.dist-info/top_level.txt,sha256=Xe6zrj3_3Vv7d0pl5RRtenVUckwOVBVLQn2P03j5REo,21
8
+ process_gpt_agent_sdk-0.3.6.dist-info/RECORD,,
@@ -8,6 +8,7 @@ from .database import (
8
8
  initialize_db,
9
9
  get_consumer_id,
10
10
  polling_pending_todos,
11
+ fetch_any_task,
11
12
  record_event,
12
13
  record_events_bulk,
13
14
  save_task_result,
@@ -30,6 +31,7 @@ __all__ = [
30
31
  "initialize_db",
31
32
  "get_consumer_id",
32
33
  "polling_pending_todos",
34
+ "fetch_any_task",
33
35
  "record_event",
34
36
  "record_events_bulk",
35
37
  "save_task_result",
@@ -81,7 +81,7 @@ def initialize_db() -> None:
81
81
  if os.getenv("ENV") != "production":
82
82
  load_dotenv()
83
83
  supabase_url = os.getenv("SUPABASE_URL") or os.getenv("SUPABASE_KEY_URL")
84
- supabase_key = os.getenv("SUPABASE_KEY") or os.getenv("SUPABASE_ANON_KEY")
84
+ supabase_key = os.getenv("SERVICE_ROLE_KEY") or os.getenv("SUPABASE_KEY") or os.getenv("SUPABASE_ANON_KEY")
85
85
  if not supabase_url or not supabase_key:
86
86
  raise RuntimeError("SUPABASE_URL 및 SUPABASE_KEY가 필요합니다")
87
87
  _supabase_client = create_client(supabase_url, supabase_key)
@@ -119,6 +119,7 @@ async def polling_pending_todos(agent_orch: str, consumer: str) -> Optional[Dict
119
119
  if p_env != "dev":
120
120
  p_env = "prod"
121
121
 
122
+ logger.info("fetch_pending_task: agent_orch=%s, consumer_id=%s, p_env=%s", agent_orch, consumer_id, p_env)
122
123
  resp = client.rpc(
123
124
  "fetch_pending_task",
124
125
  {
@@ -146,6 +147,19 @@ async def polling_pending_todos(agent_orch: str, consumer: str) -> Optional[Dict
146
147
 
147
148
  return await _async_retry(_call, name="polling_pending_todos", fallback=lambda: None)
148
149
 
150
+ async def fetch_any_task(limit: int = 1) -> Optional[Dict[str, Any]]:
151
+ """테스트용: 아무 조건 없이 그냥 SELECT만"""
152
+
153
+ def _call():
154
+ client = get_db_client()
155
+ resp = client.rpc("fetch_any_task", {"p_limit": limit}).execute()
156
+ rows = resp.data or []
157
+ if not rows:
158
+ return None
159
+ return rows[0]
160
+
161
+ return await _async_retry(_call, name="fetch_any_task", fallback=lambda: None)
162
+
149
163
 
150
164
  # ------------------------------ Events & Results ------------------------------
151
165
  async def record_events_bulk(payloads: List[Dict[str, Any]]) -> None:
@@ -16,6 +16,7 @@ from a2a.types import TaskArtifactUpdateEvent, TaskState, TaskStatusUpdateEvent
16
16
  from .database import (
17
17
  initialize_db,
18
18
  polling_pending_todos,
19
+ fetch_any_task,
19
20
  record_events_bulk,
20
21
  record_event,
21
22
  save_task_result,
@@ -392,6 +393,13 @@ class ProcessGPTAgentServer:
392
393
  try:
393
394
  logger.info("🔍 [폴링 시작] 작업 대기 중... (agent_orch=%s)", self.agent_orch)
394
395
 
396
+ # 테스트: 조건 없이 레코드 확인
397
+ test_row = await fetch_any_task(limit=1)
398
+ if test_row:
399
+ logger.info("📋 [테스트 조회] 조건 없이 발견된 작업: ID=%s, status=%s, agent_mode=%s, draft=%s, draft_status=%s, agent_orch=%s, tenant_id=%s",
400
+ test_row.get('id'), test_row.get('status'), test_row.get('agent_mode'),
401
+ test_row.get('draft'), test_row.get('draft_status'), test_row.get('agent_orch'), test_row.get('tenant_id'))
402
+
395
403
  row = await polling_pending_todos(self.agent_orch, get_consumer_id())
396
404
 
397
405
  if row:
@@ -1,8 +0,0 @@
1
- processgpt_agent_sdk/__init__.py,sha256=4-Wt-FRImZa1tG4CWx2ZtICcnTkKoAiqAfva9vLitLQ,991
2
- processgpt_agent_sdk/database.py,sha256=4oQxJ3y28pPdUpvcQ80DEcFmcvKH37RszhSSZKf6tJU,12690
3
- processgpt_agent_sdk/processgpt_agent_framework.py,sha256=xsQnPXTnIjCkE5jYDVg9TZC-QiyLF0DmXHTvu-oMXa0,23080
4
- processgpt_agent_sdk/utils.py,sha256=pK7plUKGMIHo5lA0e4442qMAmAtCwKrbewjrXdVbFdE,9228
5
- process_gpt_agent_sdk-0.3.4.dist-info/METADATA,sha256=NR2O7M7WttHlU9oGJbRgFv3vcdt4pXSkIfWUOkE_ySU,6840
6
- process_gpt_agent_sdk-0.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- process_gpt_agent_sdk-0.3.4.dist-info/top_level.txt,sha256=Xe6zrj3_3Vv7d0pl5RRtenVUckwOVBVLQn2P03j5REo,21
8
- process_gpt_agent_sdk-0.3.4.dist-info/RECORD,,