grix-connector 3.1.0 → 3.1.2
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.
|
@@ -24,6 +24,47 @@ the owner** so the agent starts working.
|
|
|
24
24
|
third-person relay ("请帮 owner 完成…") and not as yourself narrating on the
|
|
25
25
|
owner's behalf.
|
|
26
26
|
|
|
27
|
+
## After dispatching — monitor and report back (don't fire-and-forget)
|
|
28
|
+
|
|
29
|
+
Dispatching is only step one. After `grix_dispatch_agent` succeeds, **do not end
|
|
30
|
+
your turn there**. Stay and watch the dispatched session until it reaches a
|
|
31
|
+
terminal state, then report the actual result back to the user.
|
|
32
|
+
|
|
33
|
+
1. **Capture the session.** Take the target session id from the dispatch result.
|
|
34
|
+
If it isn't clearly present, list sessions with `grix_chat_state_query` (each
|
|
35
|
+
entry carries its `task_title`) and match the one you just created.
|
|
36
|
+
|
|
37
|
+
2. **Poll the state.** Call `grix_chat_state_query` with that `session_id` on a
|
|
38
|
+
calm cadence — wait ~15–30s between polls, never spin in a tight loop. Each
|
|
39
|
+
entry has one mutually-exclusive `state`; act on it:
|
|
40
|
+
- `running` — still working. Keep polling.
|
|
41
|
+
- `completed` — done. Go to step 3.
|
|
42
|
+
- `failed` — errored. Fetch recent messages (step 3) to capture the error,
|
|
43
|
+
then report the failure.
|
|
44
|
+
- `waiting_approval` / `waiting_question` — the agent is blocked on the owner
|
|
45
|
+
(approve/deny, or answer a question) and will **not** progress on its own.
|
|
46
|
+
Fetch the latest message to see what it's asking, surface that to the user,
|
|
47
|
+
and stop polling — the user has to act.
|
|
48
|
+
- `idle` — no active task / stopped. If it never hit `completed`, fetch recent
|
|
49
|
+
messages to see what happened, then report.
|
|
50
|
+
|
|
51
|
+
3. **Read the answer.** Once the state is terminal, pull the agent's final reply
|
|
52
|
+
with `grix_query` (`action: "message_history"`, `sessionId: <session>`). Read
|
|
53
|
+
the latest agent message(s) and summarize the outcome — don't dump raw logs.
|
|
54
|
+
|
|
55
|
+
4. **Reply the result.** Send the conclusion back to the user: what the
|
|
56
|
+
dispatched agent did and how it turned out.
|
|
57
|
+
|
|
58
|
+
### Long-running tasks
|
|
59
|
+
- If `running` persists past a few minutes (≈3 min), send a short interim
|
|
60
|
+
progress note to the user so they know it's still working, then keep polling.
|
|
61
|
+
Repeat at sensible intervals so the user is never left in the dark.
|
|
62
|
+
- A single turn can't run forever. If the task is still `running` when you've
|
|
63
|
+
watched for a long stretch (≈20 min) and must wrap up, do **not** promise to
|
|
64
|
+
notify the user later — you cannot send anything after the turn ends. Report
|
|
65
|
+
the current state plainly and tell them how to re-check (ping you again to
|
|
66
|
+
resume monitoring; the dispatched session keeps running on its own).
|
|
67
|
+
|
|
27
68
|
## Update an introduction — `grix_agent_update`
|
|
28
69
|
|
|
29
70
|
Change the text introduction of one of the owner's agents.
|
|
@@ -41,3 +82,8 @@ Change the text introduction of one of the owner's agents.
|
|
|
41
82
|
4. The `task` is delivered AS THE OWNER, so always write it in the owner's
|
|
42
83
|
first-person voice and tone — never as a third-person relay and never in your
|
|
43
84
|
own narrating voice.
|
|
85
|
+
5. Dispatch is **not** fire-and-forget. After dispatching, monitor the session
|
|
86
|
+
state (`grix_chat_state_query`), read the final answer when it completes
|
|
87
|
+
(`grix_query` message_history), and report the result. Never promise a future
|
|
88
|
+
notification you cannot send — if you must stop while it's still running, say
|
|
89
|
+
so plainly and give the user a way to re-check.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a(
|
|
1
|
+
function a(t){const o=new Set([`http://127.0.0.1:${t.serverPort}`,`http://localhost:${t.serverPort}`,...t.allowedOrigins]),e=new Set([`127.0.0.1:${t.serverPort}`,`localhost:${t.serverPort}`,...t.allowedHosts]);return{validateRequest(s){const r=i(s,o);if(!r.ok)return r;const n=l(s,e);return n.ok?{ok:!0}:n}}}function i(t,o){const e=t.headers.origin;return e?o.has(e)?{ok:!0}:{ok:!1,statusCode:403,message:`Origin not allowed: ${e}`}:{ok:!0}}function l(t,o){const e=t.headers.host;return e?o.has(e)?{ok:!0}:{ok:!1,statusCode:403,message:`Host not allowed: ${e}`}:{ok:!1,statusCode:403,message:"Missing Host header"}}export{a as createSecurityPolicy};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grix-connector",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Connect local AI coding agents (Claude, Codex, Gemini, Qwen, DeepSeek, Cursor, OpenCode, Pi, OpenHuman, Reasonix) to the Grix scheduling platform. Also serves as an OpenClaw plugin for Grix channel transport.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|