grix-connector 3.33.3 → 3.34.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/acp/acp-adapter.js +5 -5
- package/dist/adapter/agy/agy-adapter.js +9 -9
- package/dist/adapter/agy/quota.js +5 -5
- package/dist/adapter/claude/claude-adapter.js +21 -21
- 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/codex/codex-bridge.js +9 -9
- package/dist/adapter/deepseek/deepseek-adapter.js +6 -0
- package/dist/adapter/deepseek/index.js +1 -0
- package/dist/adapter/deepseek-harness/jsonrpc-adapter.js +2 -2
- package/dist/adapter/opencode/opencode-adapter.js +3 -3
- 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-3.33.3.tgz → grix-dsh-bridge-3.34.0.tgz} +0 -0
- package/dist/assets/dsh-bridge/manifest.json +5 -5
- package/dist/audit/adapters/agy/agy-audit-adapter.js +1 -0
- package/dist/audit/core/audit-state.js +1 -1
- package/dist/audit/worker/audit-recorder-worker-entry.js +1 -1
- package/dist/bridge/adapter-pool.js +1 -1
- package/dist/bridge/bridge.js +9 -9
- package/dist/bridge/deferred-events.js +1 -1
- package/dist/bridge/lifecycle-barrier.js +1 -0
- package/dist/bridge/pending-event-coordinator.js +1 -0
- 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/aibot/client.js +2 -2
- 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/observability/sentry.js +1 -1
- package/dist/core/persistence/pending-event-store.js +1 -0
- package/dist/core/protocol/interaction-parser.js +1 -1
- package/dist/core/proxy/hermes-profile-relay.py +34 -15
- package/dist/core/proxy/relay-state-sync.js +1 -1
- package/dist/core/runtime/spawn.js +2 -3
- package/dist/core/upgrade/upgrade-checker.js +1 -1
- package/dist/default-skills/grix-agent-dispatch/SKILL.md +19 -9
- package/dist/grix.js +0 -0
- package/dist/log.js +3 -0
- package/dist/main.js +31 -0
- package/dist/manager-share-config.js +1 -1
- package/dist/manager.js +2 -2
- 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/service/process-control.js +1 -1
- 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/audit-recorder-worker.js +364 -35
- package/openclaw-plugin/index.js +1 -0
- package/package.json +1 -1
|
@@ -1291,7 +1291,7 @@ function groupMessages(job, evidence, anomalies) {
|
|
|
1291
1291
|
});
|
|
1292
1292
|
continue;
|
|
1293
1293
|
}
|
|
1294
|
-
const
|
|
1294
|
+
const timestamp5 = asTimestamp(line.record.timestamp, job.startedAt);
|
|
1295
1295
|
let group = groups.get(messageId);
|
|
1296
1296
|
if (!group) {
|
|
1297
1297
|
group = {
|
|
@@ -1301,14 +1301,14 @@ function groupMessages(job, evidence, anomalies) {
|
|
|
1301
1301
|
sourcePath: line.sourcePath,
|
|
1302
1302
|
isSubagent: line.isSubagent,
|
|
1303
1303
|
promptId: targetPromptId,
|
|
1304
|
-
startedAt:
|
|
1305
|
-
endedAt:
|
|
1304
|
+
startedAt: timestamp5,
|
|
1305
|
+
endedAt: timestamp5,
|
|
1306
1306
|
samples: [],
|
|
1307
1307
|
blocks: []
|
|
1308
1308
|
};
|
|
1309
1309
|
groups.set(messageId, group);
|
|
1310
1310
|
} else {
|
|
1311
|
-
group.endedAt =
|
|
1311
|
+
group.endedAt = timestamp5;
|
|
1312
1312
|
if (typeof line.record.requestId === "string") {
|
|
1313
1313
|
group.requestId = line.record.requestId;
|
|
1314
1314
|
}
|
|
@@ -2299,9 +2299,9 @@ function stableHash(value) {
|
|
|
2299
2299
|
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
2300
2300
|
}
|
|
2301
2301
|
function observedAt(value) {
|
|
2302
|
-
const
|
|
2303
|
-
if (!
|
|
2304
|
-
return
|
|
2302
|
+
const timestamp5 = stringValue2(value);
|
|
2303
|
+
if (!timestamp5 || Number.isNaN(Date.parse(timestamp5))) return void 0;
|
|
2304
|
+
return timestamp5;
|
|
2305
2305
|
}
|
|
2306
2306
|
function captureOptions2(job) {
|
|
2307
2307
|
return job.options?.enabled === true ? job.options.capture : DEFAULT_CAPTURE2;
|
|
@@ -2816,7 +2816,7 @@ function toSpan(job, candidate, modelId) {
|
|
|
2816
2816
|
if (candidate.snapshotKey) {
|
|
2817
2817
|
nativeIds2.usageSnapshotId = stableHash(candidate.snapshotKey);
|
|
2818
2818
|
}
|
|
2819
|
-
const
|
|
2819
|
+
const timestamp5 = candidate.observedAt ?? job.startedAt;
|
|
2820
2820
|
return {
|
|
2821
2821
|
spanId: `codex-llm-${stableHash(`${job.traceId}|${nativeRequestId}`)}`,
|
|
2822
2822
|
traceId: job.traceId,
|
|
@@ -2827,8 +2827,8 @@ function toSpan(job, candidate, modelId) {
|
|
|
2827
2827
|
name: "codex response",
|
|
2828
2828
|
sequence: candidate.sequence,
|
|
2829
2829
|
status: "completed",
|
|
2830
|
-
startedAt:
|
|
2831
|
-
endedAt:
|
|
2830
|
+
startedAt: timestamp5,
|
|
2831
|
+
endedAt: timestamp5,
|
|
2832
2832
|
...modelId ? { modelId } : {},
|
|
2833
2833
|
inputRefs: [],
|
|
2834
2834
|
outputRefs: [],
|
|
@@ -4378,9 +4378,9 @@ function eventTime(value) {
|
|
|
4378
4378
|
}
|
|
4379
4379
|
return void 0;
|
|
4380
4380
|
}
|
|
4381
|
-
function withinTurn(
|
|
4382
|
-
if (!
|
|
4383
|
-
const at = Date.parse(
|
|
4381
|
+
function withinTurn(timestamp5, job) {
|
|
4382
|
+
if (!timestamp5) return false;
|
|
4383
|
+
const at = Date.parse(timestamp5);
|
|
4384
4384
|
return at >= Date.parse(job.startedAt) - 5e3 && at <= Date.parse(job.endedAt) + 3e4;
|
|
4385
4385
|
}
|
|
4386
4386
|
function contentText2(value) {
|
|
@@ -5023,8 +5023,8 @@ function lineEvent(line) {
|
|
|
5023
5023
|
return line.record.type === "context.append_loop_event" && isRecord7(line.record.event) ? line.record.event : void 0;
|
|
5024
5024
|
}
|
|
5025
5025
|
function withinTurn2(value, job) {
|
|
5026
|
-
const
|
|
5027
|
-
return Number.isFinite(
|
|
5026
|
+
const timestamp5 = Date.parse(isoTime(value, ""));
|
|
5027
|
+
return Number.isFinite(timestamp5) && timestamp5 >= Date.parse(job.startedAt) - 5e3 && timestamp5 <= Date.parse(job.endedAt) + 3e4;
|
|
5028
5028
|
}
|
|
5029
5029
|
async function readJsonl2(sourcePath) {
|
|
5030
5030
|
const raw = await readFile4(sourcePath, "utf8");
|
|
@@ -8059,7 +8059,7 @@ var DeepSeekHarnessAuditAdapter = class {
|
|
|
8059
8059
|
const mapped = mapDshSessionEvent(event);
|
|
8060
8060
|
const eventSessionId = String(event.sessionId ?? "");
|
|
8061
8061
|
const isChild = !!eventSessionId && !!rootSessionId && eventSessionId !== rootSessionId;
|
|
8062
|
-
const
|
|
8062
|
+
const timestamp5 = iso(record4.at, job.startedAt);
|
|
8063
8063
|
if (mapped.kind === "thinking") {
|
|
8064
8064
|
if (capture.thinking && mapped.text) {
|
|
8065
8065
|
addContent10(contents, { role: "thinking", format: "text", value: mapped.text, captureLevel: "runtime_exact" });
|
|
@@ -8134,9 +8134,9 @@ var DeepSeekHarnessAuditAdapter = class {
|
|
|
8134
8134
|
continue;
|
|
8135
8135
|
}
|
|
8136
8136
|
tool.span.status = mapped.isError ? "failed" : "completed";
|
|
8137
|
-
tool.span.endedAt =
|
|
8137
|
+
tool.span.endedAt = timestamp5;
|
|
8138
8138
|
const startMs = Date.parse(tool.span.startedAt);
|
|
8139
|
-
const endMs = Date.parse(
|
|
8139
|
+
const endMs = Date.parse(timestamp5);
|
|
8140
8140
|
if (Number.isFinite(startMs) && Number.isFinite(endMs)) {
|
|
8141
8141
|
tool.span.durationMs = Math.max(0, endMs - startMs);
|
|
8142
8142
|
}
|
|
@@ -8234,7 +8234,7 @@ function turnSpan(job, spanId) {
|
|
|
8234
8234
|
};
|
|
8235
8235
|
}
|
|
8236
8236
|
function simpleSpan(job, parentSpanId, sequence, kind, name, at, nativeIds2) {
|
|
8237
|
-
const
|
|
8237
|
+
const timestamp5 = iso(at, job.startedAt);
|
|
8238
8238
|
return {
|
|
8239
8239
|
spanId: `deepseek-harness:${job.turnId}:${sequence}`,
|
|
8240
8240
|
traceId: job.traceId,
|
|
@@ -8245,8 +8245,8 @@ function simpleSpan(job, parentSpanId, sequence, kind, name, at, nativeIds2) {
|
|
|
8245
8245
|
name,
|
|
8246
8246
|
sequence,
|
|
8247
8247
|
status: "completed",
|
|
8248
|
-
startedAt:
|
|
8249
|
-
endedAt:
|
|
8248
|
+
startedAt: timestamp5,
|
|
8249
|
+
endedAt: timestamp5,
|
|
8250
8250
|
inputRefs: [],
|
|
8251
8251
|
outputRefs: [],
|
|
8252
8252
|
provider: { provider: "deepseek-harness", nativeEventType: name, nativeIds: nativeIds2 },
|
|
@@ -8304,10 +8304,338 @@ function usageSpan(job, parentSpanId, sequence, at, raw, requestId2, modelId, pr
|
|
|
8304
8304
|
return span2;
|
|
8305
8305
|
}
|
|
8306
8306
|
|
|
8307
|
+
// src/audit/adapters/agy/agy-audit-adapter.ts
|
|
8308
|
+
import { readFile as readFile5 } from "node:fs/promises";
|
|
8309
|
+
var DEFAULT_CAPTURE11 = Object.freeze({
|
|
8310
|
+
inputOutput: true,
|
|
8311
|
+
tools: true,
|
|
8312
|
+
subagents: false,
|
|
8313
|
+
thinking: true,
|
|
8314
|
+
rawProviderBody: false
|
|
8315
|
+
});
|
|
8316
|
+
var AGY_LOG_EXCERPT_MAX_CHARS = 256e3;
|
|
8317
|
+
function isRecord14(value) {
|
|
8318
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8319
|
+
}
|
|
8320
|
+
function stringValue10(value) {
|
|
8321
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
8322
|
+
}
|
|
8323
|
+
function offsetValue(value) {
|
|
8324
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
8325
|
+
}
|
|
8326
|
+
function captureOptions11(job) {
|
|
8327
|
+
return job.options?.enabled === true ? job.options.capture : DEFAULT_CAPTURE11;
|
|
8328
|
+
}
|
|
8329
|
+
function addContent11(contents, seen, content) {
|
|
8330
|
+
const key = [content.role, content.value ?? ""].join("\0");
|
|
8331
|
+
if (seen.has(key)) return seen.get(key);
|
|
8332
|
+
const reference = referenceCaptureContent(content);
|
|
8333
|
+
seen.set(key, reference);
|
|
8334
|
+
contents.push(content);
|
|
8335
|
+
return reference;
|
|
8336
|
+
}
|
|
8337
|
+
function append5(target, reference) {
|
|
8338
|
+
if (reference && !target.some((item) => item.contentId === reference.contentId)) {
|
|
8339
|
+
target.push(reference);
|
|
8340
|
+
}
|
|
8341
|
+
}
|
|
8342
|
+
function timestamp4(value, fallback) {
|
|
8343
|
+
return typeof value === "string" && Number.isFinite(Date.parse(value)) ? value : fallback;
|
|
8344
|
+
}
|
|
8345
|
+
function makeSpan8(input) {
|
|
8346
|
+
const startedAt = input.startedAt ?? input.job.startedAt;
|
|
8347
|
+
const endedAt = input.endedAt ?? input.job.endedAt;
|
|
8348
|
+
const startMs = Date.parse(startedAt);
|
|
8349
|
+
const endMs = Date.parse(endedAt);
|
|
8350
|
+
return {
|
|
8351
|
+
spanId: input.spanId,
|
|
8352
|
+
traceId: input.job.traceId,
|
|
8353
|
+
turnId: input.job.turnId,
|
|
8354
|
+
sessionId: input.job.sessionId,
|
|
8355
|
+
...input.parentSpanId ? { parentSpanId: input.parentSpanId } : {},
|
|
8356
|
+
kind: input.kind,
|
|
8357
|
+
name: input.name,
|
|
8358
|
+
sequence: input.sequence,
|
|
8359
|
+
status: input.status ?? "completed",
|
|
8360
|
+
startedAt,
|
|
8361
|
+
endedAt,
|
|
8362
|
+
...Number.isFinite(startMs) && Number.isFinite(endMs) ? { durationMs: Math.max(0, endMs - startMs) } : {},
|
|
8363
|
+
inputRefs: [],
|
|
8364
|
+
outputRefs: [],
|
|
8365
|
+
provider: {
|
|
8366
|
+
provider: "agy",
|
|
8367
|
+
nativeEventType: input.nativeEventType,
|
|
8368
|
+
nativeIds: Object.fromEntries(
|
|
8369
|
+
Object.entries(input.nativeIds ?? {}).filter(
|
|
8370
|
+
(entry) => typeof entry[1] === "string"
|
|
8371
|
+
)
|
|
8372
|
+
),
|
|
8373
|
+
...input.rawAttributes ? { rawAttributes: input.rawAttributes } : {}
|
|
8374
|
+
},
|
|
8375
|
+
provenance: {
|
|
8376
|
+
source: "connector",
|
|
8377
|
+
accuracy: "runtime_exact"
|
|
8378
|
+
}
|
|
8379
|
+
};
|
|
8380
|
+
}
|
|
8381
|
+
function parseToolInvocation(value) {
|
|
8382
|
+
if (!isRecord14(value) || typeof value.sequence !== "number" || typeof value.observedAt !== "string" || typeof value.action !== "string") {
|
|
8383
|
+
return void 0;
|
|
8384
|
+
}
|
|
8385
|
+
return {
|
|
8386
|
+
sequence: value.sequence,
|
|
8387
|
+
observedAt: value.observedAt,
|
|
8388
|
+
action: value.action,
|
|
8389
|
+
...value.params === void 0 ? {} : { params: value.params },
|
|
8390
|
+
...value.result === void 0 ? {} : { result: value.result },
|
|
8391
|
+
...typeof value.error === "string" ? { error: value.error } : {},
|
|
8392
|
+
...typeof value.completedAt === "string" ? { completedAt: value.completedAt } : {}
|
|
8393
|
+
};
|
|
8394
|
+
}
|
|
8395
|
+
var AgyAuditAdapter = class {
|
|
8396
|
+
provider = "agy";
|
|
8397
|
+
async collect(job) {
|
|
8398
|
+
const evidence = {
|
|
8399
|
+
toolInvocations: [],
|
|
8400
|
+
anomalies: [],
|
|
8401
|
+
gaps: []
|
|
8402
|
+
};
|
|
8403
|
+
const bundle = isRecord14(job.boundary.agyEvidence) ? job.boundary.agyEvidence : void 0;
|
|
8404
|
+
if (!bundle) {
|
|
8405
|
+
evidence.gaps.push({
|
|
8406
|
+
category: "agy_evidence",
|
|
8407
|
+
reason: "source_log_missing",
|
|
8408
|
+
detail: "boundary.agyEvidence is missing"
|
|
8409
|
+
});
|
|
8410
|
+
} else {
|
|
8411
|
+
const prompt = stringValue10(bundle.prompt);
|
|
8412
|
+
if (prompt !== void 0) evidence.prompt = prompt;
|
|
8413
|
+
const stdout = stringValue10(bundle.stdout);
|
|
8414
|
+
if (stdout !== void 0) evidence.stdout = stdout;
|
|
8415
|
+
const stderr = stringValue10(bundle.stderr);
|
|
8416
|
+
if (stderr !== void 0) evidence.stderr = stderr;
|
|
8417
|
+
if (typeof bundle.exitCode === "number" || bundle.exitCode === null) {
|
|
8418
|
+
evidence.exitCode = bundle.exitCode;
|
|
8419
|
+
}
|
|
8420
|
+
const response = stringValue10(bundle.response);
|
|
8421
|
+
if (response !== void 0) evidence.response = response;
|
|
8422
|
+
if (Array.isArray(bundle.toolInvocations)) {
|
|
8423
|
+
for (const value of bundle.toolInvocations) {
|
|
8424
|
+
const invocation = parseToolInvocation(value);
|
|
8425
|
+
if (!invocation) {
|
|
8426
|
+
evidence.anomalies.push({
|
|
8427
|
+
code: "agy_tool_invocation_malformed",
|
|
8428
|
+
message: "agy tool invocation row is malformed"
|
|
8429
|
+
});
|
|
8430
|
+
evidence.gaps.push({
|
|
8431
|
+
category: "agy_tool_invocation",
|
|
8432
|
+
reason: "correlation_failed"
|
|
8433
|
+
});
|
|
8434
|
+
continue;
|
|
8435
|
+
}
|
|
8436
|
+
evidence.toolInvocations.push(invocation);
|
|
8437
|
+
}
|
|
8438
|
+
evidence.toolInvocations.sort(
|
|
8439
|
+
(left, right) => left.sequence - right.sequence
|
|
8440
|
+
);
|
|
8441
|
+
}
|
|
8442
|
+
}
|
|
8443
|
+
const logPath = stringValue10(job.boundary.transcriptPath);
|
|
8444
|
+
const logStart = offsetValue(job.boundary.transcriptStartOffset);
|
|
8445
|
+
const logEnd = offsetValue(job.boundary.transcriptEndOffset);
|
|
8446
|
+
if (logPath) {
|
|
8447
|
+
evidence.logPath = logPath;
|
|
8448
|
+
try {
|
|
8449
|
+
const raw = await readFile5(logPath);
|
|
8450
|
+
const start = logStart !== void 0 && logStart <= raw.length ? logStart : 0;
|
|
8451
|
+
const end = logEnd !== void 0 && logEnd >= start && logEnd <= raw.length ? logEnd : raw.length;
|
|
8452
|
+
evidence.logStartOffset = start;
|
|
8453
|
+
evidence.logEndOffset = end;
|
|
8454
|
+
const excerpt = raw.subarray(start, end).toString("utf-8");
|
|
8455
|
+
evidence.logExcerpt = excerpt.length > AGY_LOG_EXCERPT_MAX_CHARS ? excerpt.slice(0, AGY_LOG_EXCERPT_MAX_CHARS) : excerpt;
|
|
8456
|
+
} catch (error) {
|
|
8457
|
+
evidence.anomalies.push({
|
|
8458
|
+
code: "agy_log_unreadable",
|
|
8459
|
+
message: error instanceof Error ? error.message : String(error)
|
|
8460
|
+
});
|
|
8461
|
+
evidence.gaps.push({
|
|
8462
|
+
category: "agy_log",
|
|
8463
|
+
reason: "source_log_missing",
|
|
8464
|
+
detail: logPath
|
|
8465
|
+
});
|
|
8466
|
+
}
|
|
8467
|
+
}
|
|
8468
|
+
return evidence;
|
|
8469
|
+
}
|
|
8470
|
+
async normalize(job, rawEvidence) {
|
|
8471
|
+
const collection = rawEvidence;
|
|
8472
|
+
const capture = captureOptions11(job);
|
|
8473
|
+
const spans = [];
|
|
8474
|
+
const contents = [];
|
|
8475
|
+
const seen = /* @__PURE__ */ new Map();
|
|
8476
|
+
let sequence = 0;
|
|
8477
|
+
const turnSpanId = `agy:${job.turnId}:turn`;
|
|
8478
|
+
const turn = makeSpan8({
|
|
8479
|
+
job,
|
|
8480
|
+
spanId: turnSpanId,
|
|
8481
|
+
kind: "turn",
|
|
8482
|
+
name: "agy audited turn",
|
|
8483
|
+
sequence: sequence++,
|
|
8484
|
+
status: job.outcome === "completed" ? "completed" : job.outcome === "cancelled" ? "cancelled" : "failed",
|
|
8485
|
+
nativeEventType: "print_turn",
|
|
8486
|
+
nativeIds: {
|
|
8487
|
+
providerSessionId: stringValue10(job.boundary.providerSessionId)
|
|
8488
|
+
}
|
|
8489
|
+
});
|
|
8490
|
+
spans.push(turn);
|
|
8491
|
+
const runtimeInput = capture.inputOutput && job.input ? addContent11(contents, seen, {
|
|
8492
|
+
...job.input,
|
|
8493
|
+
captureLevel: job.input.captureLevel ?? "runtime_exact"
|
|
8494
|
+
}) : void 0;
|
|
8495
|
+
append5(turn.inputRefs, runtimeInput);
|
|
8496
|
+
if (capture.inputOutput && job.finalOutput) {
|
|
8497
|
+
append5(turn.outputRefs, addContent11(contents, seen, {
|
|
8498
|
+
...job.finalOutput,
|
|
8499
|
+
captureLevel: job.finalOutput.captureLevel ?? "runtime_exact"
|
|
8500
|
+
}));
|
|
8501
|
+
}
|
|
8502
|
+
const request = makeSpan8({
|
|
8503
|
+
job,
|
|
8504
|
+
spanId: `agy:${job.sessionId}:request:${job.turnId}`,
|
|
8505
|
+
parentSpanId: turnSpanId,
|
|
8506
|
+
kind: "llm_request",
|
|
8507
|
+
name: "agy print request",
|
|
8508
|
+
sequence: sequence++,
|
|
8509
|
+
status: job.outcome === "completed" ? "completed" : "failed",
|
|
8510
|
+
nativeEventType: "print_process",
|
|
8511
|
+
nativeIds: {
|
|
8512
|
+
providerSessionId: stringValue10(job.boundary.providerSessionId)
|
|
8513
|
+
},
|
|
8514
|
+
rawAttributes: {
|
|
8515
|
+
...collection.exitCode === void 0 ? {} : { exitCode: collection.exitCode },
|
|
8516
|
+
...collection.logPath ? { logPath: collection.logPath } : {},
|
|
8517
|
+
...collection.logStartOffset === void 0 ? {} : { logStartOffset: collection.logStartOffset },
|
|
8518
|
+
...collection.logEndOffset === void 0 ? {} : { logEndOffset: collection.logEndOffset },
|
|
8519
|
+
...collection.stderr ? { stderr: collection.stderr.slice(0, 2e3) } : {}
|
|
8520
|
+
}
|
|
8521
|
+
});
|
|
8522
|
+
append5(request.inputRefs, runtimeInput);
|
|
8523
|
+
if (capture.inputOutput && collection.prompt) {
|
|
8524
|
+
append5(request.inputRefs, addContent11(contents, seen, {
|
|
8525
|
+
role: "model_request",
|
|
8526
|
+
format: "text",
|
|
8527
|
+
value: collection.prompt,
|
|
8528
|
+
captureLevel: "provider_exact"
|
|
8529
|
+
}));
|
|
8530
|
+
}
|
|
8531
|
+
const outputText2 = collection.response ?? collection.stdout;
|
|
8532
|
+
if (capture.inputOutput && outputText2) {
|
|
8533
|
+
append5(request.outputRefs, addContent11(contents, seen, {
|
|
8534
|
+
role: "assistant_text",
|
|
8535
|
+
format: "text",
|
|
8536
|
+
value: outputText2,
|
|
8537
|
+
captureLevel: "provider_exact"
|
|
8538
|
+
}));
|
|
8539
|
+
}
|
|
8540
|
+
if (capture.rawProviderBody && collection.logExcerpt) {
|
|
8541
|
+
append5(request.outputRefs, addContent11(contents, seen, {
|
|
8542
|
+
role: "model_response",
|
|
8543
|
+
format: "text",
|
|
8544
|
+
value: collection.logExcerpt,
|
|
8545
|
+
sourcePath: collection.logPath,
|
|
8546
|
+
sourceOffset: collection.logStartOffset,
|
|
8547
|
+
captureLevel: "provider_exact"
|
|
8548
|
+
}));
|
|
8549
|
+
}
|
|
8550
|
+
spans.push(request);
|
|
8551
|
+
if (capture.tools) {
|
|
8552
|
+
for (const invocation of collection.toolInvocations) {
|
|
8553
|
+
const tool = makeSpan8({
|
|
8554
|
+
job,
|
|
8555
|
+
spanId: `agy:${job.sessionId}:tool:${invocation.sequence}`,
|
|
8556
|
+
parentSpanId: request.spanId,
|
|
8557
|
+
kind: "tool_call",
|
|
8558
|
+
name: invocation.action,
|
|
8559
|
+
sequence: sequence++,
|
|
8560
|
+
status: invocation.error ? "failed" : invocation.completedAt ? "completed" : "running",
|
|
8561
|
+
startedAt: timestamp4(invocation.observedAt, job.startedAt),
|
|
8562
|
+
endedAt: timestamp4(invocation.completedAt, job.endedAt),
|
|
8563
|
+
nativeEventType: "grix_tool_invoke",
|
|
8564
|
+
nativeIds: { toolSequence: String(invocation.sequence) },
|
|
8565
|
+
rawAttributes: { toolInvocation: invocation }
|
|
8566
|
+
});
|
|
8567
|
+
if (invocation.params !== void 0) {
|
|
8568
|
+
append5(tool.inputRefs, addContent11(contents, seen, {
|
|
8569
|
+
role: "tool_arguments",
|
|
8570
|
+
format: "json",
|
|
8571
|
+
value: typeof invocation.params === "string" ? invocation.params : JSON.stringify(invocation.params),
|
|
8572
|
+
captureLevel: "runtime_exact"
|
|
8573
|
+
}));
|
|
8574
|
+
}
|
|
8575
|
+
const result = invocation.result ?? invocation.error;
|
|
8576
|
+
if (result !== void 0) {
|
|
8577
|
+
append5(tool.outputRefs, addContent11(contents, seen, {
|
|
8578
|
+
role: "tool_result",
|
|
8579
|
+
format: typeof result === "string" ? "text" : "json",
|
|
8580
|
+
value: typeof result === "string" ? result : JSON.stringify(result),
|
|
8581
|
+
captureLevel: "runtime_exact"
|
|
8582
|
+
}));
|
|
8583
|
+
}
|
|
8584
|
+
spans.push(tool);
|
|
8585
|
+
}
|
|
8586
|
+
}
|
|
8587
|
+
collection.gaps.push({
|
|
8588
|
+
category: "provider_usage",
|
|
8589
|
+
reason: "provider_usage_missing",
|
|
8590
|
+
detail: "agy print mode does not report token usage"
|
|
8591
|
+
});
|
|
8592
|
+
return {
|
|
8593
|
+
spans,
|
|
8594
|
+
contents,
|
|
8595
|
+
anomalies: collection.anomalies,
|
|
8596
|
+
collection,
|
|
8597
|
+
capture
|
|
8598
|
+
};
|
|
8599
|
+
}
|
|
8600
|
+
async correlate(_job, evidence) {
|
|
8601
|
+
return evidence;
|
|
8602
|
+
}
|
|
8603
|
+
validate(job, normalized) {
|
|
8604
|
+
const evidence = normalized;
|
|
8605
|
+
const requests = evidence.spans.filter(
|
|
8606
|
+
(item) => item.kind === "llm_request"
|
|
8607
|
+
);
|
|
8608
|
+
const tools = evidence.spans.filter((item) => item.kind === "tool_call");
|
|
8609
|
+
const inputComplete = !evidence.capture.inputOutput || job.input !== void 0 || evidence.collection.prompt !== void 0;
|
|
8610
|
+
const outputComplete = !evidence.capture.inputOutput || job.finalOutput !== void 0 || requests.some((request) => request.outputRefs.length > 0);
|
|
8611
|
+
const toolCallsComplete = !evidence.capture.tools || tools.every((tool) => tool.status !== "running");
|
|
8612
|
+
const usageComplete = false;
|
|
8613
|
+
const gaps = [...evidence.collection.gaps];
|
|
8614
|
+
if (evidence.capture.rawProviderBody) {
|
|
8615
|
+
gaps.push({
|
|
8616
|
+
category: "raw_provider_body",
|
|
8617
|
+
reason: "raw_capture_disabled",
|
|
8618
|
+
detail: "agy print mode exposes prompt/stdout and the CLI log, not raw model HTTP bodies"
|
|
8619
|
+
});
|
|
8620
|
+
}
|
|
8621
|
+
const complete = inputComplete && outputComplete && toolCallsComplete && usageComplete && gaps.length === 0;
|
|
8622
|
+
return {
|
|
8623
|
+
status: requests.length === 0 ? "failed" : complete ? "complete" : "partial",
|
|
8624
|
+
inputComplete,
|
|
8625
|
+
outputComplete,
|
|
8626
|
+
toolCallsComplete,
|
|
8627
|
+
subagentsComplete: true,
|
|
8628
|
+
usageComplete,
|
|
8629
|
+
rawRequestsComplete: false,
|
|
8630
|
+
gaps
|
|
8631
|
+
};
|
|
8632
|
+
}
|
|
8633
|
+
};
|
|
8634
|
+
|
|
8307
8635
|
// src/audit/adapters/openclaw/openclaw-audit-adapter.ts
|
|
8308
|
-
import { readFile as
|
|
8636
|
+
import { readFile as readFile6, readdir as readdir4, stat as stat7 } from "node:fs/promises";
|
|
8309
8637
|
import { basename as basename6, dirname as dirname2, join as join4 } from "node:path";
|
|
8310
|
-
function
|
|
8638
|
+
function isRecord15(value) {
|
|
8311
8639
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8312
8640
|
}
|
|
8313
8641
|
function replaceTranscriptPath(boundary, transcriptPath) {
|
|
@@ -8345,8 +8673,8 @@ async function resolveCurrentTranscriptPath(boundary) {
|
|
|
8345
8673
|
const sessionKey = typeof boundary.routeSessionKey === "string" ? boundary.routeSessionKey : void 0;
|
|
8346
8674
|
if (!storePath || !sessionKey) return void 0;
|
|
8347
8675
|
try {
|
|
8348
|
-
const parsed = JSON.parse(await
|
|
8349
|
-
if (!
|
|
8676
|
+
const parsed = JSON.parse(await readFile6(storePath, "utf8"));
|
|
8677
|
+
if (!isRecord15(parsed) || !isRecord15(parsed[sessionKey])) return void 0;
|
|
8350
8678
|
const session = parsed[sessionKey];
|
|
8351
8679
|
return typeof session.sessionFile === "string" ? session.sessionFile : typeof session.sessionId === "string" ? join4(dirname2(storePath), `${session.sessionId}.jsonl`) : void 0;
|
|
8352
8680
|
} catch {
|
|
@@ -8381,7 +8709,7 @@ async function resolveTranscriptBoundary(boundary) {
|
|
|
8381
8709
|
function recordTimestamp(record4) {
|
|
8382
8710
|
const direct = typeof record4.timestamp === "string" ? Date.parse(record4.timestamp) : Number(record4.timestamp);
|
|
8383
8711
|
if (Number.isFinite(direct) && direct > 0) return direct;
|
|
8384
|
-
const message =
|
|
8712
|
+
const message = isRecord15(record4.message) ? record4.message : void 0;
|
|
8385
8713
|
const nested = Number(message?.timestamp);
|
|
8386
8714
|
return Number.isFinite(nested) && nested > 0 ? nested : void 0;
|
|
8387
8715
|
}
|
|
@@ -8450,7 +8778,7 @@ import {
|
|
|
8450
8778
|
access,
|
|
8451
8779
|
open as open5,
|
|
8452
8780
|
mkdir,
|
|
8453
|
-
readFile as
|
|
8781
|
+
readFile as readFile7,
|
|
8454
8782
|
readdir as readdir5,
|
|
8455
8783
|
rename,
|
|
8456
8784
|
rm,
|
|
@@ -8699,7 +9027,7 @@ var FileAuditReplayStore = class {
|
|
|
8699
9027
|
if (!SHA256_PATTERN.test(contentId)) {
|
|
8700
9028
|
throw new Error("Invalid audit content id");
|
|
8701
9029
|
}
|
|
8702
|
-
const plaintext = await
|
|
9030
|
+
const plaintext = await readFile7(this.blobPath(contentId));
|
|
8703
9031
|
if (sha256(plaintext) !== contentId) {
|
|
8704
9032
|
throw new Error("Audit blob content hash mismatch");
|
|
8705
9033
|
}
|
|
@@ -8840,7 +9168,7 @@ var FileAuditReplayStore = class {
|
|
|
8840
9168
|
}
|
|
8841
9169
|
async storePlaintextBlob(path, contentId, plaintext) {
|
|
8842
9170
|
if (await pathExists(path)) {
|
|
8843
|
-
const existing = await
|
|
9171
|
+
const existing = await readFile7(path);
|
|
8844
9172
|
if (sha256(existing) === contentId) return;
|
|
8845
9173
|
}
|
|
8846
9174
|
await this.atomicWrite(path, plaintext);
|
|
@@ -8922,7 +9250,7 @@ var FileAuditReplayStore = class {
|
|
|
8922
9250
|
}
|
|
8923
9251
|
async readReplay(manifest) {
|
|
8924
9252
|
const path = this.resolveStoredPath(manifest.replayPath);
|
|
8925
|
-
const bytes = await
|
|
9253
|
+
const bytes = await readFile7(path);
|
|
8926
9254
|
if (sha256(bytes) !== manifest.replaySha256) {
|
|
8927
9255
|
throw new Error("Audit replay document hash mismatch");
|
|
8928
9256
|
}
|
|
@@ -9010,7 +9338,7 @@ async function readDirectory(path) {
|
|
|
9010
9338
|
}
|
|
9011
9339
|
async function readJsonIfPresent(path) {
|
|
9012
9340
|
try {
|
|
9013
|
-
return JSON.parse(await
|
|
9341
|
+
return JSON.parse(await readFile7(path, "utf8"));
|
|
9014
9342
|
} catch (error) {
|
|
9015
9343
|
if (isNotFound(error)) return void 0;
|
|
9016
9344
|
throw error;
|
|
@@ -9023,12 +9351,12 @@ function isNotFound(error) {
|
|
|
9023
9351
|
// src/audit/worker/audit-recorder-ipc-protocol.ts
|
|
9024
9352
|
var AUDIT_RECORDER_PROTOCOL_VERSION = 3;
|
|
9025
9353
|
function isAuditRecorderParentMessage(value) {
|
|
9026
|
-
if (!
|
|
9354
|
+
if (!isRecord16(value) || typeof value.type !== "string") return false;
|
|
9027
9355
|
switch (value.type) {
|
|
9028
9356
|
case "audit_recorder_initialize":
|
|
9029
9357
|
return value.protocolVersion === AUDIT_RECORDER_PROTOCOL_VERSION && isProcessConfig(value.config);
|
|
9030
9358
|
case "audit_recorder_job":
|
|
9031
|
-
return typeof value.deliveryId === "string" &&
|
|
9359
|
+
return typeof value.deliveryId === "string" && isRecord16(value.job);
|
|
9032
9360
|
case "audit_recorder_flush":
|
|
9033
9361
|
case "audit_recorder_stop":
|
|
9034
9362
|
return typeof value.requestId === "string";
|
|
@@ -9037,10 +9365,10 @@ function isAuditRecorderParentMessage(value) {
|
|
|
9037
9365
|
}
|
|
9038
9366
|
}
|
|
9039
9367
|
function isProcessConfig(value) {
|
|
9040
|
-
if (!
|
|
9368
|
+
if (!isRecord16(value)) return false;
|
|
9041
9369
|
return typeof value.storageRootDir === "string" && (value.maxWorkerQueueSize === void 0 || typeof value.maxWorkerQueueSize === "number" && Number.isSafeInteger(value.maxWorkerQueueSize) && value.maxWorkerQueueSize > 0);
|
|
9042
9370
|
}
|
|
9043
|
-
function
|
|
9371
|
+
function isRecord16(value) {
|
|
9044
9372
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9045
9373
|
}
|
|
9046
9374
|
|
|
@@ -9193,6 +9521,7 @@ function createJobFinalizer(config) {
|
|
|
9193
9521
|
registry.register(new CursorAuditAdapter());
|
|
9194
9522
|
registry.register(new OpenCodeAuditAdapter());
|
|
9195
9523
|
registry.register(new DeepSeekHarnessAuditAdapter());
|
|
9524
|
+
registry.register(new AgyAuditAdapter());
|
|
9196
9525
|
registry.register(new OpenClawAuditAdapter());
|
|
9197
9526
|
return {
|
|
9198
9527
|
finalizer: new ReplayFinalizer(registry, store),
|
package/openclaw-plugin/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grix-connector",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.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",
|