process-gpt-agent-sdk 0.2.5__tar.gz → 0.2.7__tar.gz

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.

Files changed (25) hide show
  1. {process_gpt_agent_sdk-0.2.5/process_gpt_agent_sdk.egg-info → process_gpt_agent_sdk-0.2.7}/PKG-INFO +1 -1
  2. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/function.sql +105 -0
  3. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7/process_gpt_agent_sdk.egg-info}/PKG-INFO +1 -1
  4. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/core/database.py +22 -8
  5. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/server.py +1 -0
  6. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/utils/event_handler.py +1 -1
  7. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/utils/summarizer.py +2 -2
  8. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/pyproject.toml +1 -1
  9. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/MANIFEST.in +0 -0
  10. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/README.md +0 -0
  11. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/process_gpt_agent_sdk.egg-info/SOURCES.txt +0 -0
  12. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/process_gpt_agent_sdk.egg-info/dependency_links.txt +0 -0
  13. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/process_gpt_agent_sdk.egg-info/requires.txt +0 -0
  14. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/process_gpt_agent_sdk.egg-info/top_level.txt +0 -0
  15. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/__init__.py +0 -0
  16. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/core/__init__.py +0 -0
  17. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/tools/__init__.py +0 -0
  18. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/tools/human_query_tool.py +0 -0
  19. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/tools/knowledge_tools.py +0 -0
  20. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/tools/safe_tool_loader.py +0 -0
  21. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/utils/__init__.py +0 -0
  22. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/utils/context_manager.py +0 -0
  23. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/utils/crewai_event_listener.py +0 -0
  24. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/processgpt_agent_sdk/utils/logger.py +0 -0
  25. {process_gpt_agent_sdk-0.2.5 → process_gpt_agent_sdk-0.2.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: process-gpt-agent-sdk
3
- Version: 0.2.5
3
+ Version: 0.2.7
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
@@ -100,6 +100,110 @@ BEGIN
100
100
  END;
101
101
  $$ LANGUAGE plpgsql VOLATILE;
102
102
 
103
+ DROP FUNCTION IF EXISTS public.fetch_pending_task_dev(text, text, integer, text);
104
+
105
+ CREATE OR REPLACE FUNCTION public.fetch_pending_task_dev(
106
+ p_agent_orch text,
107
+ p_consumer text,
108
+ p_limit integer,
109
+ p_tenant_id text
110
+ )
111
+ RETURNS TABLE (
112
+ id uuid,
113
+ user_id text,
114
+ proc_inst_id text,
115
+ proc_def_id text,
116
+ activity_id text,
117
+ activity_name text,
118
+ start_date timestamp without time zone,
119
+ end_date timestamp without time zone,
120
+ description text,
121
+ tool text,
122
+ due_date timestamp without time zone,
123
+ tenant_id text,
124
+ reference_ids text[],
125
+ adhoc boolean,
126
+ assignees jsonb,
127
+ duration integer,
128
+ output jsonb,
129
+ retry integer,
130
+ consumer text,
131
+ log text,
132
+ draft jsonb,
133
+ project_id uuid,
134
+ feedback jsonb,
135
+ updated_at timestamp with time zone,
136
+ username text,
137
+ status public.todo_status,
138
+ agent_mode public.agent_mode,
139
+ agent_orch public.agent_orch,
140
+ temp_feedback text,
141
+ draft_status public.draft_status,
142
+ task_type public.draft_status
143
+ )
144
+ AS $$
145
+ BEGIN
146
+ RETURN QUERY
147
+ WITH cte AS (
148
+ SELECT
149
+ t.*,
150
+ t.draft_status AS task_type
151
+ FROM todolist AS t
152
+ WHERE t.status = 'IN_PROGRESS'
153
+ AND t.tenant_id = p_tenant_id
154
+ AND (p_agent_orch IS NULL OR p_agent_orch = '' OR t.agent_orch::text = p_agent_orch)
155
+ AND (
156
+ (t.agent_mode IN ('DRAFT','COMPLETE') AND t.draft IS NULL AND t.draft_status IS NULL)
157
+ OR t.draft_status = 'FB_REQUESTED'
158
+ )
159
+ ORDER BY t.start_date
160
+ LIMIT p_limit
161
+ FOR UPDATE SKIP LOCKED
162
+ ),
163
+ upd AS (
164
+ UPDATE todolist AS t
165
+ SET draft_status = 'STARTED',
166
+ consumer = p_consumer
167
+ FROM cte
168
+ WHERE t.id = cte.id
169
+ RETURNING
170
+ t.id,
171
+ t.user_id,
172
+ t.proc_inst_id,
173
+ t.proc_def_id,
174
+ t.activity_id,
175
+ t.activity_name,
176
+ t.start_date,
177
+ t.end_date,
178
+ t.description,
179
+ t.tool,
180
+ t.due_date,
181
+ t.tenant_id,
182
+ t.reference_ids,
183
+ t.adhoc,
184
+ t.assignees,
185
+ t.duration,
186
+ t.output,
187
+ t.retry,
188
+ t.consumer,
189
+ t.log,
190
+ t.draft,
191
+ t.project_id,
192
+ t.feedback,
193
+ t.updated_at,
194
+ t.username,
195
+ t.status,
196
+ t.agent_mode,
197
+ t.agent_orch,
198
+ t.temp_feedback,
199
+ t.draft_status,
200
+ cte.task_type
201
+ )
202
+ SELECT * FROM upd;
203
+ END;
204
+ $$ LANGUAGE plpgsql VOLATILE;
205
+
206
+
103
207
 
104
208
  -- 2) 완료된 데이터(output/feedback) 조회
