@darkhunt-security/endpoint-codex 0.9.6 → 0.9.8
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/.codex-plugin/plugin.json +1 -1
- package/dist/bin/backfill.mjs +28 -1
- package/dist/bin/forwarder.mjs +28 -1
- package/dist/bin/guard.mjs +8 -0
- package/dist/bin/spool.mjs +8 -0
- package/dist/bin/status.mjs +8 -0
- package/package.json +1 -1
package/dist/bin/backfill.mjs
CHANGED
|
@@ -18135,6 +18135,11 @@ function readSecure(path) {
|
|
|
18135
18135
|
throw new ConfigError(`${path} is mode ${mode.toString(8)}; must be 0600`);
|
|
18136
18136
|
return readFileSync(path, "utf8");
|
|
18137
18137
|
}
|
|
18138
|
+
function isBlank(path) {
|
|
18139
|
+
if (statSync(path).size === 0)
|
|
18140
|
+
return true;
|
|
18141
|
+
return readFileSync(path, "utf8").trim() === "";
|
|
18142
|
+
}
|
|
18138
18143
|
function readJson(path) {
|
|
18139
18144
|
try {
|
|
18140
18145
|
return JSON.parse(readSecure(path));
|
|
@@ -18159,6 +18164,9 @@ function readConfigFile(vendor) {
|
|
|
18159
18164
|
if (!existsSync(configPath())) {
|
|
18160
18165
|
throw new ConfigMissingError(`${configPath()} does not exist \u2014 run init.mjs to create it`);
|
|
18161
18166
|
}
|
|
18167
|
+
if (isBlank(configPath())) {
|
|
18168
|
+
throw new ConfigMissingError(`${configPath()} is empty \u2014 run init.mjs to create it`);
|
|
18169
|
+
}
|
|
18162
18170
|
const file = readJson(configPath());
|
|
18163
18171
|
if (!file) {
|
|
18164
18172
|
throw new ConfigError(`cannot read ${configPath()} \u2014 it exists but did not parse`);
|
|
@@ -18489,6 +18497,21 @@ var SessionEmitter = class {
|
|
|
18489
18497
|
agentType() {
|
|
18490
18498
|
return this.options.agentType ?? this.meta["agentType"];
|
|
18491
18499
|
}
|
|
18500
|
+
/**
|
|
18501
|
+
* The agent that spawned this one.
|
|
18502
|
+
*
|
|
18503
|
+
* Claude Code names it outright, from a sidecar the host writes, and it arrives as an
|
|
18504
|
+
* option. Codex never says "parent agent" — but it does not need to: a Codex subagent
|
|
18505
|
+
* is a rollout of its own, so its agent id IS its thread id, and `parent_thread_id`
|
|
18506
|
+
* (carried here as `parentSessionId`) therefore names the parent agent exactly.
|
|
18507
|
+
*
|
|
18508
|
+
* At depth 1 that thread is the session rather than a subagent, so the id names a node
|
|
18509
|
+
* the consumer has as a session and not as an agent. That is the consumer's fallback to
|
|
18510
|
+
* resolve; reporting what the producer actually observed is this side's job.
|
|
18511
|
+
*/
|
|
18512
|
+
parentAgentId() {
|
|
18513
|
+
return this.options.parentAgentId ?? this.meta["parentSessionId"];
|
|
18514
|
+
}
|
|
18492
18515
|
defaultTraceName() {
|
|
18493
18516
|
const agentType = this.agentType();
|
|
18494
18517
|
if (agentType)
|
|
@@ -18516,7 +18539,9 @@ var SessionEmitter = class {
|
|
|
18516
18539
|
// agent out of a span already look for the snake_case names other producers
|
|
18517
18540
|
// send. A camelCase key arrives intact and is never found.
|
|
18518
18541
|
...this.agentId() !== void 0 ? { agent_id: this.agentId() } : {},
|
|
18519
|
-
...this.agentType() !== void 0 ? { agent_type: this.agentType() } : {}
|
|
18542
|
+
...this.agentType() !== void 0 ? { agent_type: this.agentType() } : {},
|
|
18543
|
+
...this.parentAgentId() !== void 0 ? { parent_agent_id: this.parentAgentId() } : {},
|
|
18544
|
+
...this.options.spawnDepth !== void 0 ? { spawn_depth: this.options.spawnDepth } : {}
|
|
18520
18545
|
},
|
|
18521
18546
|
...this.options.userId !== void 0 ? { userId: this.options.userId } : {},
|
|
18522
18547
|
...this.options.userEmail !== void 0 ? { userEmail: this.options.userEmail } : {},
|
|
@@ -21669,6 +21694,8 @@ async function runForwarder(mapper, options = {}) {
|
|
|
21669
21694
|
passKey: String(from),
|
|
21670
21695
|
...sub?.agentId !== void 0 ? { agentId: sub.agentId } : {},
|
|
21671
21696
|
...sub?.agentType !== void 0 ? { agentType: sub.agentType } : {},
|
|
21697
|
+
...sub?.parentAgentId !== void 0 ? { parentAgentId: sub.parentAgentId } : {},
|
|
21698
|
+
...sub?.spawnDepth !== void 0 ? { spawnDepth: sub.spawnDepth } : {},
|
|
21672
21699
|
...ids !== void 0 ? { ids } : {},
|
|
21673
21700
|
...userId !== void 0 ? { userId } : {},
|
|
21674
21701
|
...carried !== void 0 ? { resumeTurn: carried } : {}
|
package/dist/bin/forwarder.mjs
CHANGED
|
@@ -18135,6 +18135,11 @@ function readSecure(path) {
|
|
|
18135
18135
|
throw new ConfigError(`${path} is mode ${mode.toString(8)}; must be 0600`);
|
|
18136
18136
|
return readFileSync(path, "utf8");
|
|
18137
18137
|
}
|
|
18138
|
+
function isBlank(path) {
|
|
18139
|
+
if (statSync(path).size === 0)
|
|
18140
|
+
return true;
|
|
18141
|
+
return readFileSync(path, "utf8").trim() === "";
|
|
18142
|
+
}
|
|
18138
18143
|
function readJson(path) {
|
|
18139
18144
|
try {
|
|
18140
18145
|
return JSON.parse(readSecure(path));
|
|
@@ -18159,6 +18164,9 @@ function readConfigFile(vendor) {
|
|
|
18159
18164
|
if (!existsSync(configPath())) {
|
|
18160
18165
|
throw new ConfigMissingError(`${configPath()} does not exist \u2014 run init.mjs to create it`);
|
|
18161
18166
|
}
|
|
18167
|
+
if (isBlank(configPath())) {
|
|
18168
|
+
throw new ConfigMissingError(`${configPath()} is empty \u2014 run init.mjs to create it`);
|
|
18169
|
+
}
|
|
18162
18170
|
const file = readJson(configPath());
|
|
18163
18171
|
if (!file) {
|
|
18164
18172
|
throw new ConfigError(`cannot read ${configPath()} \u2014 it exists but did not parse`);
|
|
@@ -18489,6 +18497,21 @@ var SessionEmitter = class {
|
|
|
18489
18497
|
agentType() {
|
|
18490
18498
|
return this.options.agentType ?? this.meta["agentType"];
|
|
18491
18499
|
}
|
|
18500
|
+
/**
|
|
18501
|
+
* The agent that spawned this one.
|
|
18502
|
+
*
|
|
18503
|
+
* Claude Code names it outright, from a sidecar the host writes, and it arrives as an
|
|
18504
|
+
* option. Codex never says "parent agent" — but it does not need to: a Codex subagent
|
|
18505
|
+
* is a rollout of its own, so its agent id IS its thread id, and `parent_thread_id`
|
|
18506
|
+
* (carried here as `parentSessionId`) therefore names the parent agent exactly.
|
|
18507
|
+
*
|
|
18508
|
+
* At depth 1 that thread is the session rather than a subagent, so the id names a node
|
|
18509
|
+
* the consumer has as a session and not as an agent. That is the consumer's fallback to
|
|
18510
|
+
* resolve; reporting what the producer actually observed is this side's job.
|
|
18511
|
+
*/
|
|
18512
|
+
parentAgentId() {
|
|
18513
|
+
return this.options.parentAgentId ?? this.meta["parentSessionId"];
|
|
18514
|
+
}
|
|
18492
18515
|
defaultTraceName() {
|
|
18493
18516
|
const agentType = this.agentType();
|
|
18494
18517
|
if (agentType)
|
|
@@ -18516,7 +18539,9 @@ var SessionEmitter = class {
|
|
|
18516
18539
|
// agent out of a span already look for the snake_case names other producers
|
|
18517
18540
|
// send. A camelCase key arrives intact and is never found.
|
|
18518
18541
|
...this.agentId() !== void 0 ? { agent_id: this.agentId() } : {},
|
|
18519
|
-
...this.agentType() !== void 0 ? { agent_type: this.agentType() } : {}
|
|
18542
|
+
...this.agentType() !== void 0 ? { agent_type: this.agentType() } : {},
|
|
18543
|
+
...this.parentAgentId() !== void 0 ? { parent_agent_id: this.parentAgentId() } : {},
|
|
18544
|
+
...this.options.spawnDepth !== void 0 ? { spawn_depth: this.options.spawnDepth } : {}
|
|
18520
18545
|
},
|
|
18521
18546
|
...this.options.userId !== void 0 ? { userId: this.options.userId } : {},
|
|
18522
18547
|
...this.options.userEmail !== void 0 ? { userEmail: this.options.userEmail } : {},
|
|
@@ -21669,6 +21694,8 @@ async function runForwarder(mapper, options = {}) {
|
|
|
21669
21694
|
passKey: String(from),
|
|
21670
21695
|
...sub?.agentId !== void 0 ? { agentId: sub.agentId } : {},
|
|
21671
21696
|
...sub?.agentType !== void 0 ? { agentType: sub.agentType } : {},
|
|
21697
|
+
...sub?.parentAgentId !== void 0 ? { parentAgentId: sub.parentAgentId } : {},
|
|
21698
|
+
...sub?.spawnDepth !== void 0 ? { spawnDepth: sub.spawnDepth } : {},
|
|
21672
21699
|
...ids !== void 0 ? { ids } : {},
|
|
21673
21700
|
...userId !== void 0 ? { userId } : {},
|
|
21674
21701
|
...carried !== void 0 ? { resumeTurn: carried } : {}
|
package/dist/bin/guard.mjs
CHANGED
|
@@ -196,6 +196,11 @@ function readSecure(path) {
|
|
|
196
196
|
throw new ConfigError(`${path} is mode ${mode.toString(8)}; must be 0600`);
|
|
197
197
|
return readFileSync(path, "utf8");
|
|
198
198
|
}
|
|
199
|
+
function isBlank(path) {
|
|
200
|
+
if (statSync(path).size === 0)
|
|
201
|
+
return true;
|
|
202
|
+
return readFileSync(path, "utf8").trim() === "";
|
|
203
|
+
}
|
|
199
204
|
function readJson(path) {
|
|
200
205
|
try {
|
|
201
206
|
return JSON.parse(readSecure(path));
|
|
@@ -234,6 +239,9 @@ function readConfigFile(vendor) {
|
|
|
234
239
|
if (!existsSync(configPath())) {
|
|
235
240
|
throw new ConfigMissingError(`${configPath()} does not exist \u2014 run init.mjs to create it`);
|
|
236
241
|
}
|
|
242
|
+
if (isBlank(configPath())) {
|
|
243
|
+
throw new ConfigMissingError(`${configPath()} is empty \u2014 run init.mjs to create it`);
|
|
244
|
+
}
|
|
237
245
|
const file = readJson(configPath());
|
|
238
246
|
if (!file) {
|
|
239
247
|
throw new ConfigError(`cannot read ${configPath()} \u2014 it exists but did not parse`);
|
package/dist/bin/spool.mjs
CHANGED
|
@@ -42,6 +42,11 @@ function readSecure(path) {
|
|
|
42
42
|
throw new ConfigError(`${path} is mode ${mode.toString(8)}; must be 0600`);
|
|
43
43
|
return readFileSync(path, "utf8");
|
|
44
44
|
}
|
|
45
|
+
function isBlank(path) {
|
|
46
|
+
if (statSync(path).size === 0)
|
|
47
|
+
return true;
|
|
48
|
+
return readFileSync(path, "utf8").trim() === "";
|
|
49
|
+
}
|
|
45
50
|
function readJson(path) {
|
|
46
51
|
try {
|
|
47
52
|
return JSON.parse(readSecure(path));
|
|
@@ -80,6 +85,9 @@ function readConfigFile(vendor) {
|
|
|
80
85
|
if (!existsSync(configPath())) {
|
|
81
86
|
throw new ConfigMissingError(`${configPath()} does not exist \u2014 run init.mjs to create it`);
|
|
82
87
|
}
|
|
88
|
+
if (isBlank(configPath())) {
|
|
89
|
+
throw new ConfigMissingError(`${configPath()} is empty \u2014 run init.mjs to create it`);
|
|
90
|
+
}
|
|
83
91
|
const file = readJson(configPath());
|
|
84
92
|
if (!file) {
|
|
85
93
|
throw new ConfigError(`cannot read ${configPath()} \u2014 it exists but did not parse`);
|
package/dist/bin/status.mjs
CHANGED
|
@@ -62,6 +62,11 @@ function readSecure(path) {
|
|
|
62
62
|
throw new ConfigError(`${path} is mode ${mode.toString(8)}; must be 0600`);
|
|
63
63
|
return readFileSync(path, "utf8");
|
|
64
64
|
}
|
|
65
|
+
function isBlank(path) {
|
|
66
|
+
if (statSync(path).size === 0)
|
|
67
|
+
return true;
|
|
68
|
+
return readFileSync(path, "utf8").trim() === "";
|
|
69
|
+
}
|
|
65
70
|
function readJson(path) {
|
|
66
71
|
try {
|
|
67
72
|
return JSON.parse(readSecure(path));
|
|
@@ -86,6 +91,9 @@ function readConfigFile(vendor) {
|
|
|
86
91
|
if (!existsSync(configPath())) {
|
|
87
92
|
throw new ConfigMissingError(`${configPath()} does not exist \u2014 run init.mjs to create it`);
|
|
88
93
|
}
|
|
94
|
+
if (isBlank(configPath())) {
|
|
95
|
+
throw new ConfigMissingError(`${configPath()} is empty \u2014 run init.mjs to create it`);
|
|
96
|
+
}
|
|
89
97
|
const file = readJson(configPath());
|
|
90
98
|
if (!file) {
|
|
91
99
|
throw new ConfigError(`cannot read ${configPath()} \u2014 it exists but did not parse`);
|
package/package.json
CHANGED