grix-connector 4.18.0 → 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.
Files changed (41) hide show
  1. package/dist/adapter/claude/claude-adapter.js +22 -22
  2. package/dist/adapter/claude/config-paths.js +1 -0
  3. package/dist/adapter/claude/model-list.js +1 -1
  4. package/dist/adapter/claude/session-history.js +2 -2
  5. package/dist/adapter/claude/session-scanner.js +1 -1
  6. package/dist/adapter/claude/skill-scanner.js +2 -2
  7. package/dist/adapter/claude/usage-parser.js +8 -8
  8. package/dist/adapter/deepseek-harness/dsh-version.js +1 -1
  9. package/dist/adapter/deepseek-harness/profile-runtime.js +2 -2
  10. package/dist/adapter/opencode/opencode-transport.js +1 -1
  11. package/dist/adapter/opencode/opencode-v2-events.js +1 -1
  12. package/dist/adapter/pi/pi-adapter.js +4 -4
  13. package/dist/assets/dsh-bridge/grix-dsh-bridge-4.19.0.tgz +0 -0
  14. package/dist/assets/dsh-bridge/manifest.json +6 -6
  15. package/dist/bridge/bridge.js +2 -2
  16. package/dist/bridge/cli-install-flow.js +1 -1
  17. package/dist/bridge/cli-install-offer.js +1 -1
  18. package/dist/bridge/local-action-session-control.js +1 -1
  19. package/dist/bridge/provider-quota.js +1 -1
  20. package/dist/bridge/session-control-open.js +1 -1
  21. package/dist/bridge/session-control-router.js +2 -2
  22. package/dist/bridge/session-list.js +2 -2
  23. package/dist/bridge/session-scan-cache.js +1 -1
  24. package/dist/bridge/session-usage.js +1 -1
  25. package/dist/bridge/skill-actions.js +1 -1
  26. package/dist/bridge/toolbar-meta.js +1 -1
  27. package/dist/core/config/index.js +1 -1
  28. package/dist/core/config/paths.js +1 -1
  29. package/dist/core/mcp/tools.js +1 -1
  30. package/dist/core/skill-sync/enable-roots.js +1 -1
  31. package/dist/core/skill-sync/library-skills.js +1 -1
  32. package/dist/core/skill-sync/skill-enable.js +1 -1
  33. package/dist/default-skills/grix-chat-state/SKILL.md +34 -2
  34. package/dist/manager.js +1 -1
  35. package/dist/mcp/stream-http/security.js +1 -1
  36. package/openclaw-plugin/audit-recorder-worker.js +52 -52
  37. package/openclaw-plugin/index.js +164 -65
  38. package/openclaw-plugin/skills/grix-chat-state/SKILL.md +33 -1
  39. package/openclaw.plugin.json +1 -0
  40. package/package.json +1 -1
  41. package/dist/assets/dsh-bridge/grix-dsh-bridge-4.18.0.tgz +0 -0
@@ -901,9 +901,9 @@ var FileAuditReplayStore = class {
901
901
  const directory = join2(root, auditKey);
902
902
  for (const name of await readDirectory(directory)) {
903
903
  if (!name.endsWith(".json")) continue;
904
- const path8 = join2(directory, name);
905
- const manifest = await this.readManifest(path8);
906
- if (manifest) manifests.push({ path: path8, manifest });
904
+ const path9 = join2(directory, name);
905
+ const manifest = await this.readManifest(path9);
906
+ if (manifest) manifests.push({ path: path9, manifest });
907
907
  }
908
908
  }
909
909
  return manifests;
@@ -961,8 +961,8 @@ var FileAuditReplayStore = class {
961
961
  }
962
962
  const plaintext = Buffer.from(content.value, "utf8");
963
963
  const contentId = sha256(plaintext);