105
209
  DROP FUNCTION IF EXISTS public.fetch_done_data(text);
@@ -160,5 +264,6 @@ $$ LANGUAGE plpgsql VOLATILE;
160
264
 
161
265
  -- 익명(anon) 역할에 실행 권한 부여
162
266
  GRANT EXECUTE ON FUNCTION public.fetch_pending_task(text, text, integer) TO anon;
267
+ GRANT EXECUTE ON FUNCTION public.fetch_pending_task_dev(text, text, integer, text) TO anon;
163
268
  GRANT EXECUTE ON FUNCTION public.fetch_done_data(text) TO anon;
164
269
  GRANT EXECUTE ON FUNCTION public.save_task_result(uuid, jsonb, boolean) TO anon;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: process-gpt-agent-sdk
3
- Version: 0.2.5
3
+ Version: 0.2.7
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
@@ -103,16 +103,30 @@ def get_consumer_id() -> str:
103
103
  async def polling_pending_todos(agent_orch: str, consumer: str) -> Optional[Dict[str, Any]]:
104
104
  """TODOLIST 테이블에서 대기중인 워크아이템을 조회"""
105
105
  def _call():
106
- client = get_db_client()
107
- return client.rpc(
108
- "fetch_pending_task",
109
- {"p_agent_orch": agent_orch, "p_consumer": consumer, "p_limit": 1},
110
- ).execute()
106
+ supabase = get_db_client()
107
+ consumer_id = socket.gethostname()
108
+ env = (os.getenv("ENV") or "").lower()
109
+
110
+ if env == "dev":
111
+ # 개발 환경: 특정 테넌트(uengine)만 폴링
112
+ resp = supabase.rpc(
113
+ "fetch_pending_task_dev",
114
+ {"p_limit": 1, "p_consumer": consumer_id, "p_tenant_id": "uengine"},
115
+ ).execute()
116
+ else:
117
+ # 운영/기타 환경: 기존 로직 유지
118
+ resp = supabase.rpc(
119
+ "fetch_pending_task",
120
+ {"p_limit": 1, "p_consumer": consumer_id},
121
+ ).execute()
122
+
123
+ rows = resp.data or []
124
+ return rows[0] if rows else None
111
125
 
112
126
  resp = await _async_retry(_call, name="polling_pending_todos", fallback=lambda: None)
113
- if not resp or not resp.data:
127
+ if not resp:
114
128
  return None
115
- return resp.data[0]
129
+ return resp
116
130
 
117
131
 
118
132
  async def fetch_todo_by_id(todo_id: str) -> Optional[Dict[str, Any]]:
@@ -142,7 +156,7 @@ async def fetch_done_data(proc_inst_id: Optional[str]) -> List[Any]:
142
156
  resp = await _async_retry(_call, name="fetch_done_data", fallback=lambda: None)
143
157
  if not resp:
144
158
  return []
145
- return [row.get("output") for row in (resp.data or [])]
159
+ return [row.get("output") for row in (resp.data or []) if row.get("output")]
146
160
 
147
161
 
148
162
  def fetch_human_response_sync(job_id: str) -> Optional[Dict[str, Any]]:
@@ -114,6 +114,7 @@ class ProcessGPTAgentServer:
114
114
  "agent_list": agent_list or [],
115
115
  "mcp_config": mcp_config,
116
116
  "form_id": form_id,
117
+ "todo_id": str(task_record.get("id")),
117
118
  "form_types": form_types or [],
118
119
  "form_html": form_html or "",
119
120
  "activity_name": str(task_record.get("activity_name", "")),
@@ -56,7 +56,7 @@ async def process_event_message(todo: Dict[str, Any], event: Event) -> None:
56
56
  if evt_type == "output":
57
57
  payload = data.get("data") or {}
58
58
  is_final = bool(payload.get("final") or payload.get("is_final")) if isinstance(payload, dict) else False
59
- content = payload.get("content") if isinstance(payload, dict) else payload
59
+ content = payload.get("content") or payload.get("data") if isinstance(payload, dict) else payload
60
60
  await save_task_result(str(todo.get("id")), content, final=is_final)
61
61
  return
62
62
 
@@ -24,12 +24,12 @@ async def summarize_async(outputs: Any, feedbacks: Any, contents: Any = None) ->
24
24
  output_summary = ""
25
25
  feedback_summary = ""
26
26
 
27
- if outputs_str:
27
+ if outputs_str and outputs_str not in ("[]", "{}", "[{}]"):
28
28
  write_log_message("요약 호출(이전결과물)")
29
29
  output_prompt = _create_output_summary_prompt(outputs_str)
30
30
  output_summary = await _call_openai_api_async(output_prompt, task_name="output")
31
31
 
32
- if feedbacks_str or contents_str:
32
+ if feedbacks_str and feedbacks_str not in ("[]", "{}"):
33
33
  write_log_message("요약 호출(피드백)")
34
34
  feedback_prompt = _create_feedback_summary_prompt(feedbacks_str, contents_str)
35
35
  feedback_summary = await _call_openai_api_async(feedback_prompt, task_name="feedback")
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "process-gpt-agent-sdk"
7
- version = "0.2.5"
7
+ version = "0.2.7"
8
8
  description = "Supabase 기반 이벤트/작업 폴링으로 A2A AgentExecutor를 실행하는 SDK"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"