grix-connector 4.18.1 → 4.19.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.
- package/dist/adapter/claude/claude-bridge-server.js +1 -0
- package/dist/adapter/claude/claude-tools.js +1 -0
- package/dist/adapter/claude/claude-worker-client.js +1 -0
- package/dist/adapter/claude/mcp-http-launcher.js +2 -0
- package/dist/adapter/claude/result-timeout.js +1 -0
- package/dist/adapter/deepseek/deepseek-adapter.js +6 -0
- package/dist/adapter/deepseek/index.js +1 -0
- package/dist/adapter/deepseek-harness/dsh-version.js +1 -1
- package/dist/adapter/deepseek-harness/profile-runtime.js +2 -2
- package/dist/adapter/opencode/opencode-transport.js +1 -1
- package/dist/adapter/opencode/opencode-v2-events.js +1 -1
- package/dist/adapter/pi/pi-adapter.js +4 -4
- package/dist/adapter/qwen/index.js +1 -0
- package/dist/adapter/qwen/qwen-adapter.js +4 -0
- package/dist/aibot/client.js +1 -0
- package/dist/aibot/index.js +1 -0
- package/dist/aibot/types.js +0 -0
- package/dist/assets/dsh-bridge/grix-dsh-bridge-4.19.0.tgz +0 -0
- package/dist/assets/dsh-bridge/manifest.json +6 -6
- package/dist/bridge/cli-install-flow.js +1 -1
- package/dist/bridge/cli-install-offer.js +1 -1
- package/dist/bridge/local-action-session-control.js +1 -1
- package/dist/bridge/session-control-open.js +1 -1
- package/dist/core/access/allowlist-gate.js +1 -0
- package/dist/core/access/allowlist-store.js +1 -0
- package/dist/core/access/index.js +1 -0
- package/dist/core/file-ops/handler.js +1 -0
- package/dist/core/file-ops/list-files.js +1 -0
- package/dist/core/file-ops/types.js +0 -0
- package/dist/core/mcp/tools.js +1 -1
- package/dist/default-skills/grix-chat-state/SKILL.md +34 -2
- package/dist/grix.js +0 -0
- package/dist/log.js +3 -0
- package/dist/main.js +31 -0
- package/dist/mcp/stream-http/config.js +1 -0
- package/dist/mcp/stream-http/connection-binding.js +1 -0
- package/dist/mcp/stream-http/event-tool-executor.js +1 -0
- package/dist/mcp/stream-http/gateway.js +1 -0
- package/dist/mcp/stream-http/index.js +1 -0
- package/dist/mcp/stream-http/security.js +1 -0
- package/dist/mcp/stream-http/session-manager.js +1 -0
- package/dist/mcp/stream-http/tool-executor.js +1 -0
- package/dist/mcp/stream-http/tool-registry.js +1 -0
- package/dist/mcp/stream-http/tool-schemas.js +1 -0
- package/dist/session/index.js +1 -0
- package/dist/session/manager.js +1 -0
- package/dist/transport/index.js +1 -0
- package/dist/transport/json-rpc.js +3 -0
- package/openclaw-plugin/index.js +99 -0
- package/openclaw-plugin/skills/grix-chat-state/SKILL.md +33 -1
- package/openclaw.plugin.json +1 -0
- package/package.json +1 -1
- package/dist/assets/dsh-bridge/grix-dsh-bridge-4.18.1.tgz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o={required:["action"],properties:{action:{type:"string",enum:["contact_search","session_search","message_history","message_search"]},id:{type:"string"},keyword:{type:"string",maxLength:200},limit:{type:"integer",minimum:1,maximum:100},offset:{type:"integer",minimum:0},sessionId:{type:"string"},beforeId:{type:"string"}}},a={required:["action"],properties:{action:{type:"string",enum:["create","detail","leave","add_members","remove_members","update_member_role","update_all_members_muted","update_member_speaking","dissolve"]},sessionId:{type:"string"},name:{type:"string",maxLength:128},memberIds:{type:"array",items:{type:"string"},maxItems:100},memberTypes:{type:"array",items:{type:"integer",enum:[1,2]}},memberId:{type:"string"},role:{type:"integer",enum:[1,2]},memberType:{type:"integer"},allMembersMuted:{type:"boolean"},isSpeakMuted:{type:"boolean"},canSpeakWhenAllMuted:{type:"boolean"}}},p={required:["sessionId","content"],properties:{sessionId:{type:"string"},content:{type:"string",maxLength:1e4},msgType:{type:"integer"},quotedMessageId:{type:"string"},threadId:{type:"string"}}},m={required:["sessionId","msgId"],properties:{sessionId:{type:"string"},msgId:{type:"string"}}},g={required:["action"],properties:{action:{type:"string",enum:["create_agent","list_categories","create_category","update_category","assign_category","rotate_api_key"]},agentName:{type:"string"},introduction:{type:"string"},isMain:{type:"boolean"},agentId:{type:"string"},categoryId:{type:"string"},name:{type:"string"},parentId:{type:"string"},sortOrder:{type:"integer"}}},y={required:["session_id","text"],properties:{event_id:{type:"string"},session_id:{type:"string"},text:{type:"string",maxLength:5e4},quoted_message_id:{type:"string"},is_final:{type:"boolean"}}},d={required:["event_id","status"],properties:{event_id:{type:"string"},status:{type:"string",enum:["responded","canceled","failed"]},msg:{type:"string",maxLength:500}}},c={required:["event_id"],properties:{event_id:{type:"string"},session_id:{type:"string"}}},l={required:["session_id","active"],properties:{session_id:{type:"string"},active:{type:"boolean"},event_id:{type:"string"}}},_={required:["action"],properties:{action:{type:"string",enum:["pair_approve","pair_deny","allow_sender","remove_sender","set_policy"]},code:{type:"string"},sender_id:{type:"string"},policy:{type:"string",enum:["allowlist","open","disabled"]}}},f={required:[],properties:{}},C={grix_query:o,grix_group:a,grix_message_send:p,grix_message_unsend:m,grix_admin:g,grix_reply:y,grix_complete:d,grix_event_ack:c,grix_composing:l,grix_access_control:_,grix_status:f};function B(u,t){const e=C[u];if(!e)return{valid:!1,error:`\u672A\u77E5\u5DE5\u5177: ${u}`};for(const i of e.required)if(t[i]===void 0||t[i]===null)return{valid:!1,error:`\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570: ${i}`};for(const[i,r]of Object.entries(t)){if(r==null)continue;const n=e.properties[i];if(!n)continue;const s=$(i,r,n);if(s)return{valid:!1,error:s}}return{valid:!0}}function $(u,t,e){switch(e.type){case"string":if(typeof t!="string")return`\u53C2\u6570 ${u} \u7C7B\u578B\u9519\u8BEF: \u671F\u671B string\uFF0C\u5B9E\u9645 ${typeof t}`;if(e.maxLength!==void 0&&t.length>e.maxLength)return`\u53C2\u6570 ${u} \u8D85\u8FC7\u6700\u5927\u957F\u5EA6 ${e.maxLength}\uFF0C\u5B9E\u9645 ${t.length}`;if(e.enum&&!e.enum.includes(t))return`\u53C2\u6570 ${u} \u503C "${t}" \u4E0D\u5728\u5141\u8BB8\u8303\u56F4 [${e.enum.join(", ")}]`;break;case"integer":if(typeof t!="number"||!Number.isInteger(t))return`\u53C2\u6570 ${u} \u7C7B\u578B\u9519\u8BEF: \u671F\u671B integer\uFF0C\u5B9E\u9645 ${typeof t=="number"?"\u6D6E\u70B9\u6570":typeof t}`;if(e.minimum!==void 0&&t<e.minimum)return`\u53C2\u6570 ${u} \u503C ${t} \u5C0F\u4E8E\u6700\u5C0F\u503C ${e.minimum}`;if(e.maximum!==void 0&&t>e.maximum)return`\u53C2\u6570 ${u} \u503C ${t} \u5927\u4E8E\u6700\u5927\u503C ${e.maximum}`;if(e.enum&&!e.enum.includes(t))return`\u53C2\u6570 ${u} \u503C ${t} \u4E0D\u5728\u5141\u8BB8\u8303\u56F4 [${e.enum.join(", ")}]`;break;case"boolean":if(typeof t!="boolean")return`\u53C2\u6570 ${u} \u7C7B\u578B\u9519\u8BEF: \u671F\u671B boolean\uFF0C\u5B9E\u9645 ${typeof t}`;break;case"array":if(!Array.isArray(t))return`\u53C2\u6570 ${u} \u7C7B\u578B\u9519\u8BEF: \u671F\u671B array\uFF0C\u5B9E\u9645 ${typeof t}`;if(e.maxItems!==void 0&&t.length>e.maxItems)return`\u53C2\u6570 ${u} \u8D85\u8FC7\u6700\u5927\u5143\u7D20\u6570 ${e.maxItems}\uFF0C\u5B9E\u9645 ${t.length}`;if(e.items)for(let i=0;i<t.length;i++){const r=t[i];if(e.items.type==="string"&&typeof r!="string")return`\u53C2\u6570 ${u}[${i}] \u7C7B\u578B\u9519\u8BEF: \u671F\u671B string\uFF0C\u5B9E\u9645 ${typeof r}`;if(e.items.type==="integer"){if(typeof r!="number"||!Number.isInteger(r))return`\u53C2\u6570 ${u}[${i}] \u7C7B\u578B\u9519\u8BEF: \u671F\u671B integer\uFF0C\u5B9E\u9645 ${typeof r}`;if(e.items.enum&&!e.items.enum.includes(r))return`\u53C2\u6570 ${u}[${i}] \u503C ${r} \u4E0D\u5728\u5141\u8BB8\u8303\u56F4 [${e.items.enum.join(", ")}]`}}break}}export{B as validateToolArgs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SessionManager as a}from"./manager.js";export{a as SessionManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{EventEmitter as r}from"events";import{AgentProcess as c}from"../agent/process.js";import{AcpClient as l}from"../protocol/acp-client.js";class h extends r{sessions=new Map;async create(s){const e=new c,n=await e.start(s.agent),i=new l;i.on("event",a=>{this.emit("event",a)}),await i.connect({transport:n,sessionId:s.sessionId,authMethod:s.authMethod,initialMode:s.initialMode});const t=i.sessionId,o={id:t,process:e,client:i};return this.sessions.set(t,o),n.on("close",()=>{this.sessions.delete(t),this.emit("sessionClosed",t)}),this.emit("sessionCreated",t),o}get(s){return this.sessions.get(s)}list(){return[...this.sessions.values()]}async close(s){const e=this.sessions.get(s);e&&(this.sessions.delete(s),await e.process.close(),this.emit("sessionClosed",s))}async closeAll(){const s=[...this.sessions.keys()];await Promise.all(s.map(e=>this.close(e)))}get size(){return this.sessions.size}}export{h as SessionManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{JsonRpcTransport as o}from"./json-rpc.js";export{o as JsonRpcTransport};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{EventEmitter as p}from"events";class w extends p{nextId=1;pending=new Map;writeLock=Promise.resolve();closed=!1;_readable;_writable;_onNotify;_onRequest;constructor(t,e,r,o){super(),this._readable=t,this._writable=e,this._onNotify=r,this._onRequest=o,this.startReadLoop()}setHandlers(t,e){t&&(this._onNotify=t),e&&(this._onRequest=e)}async call(t,e,r){if(this.closed)throw new Error("transport closed");const o=this.nextId++,s=String(o),a=await new Promise((i,d)=>{if(this.pending.set(s,{resolve:i}),r){const n=()=>{this.pending.delete(s),d(new Error(`aborted: ${r.reason??"request cancelled"}`))};if(r.aborted){n();return}r.addEventListener("abort",n,{once:!0});const c=i,h=l=>{r.removeEventListener("abort",n),c(l)};this.pending.set(s,{resolve:h})}this.write({jsonrpc:"2.0",id:o,method:t,params:e??null}).catch(n=>{this.pending.delete(s),d(n)})});if(a.error){const i=new Error(a.error.message);throw i.code=a.error.code,i}return a.result}async notify(t,e){if(this.closed)throw new Error("transport closed");await this.write({jsonrpc:"2.0",method:t,params:e??null})}async respondSuccess(t,e){await this.write({jsonrpc:"2.0",id:t,result:e})}async respondError(t,e,r){await this.write({jsonrpc:"2.0",id:t,error:{code:e,message:r}})}close(){if(!this.closed){this.closed=!0;for(const[t,{resolve:e}]of this.pending)e({error:{code:-32e3,message:"transport closed"}});this.pending.clear(),this._readable.destroy(),this.emit("close")}}startReadLoop(){let t="";this._readable.on("data",e=>{t+=e.toString();const r=t.split(`
|
|
2
|
+
`);t=r.pop()??"";for(const o of r){const s=o.trim();s.length!==0&&this.dispatch(s)}}),this._readable.on("end",()=>{t.trim()&&this.dispatch(t.trim()),this.close()}),this._readable.on("error",e=>{this.emit("error",e),this.close()})}dispatch(t){let e;try{e=JSON.parse(t)}catch{return}if(e.id!=null&&!e.method){this.completePending(e.id,e.result,e.error);return}if(e.method&&(e.id==null||e.id===null)){this._onNotify?.(e.method,e.params);return}e.method&&e.id!=null&&this._onRequest?.(e.method,e.id,e.params)}completePending(t,e,r){const o=String(t),s=this.pending.get(o);s&&(this.pending.delete(o),s.resolve({result:e,error:r}))}async write(t){const e=this.writeLock;return this.writeLock=e.then(async()=>new Promise((r,o)=>{const s=JSON.stringify(t)+`
|
|
3
|
+
`;this._writable.write(s,"utf-8")?r():(this._writable.once("drain",r),this._writable.once("error",o))})),this.writeLock}}export{w as JsonRpcTransport};
|
package/openclaw-plugin/index.js
CHANGED
|
@@ -10989,6 +10989,45 @@ var TOOLS = [
|
|
|
10989
10989
|
properties: {}
|
|
10990
10990
|
}
|
|
10991
10991
|
},
|
|
10992
|
+
{
|
|
10993
|
+
name: "grix_chat_queue",
|
|
10994
|
+
description: "Inspect and control the task queue of a chat session. Actions: list (show queued tasks), cancel (drop a queued task), clear (drop all queued tasks), hold (pause/resume a queued task, ttl_ms clamped to 60s..30min, default 10min), edit (rewrite a queued task's content), reorder (set the desired order of queued tasks). cancel/edit/hold only apply to queued (not running) tasks. A held task at the head of the queue stalls the whole queue. reorder is a desired-order request: missing ids are ignored and newly queued tasks go to the tail. A result with confirmed=false means the command was dispatched but not yet confirmed \u2014 call list again to verify.",
|
|
10995
|
+
inputSchema: {
|
|
10996
|
+
type: "object",
|
|
10997
|
+
properties: {
|
|
10998
|
+
action: {
|
|
10999
|
+
type: "string",
|
|
11000
|
+
enum: ["list", "cancel", "clear", "hold", "edit", "reorder"],
|
|
11001
|
+
description: "Queue action: list, cancel, clear, hold, edit, or reorder."
|
|
11002
|
+
},
|
|
11003
|
+
session_id: { type: "string", description: "Target session ID." },
|
|
11004
|
+
event_id: { type: "string", description: "Queued task event ID (cancel, hold, edit)." },
|
|
11005
|
+
agent_id: { type: "string", description: "(Optional) Agent ID when the session has multiple agents." },
|
|
11006
|
+
hold: { type: "boolean", description: "hold=true pauses the task, hold=false resumes it." },
|
|
11007
|
+
ttl_ms: { type: "integer", description: "(Optional) Hold duration in milliseconds, clamped to 60000..1800000. Defaults to 600000 (10 minutes)." },
|
|
11008
|
+
content: { type: "string", description: "New task content (edit)." },
|
|
11009
|
+
ordered_event_ids: {
|
|
11010
|
+
type: "array",
|
|
11011
|
+
items: { type: "string" },
|
|
11012
|
+
description: "Desired queue order as event IDs (reorder). Must be a non-empty array."
|
|
11013
|
+
}
|
|
11014
|
+
},
|
|
11015
|
+
required: ["action"]
|
|
11016
|
+
},
|
|
11017
|
+
validation: {
|
|
11018
|
+
required: ["action"],
|
|
11019
|
+
properties: {
|
|
11020
|
+
action: { type: "string", enum: ["list", "cancel", "clear", "hold", "edit", "reorder"] },
|
|
11021
|
+
session_id: { type: "string" },
|
|
11022
|
+
event_id: { type: "string" },
|
|
11023
|
+
agent_id: { type: "string" },
|
|
11024
|
+
hold: { type: "boolean" },
|
|
11025
|
+
ttl_ms: { type: "integer" },
|
|
11026
|
+
content: { type: "string" },
|
|
11027
|
+
ordered_event_ids: { type: "array", items: { type: "string" } }
|
|
11028
|
+
}
|
|
11029
|
+
}
|
|
11030
|
+
},
|
|
10992
11031
|
{
|
|
10993
11032
|
name: "grix_access_control",
|
|
10994
11033
|
description: "Manage sender access control: pair approval, allow/remove senders, set policy.",
|
|
@@ -11327,6 +11366,7 @@ var TOOL_SKILL_MAP = {
|
|
|
11327
11366
|
grix_session_send: "grix-owner-relay",
|
|
11328
11367
|
grix_chat_state_query: "grix-chat-state",
|
|
11329
11368
|
grix_chat_state_update: "grix-chat-state",
|
|
11369
|
+
grix_chat_queue: "grix-chat-state",
|
|
11330
11370
|
grix_status: "grix-chat-state",
|
|
11331
11371
|
grix_access_control: "grix-access-control",
|
|
11332
11372
|
grix_widget_visitor_ban: "grix-widget-visitor-ban",
|
|
@@ -11411,6 +11451,8 @@ function toolCallToInvoke(toolName, args) {
|
|
|
11411
11451
|
return buildChatStateQueryInvoke(args);
|
|
11412
11452
|
case "grix_chat_state_update":
|
|
11413
11453
|
return buildChatStateUpdateInvoke(args);
|
|
11454
|
+
case "grix_chat_queue":
|
|
11455
|
+
return buildChatQueueInvoke(args);
|
|
11414
11456
|
case "grix_access_control":
|
|
11415
11457
|
return buildAccessControlInvoke(args);
|
|
11416
11458
|
case "grix_widget_visitor_ban":
|
|
@@ -11632,6 +11674,58 @@ function buildChatStateUpdateInvoke(args) {
|
|
|
11632
11674
|
if (args.reason != null) params.reason = args.reason;
|
|
11633
11675
|
return { action: "chat_state_update", params };
|
|
11634
11676
|
}
|
|
11677
|
+
var CHAT_QUEUE_ACTION_MAP = {
|
|
11678
|
+
list: "chat_queue_list",
|
|
11679
|
+
cancel: "chat_queue_cancel",
|
|
11680
|
+
clear: "chat_queue_clear",
|
|
11681
|
+
hold: "chat_queue_hold",
|
|
11682
|
+
edit: "chat_queue_edit",
|
|
11683
|
+
reorder: "chat_queue_reorder"
|
|
11684
|
+
};
|
|
11685
|
+
var CHAT_QUEUE_REQUIRED_PARAMS = {
|
|
11686
|
+
list: ["session_id"],
|
|
11687
|
+
cancel: ["session_id", "event_id"],
|
|
11688
|
+
clear: ["session_id"],
|
|
11689
|
+
hold: ["session_id", "event_id", "hold"],
|
|
11690
|
+
edit: ["session_id", "event_id", "content"],
|
|
11691
|
+
reorder: ["session_id", "ordered_event_ids"]
|
|
11692
|
+
};
|
|
11693
|
+
var CHAT_QUEUE_EXTRA_PARAMS = {
|
|
11694
|
+
list: ["agent_id"],
|
|
11695
|
+
cancel: ["event_id", "agent_id"],
|
|
11696
|
+
clear: ["agent_id"],
|
|
11697
|
+
hold: ["event_id", "hold", "ttl_ms", "agent_id"],
|
|
11698
|
+
edit: ["event_id", "content", "agent_id"],
|
|
11699
|
+
reorder: ["ordered_event_ids", "agent_id"]
|
|
11700
|
+
};
|
|
11701
|
+
function isMissingArg(value) {
|
|
11702
|
+
if (value === void 0 || value === null) return true;
|
|
11703
|
+
return typeof value === "string" && value.trim() === "";
|
|
11704
|
+
}
|
|
11705
|
+
function buildChatQueueInvoke(args) {
|
|
11706
|
+
const action = String(args.action ?? "");
|
|
11707
|
+
const invokeAction = CHAT_QUEUE_ACTION_MAP[action];
|
|
11708
|
+
if (!invokeAction) throw new Error(`Unknown grix_chat_queue action: ${action}`);
|
|
11709
|
+
for (const field of CHAT_QUEUE_REQUIRED_PARAMS[action]) {
|
|
11710
|
+
if (isMissingArg(args[field])) {
|
|
11711
|
+
throw new Error(`grix_chat_queue ${action} requires ${field}`);
|
|
11712
|
+
}
|
|
11713
|
+
}
|
|
11714
|
+
if (action === "reorder") {
|
|
11715
|
+
const ordered = args.ordered_event_ids;
|
|
11716
|
+
if (!Array.isArray(ordered) || ordered.length === 0) {
|
|
11717
|
+
throw new Error("grix_chat_queue reorder requires a non-empty ordered_event_ids array");
|
|
11718
|
+
}
|
|
11719
|
+
if (ordered.some((id) => typeof id !== "string" || id.trim() === "")) {
|
|
11720
|
+
throw new Error("grix_chat_queue reorder ordered_event_ids must contain only non-empty strings");
|
|
11721
|
+
}
|
|
11722
|
+
}
|
|
11723
|
+
const params = { session_id: args.session_id };
|
|
11724
|
+
for (const field of CHAT_QUEUE_EXTRA_PARAMS[action]) {
|
|
11725
|
+
if (args[field] != null) params[field] = args[field];
|
|
11726
|
+
}
|
|
11727
|
+
return { action: invokeAction, params };
|
|
11728
|
+
}
|
|
11635
11729
|
function buildSkillSetInvoke(args) {
|
|
11636
11730
|
return { action: "skill_set", params: { name: args.name, content: args.content }, timeoutMs: 3e4 };
|
|
11637
11731
|
}
|
|
@@ -11671,6 +11765,7 @@ var PHASE1_INVOKE_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
11671
11765
|
"session_send",
|
|
11672
11766
|
"chat_state_query",
|
|
11673
11767
|
"chat_state_update",
|
|
11768
|
+
...Object.values(CHAT_QUEUE_ACTION_MAP),
|
|
11674
11769
|
"claude_access_control",
|
|
11675
11770
|
"widget_visitor_ban",
|
|
11676
11771
|
"webhook_create",
|
|
@@ -15241,6 +15336,9 @@ function createGrixChatStateQueryTool(api, ctx) {
|
|
|
15241
15336
|
function createGrixChatStateUpdateTool(api, ctx) {
|
|
15242
15337
|
return createGrixInvokeTool({ toolName: "grix_chat_state_update", label: "Grix Chat State Update", api, ctx });
|
|
15243
15338
|
}
|
|
15339
|
+
function createGrixChatQueueTool(api, ctx) {
|
|
15340
|
+
return createGrixInvokeTool({ toolName: "grix_chat_queue", label: "Grix Chat Queue", api, ctx });
|
|
15341
|
+
}
|
|
15244
15342
|
|
|
15245
15343
|
// src/openclaw/admin/access-control-tools.ts
|
|
15246
15344
|
function createGrixAccessControlTool(api, ctx) {
|
|
@@ -15304,6 +15402,7 @@ var plugin = {
|
|
|
15304
15402
|
api.registerTool((ctx) => createGrixSessionSendTool(api, ctx));
|
|
15305
15403
|
api.registerTool((ctx) => createGrixChatStateQueryTool(api, ctx));
|
|
15306
15404
|
api.registerTool((ctx) => createGrixChatStateUpdateTool(api, ctx));
|
|
15405
|
+
api.registerTool((ctx) => createGrixChatQueueTool(api, ctx));
|
|
15307
15406
|
api.registerTool((ctx) => createGrixCallOwnerTool(api, ctx));
|
|
15308
15407
|
api.registerTool((ctx) => createGrixAgentUpdateTool(api, ctx));
|
|
15309
15408
|
api.registerTool((ctx) => createGrixAccessControlTool(api, ctx));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: grix-chat-state
|
|
3
|
-
description: Observe and manage chat task state — query the task state of all the owner's chats (`grix_chat_state_query`)
|
|
3
|
+
description: Observe and manage chat task state and task queues — query the task state of all the owner's chats (`grix_chat_state_query`), manually override one chat's state (`grix_chat_state_update`), and inspect or control a session's queued tasks (`grix_chat_queue`). Trigger when the user asks which chats are running/done/waiting, wants a chat marked done/failed/idle, or wants queued tasks listed, cancelled, cleared, paused, edited, or reordered.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Grix Chat State
|
|
@@ -42,6 +42,38 @@ record and errors if the session has none.
|
|
|
42
42
|
`waiting_question`, `completed`, `failed`, `idle`
|
|
43
43
|
- `reason` (optional) — written to `stop_reason`
|
|
44
44
|
|
|
45
|
+
## Inspect and control the task queue — `grix_chat_queue`
|
|
46
|
+
|
|
47
|
+
One tool with an `action` parameter; `session_id` is always required. Other
|
|
48
|
+
parameters are passed through to the backend.
|
|
49
|
+
|
|
50
|
+
| action | extra parameters | effect |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `list` | `agent_id` (optional) | List queued tasks; returns `items` |
|
|
53
|
+
| `cancel` | `event_id` (required), `agent_id` | Drop one queued task |
|
|
54
|
+
| `clear` | `agent_id` (optional) | Drop all queued tasks |
|
|
55
|
+
| `hold` | `event_id`, `hold` (required), `ttl_ms` (optional), `agent_id` | Pause (`hold=true`) or resume (`hold=false`) one queued task |
|
|
56
|
+
| `edit` | `event_id`, `content` (required), `agent_id` | Rewrite a queued task's content |
|
|
57
|
+
| `reorder` | `ordered_event_ids` (required, non-empty string array), `agent_id` | Set the desired queue order |
|
|
58
|
+
|
|
59
|
+
Semantics to respect:
|
|
60
|
+
|
|
61
|
+
- `cancel`, `edit`, and `hold` only work on **queued** tasks. They cannot touch
|
|
62
|
+
the task that is currently executing; if the user asks to change a running
|
|
63
|
+
task, say so instead of pretending it worked.
|
|
64
|
+
- A held task that reaches the head of the queue stalls the **entire** queue
|
|
65
|
+
until it is resumed or its TTL expires. Mention this when pausing a task near
|
|
66
|
+
the head.
|
|
67
|
+
- `ttl_ms` is clamped by the backend to 60 seconds through 30 minutes, defaults
|
|
68
|
+
to 10 minutes, and the hold is lifted automatically when it expires.
|
|
69
|
+
- `reorder` expresses a **desired order**: ids that no longer exist are ignored,
|
|
70
|
+
and tasks that enter the queue later go to the tail.
|
|
71
|
+
- A response with `confirmed: true` carries the resulting `items`. A response
|
|
72
|
+
with `confirmed: false, dispatched: true` means the command was sent but not
|
|
73
|
+
yet acknowledged — call `list` again to verify the final state before
|
|
74
|
+
reporting success to the owner. `list` may include `stale: true` when the
|
|
75
|
+
connector is offline; treat that snapshot as possibly outdated.
|
|
76
|
+
|
|
45
77
|
## Rules
|
|
46
78
|
|
|
47
79
|
1. Never invent a `session_id`. Resolve it with `grix_query` (`session_search`)
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grix-connector",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.0",
|
|
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",
|
|
Binary file
|