964
- const path8 = this.blobPath(contentId);
965
- await this.storePlaintextBlob(path8, contentId, plaintext);
964
+ const path9 = this.blobPath(contentId);
965
+ await this.storePlaintextBlob(path9, contentId, plaintext);
966
966
  const reference = {
967
967
  contentId,
968
968
  role: content.role,
@@ -974,31 +974,31 @@ var FileAuditReplayStore = class {
974
974
  truncated: false,
975
975
  redacted: false,
976
976
  captureLevel: content.captureLevel ?? "reconstructed",
977
- storagePath: this.relativePath(path8)
977
+ storagePath: this.relativePath(path9)
978
978
  };
979
979
  return { ...metadata, reference };
980
980
  }
981
- async storePlaintextBlob(path8, contentId, plaintext) {
982
- if (await pathExists(path8)) {
983
- const existing = await readFile(path8);
981
+ async storePlaintextBlob(path9, contentId, plaintext) {
982
+ if (await pathExists(path9)) {
983
+ const existing = await readFile(path9);
984
984
  if (sha256(existing) === contentId) return;
985
985
  }
986
- await this.atomicWrite(path8, plaintext);
986
+ await this.atomicWrite(path9, plaintext);
987
987
  }
988
- async writeImmutable(path8, body) {
989
- if (await pathExists(path8)) return;
990
- await this.atomicWrite(path8, body);
988
+ async writeImmutable(path9, body) {
989
+ if (await pathExists(path9)) return;
990
+ await this.atomicWrite(path9, body);
991
991
  }
992
- async atomicWrite(path8, body) {
993
- const directory = dirname2(path8);
992
+ async atomicWrite(path9, body) {
993
+ const directory = dirname2(path9);
994
994
  await mkdir2(directory, { recursive: true, mode: 448 });
995
995
  const temporary = join2(
996
996
  directory,
997
- `.${basename(path8)}.${process.pid}.${randomUUID()}.tmp`
997
+ `.${basename(path9)}.${process.pid}.${randomUUID()}.tmp`
998
998
  );
999
999
  try {
1000
1000
  await writeFile2(temporary, body, { mode: 384, flag: "wx" });
1001
- await rename2(temporary, path8);
1001
+ await rename2(temporary, path9);
1002
1002
  } finally {
1003
1003
  await rm2(temporary, { force: true });
1004
1004
  }
@@ -1040,29 +1040,29 @@ var FileAuditReplayStore = class {
1040
1040
  `${contentId}.blob`
1041
1041
  );
1042
1042
  }
1043
- relativePath(path8) {
1044
- return relative(this.rootDir, path8).split(sep2).join("/");
1043
+ relativePath(path9) {
1044
+ return relative(this.rootDir, path9).split(sep2).join("/");
1045
1045
  }
1046
- resolveStoredPath(path8) {
1047
- const resolved = resolve2(this.rootDir, path8);
1046
+ resolveStoredPath(path9) {
1047
+ const resolved = resolve2(this.rootDir, path9);
1048
1048
  if (resolved !== this.rootDir && !resolved.startsWith(`${this.rootDir}${sep2}`)) {
1049
1049
  throw new Error("Audit replay path escapes the storage root");
1050
1050
  }
1051
1051
  return resolved;
1052
1052
  }
1053
- async readManifest(path8) {
1054
- const value = await readJsonIfPresent(path8);
1053
+ async readManifest(path9) {
1054
+ const value = await readJsonIfPresent(path9);
1055
1055
  if (!value) return void 0;
1056
1056
  return value;
1057
1057
  }
1058
- async readIndex(path8) {
1059
- const value = await readJsonIfPresent(path8);
1058
+ async readIndex(path9) {
1059
+ const value = await readJsonIfPresent(path9);
1060
1060
  if (!value) return void 0;
1061
1061
  return value;
1062
1062
  }
1063
1063
  async readReplay(manifest) {
1064
- const path8 = this.resolveStoredPath(manifest.replayPath);
1065
- const bytes = await readFile(path8);
1064
+ const path9 = this.resolveStoredPath(manifest.replayPath);
1065
+ const bytes = await readFile(path9);
1066
1066
  if (sha256(bytes) !== manifest.replaySha256) {
1067
1067
  throw new Error("Audit replay document hash mismatch");
1068
1068
  }
@@ -1131,26 +1131,26 @@ function sha256(value) {
1131
1131
  function idKey(id) {
1132
1132
  return sha256(Buffer.from(id, "utf8"));
1133
1133
  }
1134
- async function pathExists(path8) {
1134
+ async function pathExists(path9) {
1135
1135
  try {
1136
- await access2(path8);
1136
+ await access2(path9);
1137
1137
  return true;
1138
1138
  } catch (error) {
1139
1139
  if (isNotFound(error)) return false;
1140
1140
  throw error;
1141
1141
  }
1142
1142
  }
1143
- async function readDirectory(path8) {
1143
+ async function readDirectory(path9) {
1144
1144
  try {
1145
- return await readdir(path8);
1145
+ return await readdir(path9);
1146
1146
  } catch (error) {
1147
1147
  if (isNotFound(error)) return [];
1148
1148
  throw error;
1149
1149
  }
1150
1150
  }
1151
- async function readJsonIfPresent(path8) {
1151
+ async function readJsonIfPresent(path9) {
1152
1152
  try {
1153
- return JSON.parse(await readFile(path8, "utf8"));
1153
+ return JSON.parse(await readFile(path9, "utf8"));
1154
1154
  } catch (error) {
1155
1155
  if (isNotFound(error)) return void 0;
1156
1156
  throw error;
@@ -2155,7 +2155,7 @@ import { join as join4 } from "node:path";
2155
2155
  import { homedir as homedir4, tmpdir } from "node:os";
2156
2156
 
2157
2157
  // src/core/config/paths.ts
2158
- import { join as join3 } from "node:path";
2158
+ import path3, { join as join3 } from "node:path";
2159
2159
  import { homedir as homedir3 } from "node:os";
2160
2160
  var GRIX_HOME_ENV = "GRIX_CONNECTOR_HOME";
2161
2161
  var DEFAULT_GRIX_HOME = join3(homedir3(), ".grix");
@@ -3081,7 +3081,7 @@ function createDefaultAuditProducer(options = {}) {
3081
3081
 
3082
3082
  // src/openclaw/shared/file-operations/create-folder.ts
3083
3083
  import * as os4 from "node:os";
3084
- import * as path3 from "node:path";
3084
+ import * as path4 from "node:path";
3085
3085
  async function handleCreateFolderAction(params, context) {
3086
3086
  if (!params.name || typeof params.name !== "string") {
3087
3087
  return {
@@ -3108,7 +3108,7 @@ async function handleCreateFolderAction(params, context) {
3108
3108
  const cwd = context.resolveCwd ? await context.resolveCwd(params.session_id) : null;
3109
3109
  const fallbackDir = context.fallbackDir ?? os4.homedir();
3110
3110
  const normalizedParentId = params.parent_id ? normalizePlatformPath(params.parent_id) : null;
3111
- const parentDir = normalizedParentId ? path3.resolve(normalizedParentId) : cwd || fallbackDir;
3111
+ const parentDir = normalizedParentId ? path4.resolve(normalizedParentId) : cwd || fallbackDir;
3112
3112
  let realParent;
3113
3113
  try {
3114
3114
  realParent = await realpath(parentDir);
@@ -3149,7 +3149,7 @@ async function handleCreateFolderAction(params, context) {
3149
3149
  error_msg: `Cannot access parent directory: ${parentDir}`
3150
3150
  };
3151
3151
  }
3152
- const folderPath = path3.join(realParent, trimmed);
3152
+ const folderPath = path4.join(realParent, trimmed);
3153
3153
  try {
3154
3154
  await mkdir(folderPath);
3155
3155
  } catch (err2) {
@@ -3179,8 +3179,8 @@ async function handleCreateFolderAction(params, context) {
3179
3179
  };
3180
3180
  }
3181
3181
  function isWithinPath2(target, ancestor) {
3182
- const normalizedTarget = target.endsWith(path3.sep) ? target : target + path3.sep;
3183
- const normalizedAncestor = ancestor.endsWith(path3.sep) ? ancestor : ancestor + path3.sep;
3182
+ const normalizedTarget = target.endsWith(path4.sep) ? target : target + path4.sep;
3183
+ const normalizedAncestor = ancestor.endsWith(path4.sep) ? ancestor : ancestor + path4.sep;
3184
3184
  return normalizedTarget.startsWith(normalizedAncestor) || target === ancestor;
3185
3185
  }
3186
3186
 
@@ -6796,10 +6796,10 @@ function detectAibotStructuredCardKind(payload) {
6796
6796
  }
6797
6797
 
6798
6798
  // src/openclaw/inbound-event-recovery.ts
6799
- import path4 from "node:path";
6799
+ import path5 from "node:path";
6800
6800
  import { fileURLToPath as fileURLToPath3 } from "node:url";
6801
- var DEFAULT_RECOVERY_BASE_DIR = path4.join(
6802
- path4.dirname(fileURLToPath3(import.meta.url)),
6801
+ var DEFAULT_RECOVERY_BASE_DIR = path5.join(
6802
+ path5.dirname(fileURLToPath3(import.meta.url)),
6803
6803
  "..",
6804
6804
  "..",
6805
6805
  "..",
@@ -6820,21 +6820,21 @@ function resolveRecordId(accountId, event) {
6820
6820
  function resolveBaseDir(baseDir) {
6821
6821
  const normalized = normalizeText2(baseDir);
6822
6822
  if (normalized) {
6823
- return path4.resolve(normalized);
6823
+ return path5.resolve(normalized);
6824
6824
  }
6825
6825
  return DEFAULT_RECOVERY_BASE_DIR;
6826
6826
  }
6827
6827
  function resolveRecoveryDir(accountId, baseDir) {
6828
- return path4.join(resolveBaseDir(baseDir), encodeURIComponent(accountId));
6828
+ return path5.join(resolveBaseDir(baseDir), encodeURIComponent(accountId));
6829
6829
  }
6830
6830
  function resolveRecordFilePath(accountId, recordId, baseDir) {
6831
- return path4.join(
6831
+ return path5.join(
6832
6832
  resolveRecoveryDir(accountId, baseDir),
6833
6833
  `${encodeURIComponent(recordId)}.json`
6834
6834
  );
6835
6835
  }
6836
6836
  async function writeRecord(record2, filePath) {
6837
- const directory = path4.dirname(filePath);
6837
+ const directory = path5.dirname(filePath);
6838
6838
  await mkdir(directory, { recursive: true });
6839
6839
  const tempPath = `${filePath}.tmp-${process.pid}-${Date.now()}`;
6840
6840
  await writeFile(tempPath, JSON.stringify(record2), "utf8");
@@ -6923,7 +6923,7 @@ async function loadRecoverablePendingInboundEvents(params) {
6923
6923
  if (!fileName.endsWith(".json")) {
6924
6924
  continue;
6925
6925
  }
6926
- const filePath = path4.join(directory, fileName);
6926
+ const filePath = path5.join(directory, fileName);
6927
6927
  try {
6928
6928
  const record2 = await readRecord(filePath);
6929
6929
  if (!record2) {
@@ -8456,9 +8456,9 @@ async function resolveTranscriptPath(storePath, sessionKey) {
8456
8456
  return void 0;
8457
8457
  }
8458
8458
  }
8459
- async function fileSnapshot(path8, comparisonLength) {
8460
- if (!path8) return void 0;
8461
- const handle = await open2(path8, "r").catch(() => void 0);
8459
+ async function fileSnapshot(path9, comparisonLength) {
8460
+ if (!path9) return void 0;
8461
+ const handle = await open2(path9, "r").catch(() => void 0);
8462
8462
  if (!handle) return void 0;
8463
8463
  try {
8464
8464
  const source = await handle.stat();
@@ -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",
@@ -13218,8 +13313,8 @@ var LocalBindingError = class extends Error {
13218
13313
  this.name = "LocalBindingError";
13219
13314
  }
13220
13315
  };
13221
- async function getConfigJson(path8) {
13222
- const result = await execOpenClaw(["config", "get", "--json", path8]);
13316
+ async function getConfigJson(path9) {
13317
+ const result = await execOpenClaw(["config", "get", "--json", path9]);
13223
13318
  if (result.exitCode !== 0) return void 0;
13224
13319
  try {
13225
13320
  return JSON.parse(result.stdout.trim());
@@ -13227,11 +13322,11 @@ async function getConfigJson(path8) {
13227
13322
  return void 0;
13228
13323
  }
13229
13324
  }
13230
- async function setConfigJson(path8, value) {
13325
+ async function setConfigJson(path9, value) {
13231
13326
  const jsonStr = JSON.stringify(value);
13232
- const result = await execOpenClaw(["config", "set", path8, jsonStr, "--strict-json"]);
13327
+ const result = await execOpenClaw(["config", "set", path9, jsonStr, "--strict-json"]);
13233
13328
  if (result.exitCode !== 0) {
13234
- throw new LocalBindingError(`config set ${path8} failed: ${result.stderr}`);
13329
+ throw new LocalBindingError(`config set ${path9} failed: ${result.stderr}`);
13235
13330
  }
13236
13331
  }
13237
13332
  async function validateConfig() {
@@ -14576,11 +14671,11 @@ function createOpenClawMemorySetupTool(api, ctx) {
14576
14671
  }
14577
14672
 
14578
14673
  // src/openclaw/shared/file-serve/handler.ts
14579
- import * as path6 from "node:path";
14674
+ import * as path7 from "node:path";
14580
14675
 
14581
14676
  // src/openclaw/shared/file-serve/file-server.ts
14582
14677
  import { randomUUID as randomUUID7 } from "node:crypto";
14583
- import * as path5 from "node:path";
14678
+ import * as path6 from "node:path";
14584
14679
  var IMAGE_MIME = {
14585
14680
  ".jpg": "image/jpeg",
14586
14681
  ".jpeg": "image/jpeg",
@@ -14595,7 +14690,7 @@ var IMAGE_MIME = {
14595
14690
  ".avif": "image/avif"
14596
14691
  };
14597
14692
  function imageMimeType(fileName) {
14598
- return IMAGE_MIME[path5.extname(fileName).toLowerCase()];
14693
+ return IMAGE_MIME[path6.extname(fileName).toLowerCase()];
14599
14694
  }
14600
14695
  var VIDEO_MIME = {
14601
14696
  ".mp4": "video/mp4",
@@ -14639,7 +14734,7 @@ var BROWSER_VIEW_MIME = {
14639
14734
  ".pdf": "application/pdf"
14640
14735
  };
14641
14736
  function inlineMimeType(fileName) {
14642
- const ext = path5.extname(fileName).toLowerCase();
14737
+ const ext = path6.extname(fileName).toLowerCase();
14643
14738
  return IMAGE_MIME[ext] ?? VIDEO_MIME[ext] ?? AUDIO_MIME[ext] ?? BROWSER_VIEW_MIME[ext];
14644
14739
  }
14645
14740
  var DEFAULT_TTL_MS = 365 * 24 * 60 * 60 * 1e3;
@@ -14754,7 +14849,7 @@ async function registerFileForServe(params) {
14754
14849
  sweepExpired(now);
14755
14850
  await ensureServer(params.host);
14756
14851
  const token = randomUUID7();
14757
- const fileName = path5.basename(params.filePath);
14852
+ const fileName = path6.basename(params.filePath);
14758
14853
  const ttl = params.ttlMs && params.ttlMs > 0 ? params.ttlMs : DEFAULT_TTL_MS;
14759
14854
  const expiresAt = now + ttl;
14760
14855
  entries.set(token, {
@@ -14778,7 +14873,7 @@ async function handleFileServeAction(params) {
14778
14873
  if (!filePath) {
14779
14874
  return { status: "failed", error_code: "invalid_payload", error_msg: "missing params.file_path" };
14780
14875
  }
14781
- if (!path6.isAbsolute(filePath)) {
14876
+ if (!path7.isAbsolute(filePath)) {
14782
14877
  return { status: "failed", error_code: "invalid_payload", error_msg: "file_path must be an absolute path" };
14783
14878
  }
14784
14879
  const tailnetIp = await detectTailnetIPv4();
@@ -14870,7 +14965,7 @@ function createGrixFileLinkTool(_api, _ctx) {
14870
14965
  import { randomUUID as randomUUID8 } from "node:crypto";
14871
14966
 
14872
14967
  // src/core/protocol/attachment-file.ts
14873
- import path7 from "node:path";
14968
+ import path8 from "node:path";
14874
14969
  import { readFile as readFile5, stat as stat2 } from "node:fs/promises";
14875
14970
 
14876
14971
  // src/core/util/normalize-string.ts
@@ -14914,7 +15009,7 @@ var UPLOADABLE_EXTENSIONS = /* @__PURE__ */ new Set([
14914
15009
  "avi"
14915
15010
  ]);
14916
15011
  function extensionOf(fileName) {
14917
- const extension = path7.extname(normalizeString(fileName)).toLowerCase();
15012
+ const extension = path8.extname(normalizeString(fileName)).toLowerCase();
14918
15013
  return extension.startsWith(".") ? extension.slice(1) : extension;
14919
15014
  }
14920
15015
  function resolveAttachmentType(contentType) {
@@ -14993,12 +15088,12 @@ function resolveContentType(fileName) {
14993
15088
  async function readReplyFile(filePath) {
14994
15089
  const normalizedPath = normalizeString(filePath);
14995
15090
  if (!normalizedPath) throw new Error("file path must be a non-empty absolute path");
14996
- if (!path7.isAbsolute(normalizedPath)) throw new Error(`file requires an absolute path: ${normalizedPath}`);
15091
+ if (!path8.isAbsolute(normalizedPath)) throw new Error(`file requires an absolute path: ${normalizedPath}`);
14997
15092
  const fileStat = await stat2(normalizedPath);
14998
15093
  if (!fileStat.isFile()) throw new Error(`path is not a file: ${normalizedPath}`);
14999
15094
  if (fileStat.size <= 0) throw new Error(`file is empty: ${normalizedPath}`);
15000
15095
  if (fileStat.size > MAX_REPLY_FILE_BYTES) throw new Error(`file exceeds 50MB: ${normalizedPath}`);
15001
- const fileName = path7.basename(normalizedPath);
15096
+ const fileName = path8.basename(normalizedPath);
15002
15097
  const extension = extensionOf(fileName);
15003
15098
  if (!extension || !UPLOADABLE_EXTENSIONS.has(extension)) {
15004
15099
  throw new Error(`unsupported file type: ${fileName}`);
@@ -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`) and manually override one chat's state (`grix_chat_state_update`). Trigger when the user asks which chats are running/done/waiting, or wants a chat marked done/failed/idle.
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`)
@@ -27,6 +27,7 @@
27
27
  "grix_session_send",
28
28
  "grix_chat_state_query",
29
29
  "grix_chat_state_update",
30
+ "grix_chat_queue",
30
31
  "grix_call_owner",
31
32
  "grix_agent_update",
32
33
  "grix_access_control",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grix-connector",
3
- "version": "4.18.0",
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",