@signetai/connector-codex 0.148.2 → 0.148.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/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -37
- package/package.json +3 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAmB,MAAM,wBAAwB,CAAC;AAQlH,MAAM,MAAM,eAAe,GACxB;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC9D;IACA,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvD,CAAC;AAWL,UAAU,uBAAuB;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,UAAU,yBAAyB;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC1B;AAkMD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAA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EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC,GAAG,uBAAuB,CAe1B;AAuXD,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAuB1D;AA8HD,qBAAa,cAAe,SAAQ,aAAa;IAChD,QAAQ,CAAC,IAAI,WAAW;IACxB,QAAQ,CAAC,SAAS,WAAW;IAE7B,SAAS,CAAC,YAAY,IAAI,MAAM;IAIhC,SAAS,CAAC,2BAA2B,IAAI,OAAO;IAShD,SAAS,CAAC,yBAAyB,IAAI,OAAO;IAI9C,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,yBAAyB;IAoB3E,SAAS,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAOrD,OAAO,CAAC,gBAAgB;IAIxB,aAAa,IAAI,MAAM;IAIvB,OAAO,CAAC,yBAAyB;IA4CjC,OAAO,CAAC,wBAAwB;IAkC1B,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA4FjD,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IA2D3C,WAAW,IAAI,OAAO;CAgBtB"}
|
package/dist/index.js
CHANGED
|
@@ -22192,7 +22192,6 @@ function withRemoteDaemonEnv(command, remoteDaemonUrl) {
|
|
|
22192
22192
|
}
|
|
22193
22193
|
function buildHooksFile(signetArgs, remoteDaemonUrl = resolveRemoteDaemonUrl()) {
|
|
22194
22194
|
const cmd = (subcommand, secs, codexJson = true) => ({
|
|
22195
|
-
_signet: true,
|
|
22196
22195
|
hooks: [
|
|
22197
22196
|
{
|
|
22198
22197
|
type: "command",
|
|
@@ -22202,7 +22201,6 @@ function buildHooksFile(signetArgs, remoteDaemonUrl = resolveRemoteDaemonUrl())
|
|
|
22202
22201
|
]
|
|
22203
22202
|
});
|
|
22204
22203
|
return {
|
|
22205
|
-
_signet: true,
|
|
22206
22204
|
hooks: {
|
|
22207
22205
|
SessionStart: [cmd("session-start", resolveCodexSessionStartTimeoutSeconds())],
|
|
22208
22206
|
UserPromptSubmit: [cmd("user-prompt-submit", resolveCodexPromptSubmitTimeoutSeconds())],
|
|
@@ -22223,8 +22221,8 @@ function readHooksFile(path) {
|
|
|
22223
22221
|
return null;
|
|
22224
22222
|
}
|
|
22225
22223
|
}
|
|
22226
|
-
function
|
|
22227
|
-
return file
|
|
22224
|
+
function hasLegacySignetMarker(file) {
|
|
22225
|
+
return Object.hasOwn(file, "_signet");
|
|
22228
22226
|
}
|
|
22229
22227
|
function writeHooksFile(path, file) {
|
|
22230
22228
|
mkdirSync(join4(path, ".."), { recursive: true });
|
|
@@ -22255,8 +22253,6 @@ function isSignetHookCommand(cmd) {
|
|
|
22255
22253
|
function isSignetMatcherGroup(group) {
|
|
22256
22254
|
if (typeof group !== "object" || group === null)
|
|
22257
22255
|
return false;
|
|
22258
|
-
if (group._signet === true)
|
|
22259
|
-
return true;
|
|
22260
22256
|
const hooksArr = group.hooks;
|
|
22261
22257
|
if (!Array.isArray(hooksArr))
|
|
22262
22258
|
return false;
|
|
@@ -22290,7 +22286,8 @@ function isLegacySignetMatcherGroup(group) {
|
|
|
22290
22286
|
return false;
|
|
22291
22287
|
}
|
|
22292
22288
|
function removeSignetEntries(file) {
|
|
22293
|
-
const
|
|
22289
|
+
const { _signet: _legacyMarker, ...withoutMarker } = file;
|
|
22290
|
+
const cleaned = { ...withoutMarker, hooks: file.hooks ? structuredClone(file.hooks) : undefined };
|
|
22294
22291
|
const events = cleaned.hooks;
|
|
22295
22292
|
if (!events || typeof events !== "object")
|
|
22296
22293
|
return cleaned;
|
|
@@ -22298,7 +22295,12 @@ function removeSignetEntries(file) {
|
|
|
22298
22295
|
const groups = events[key];
|
|
22299
22296
|
if (!Array.isArray(groups))
|
|
22300
22297
|
continue;
|
|
22301
|
-
const filtered = groups.filter((g) => !isSignetMatcherGroup(g) && !isLegacySignetMatcherGroup(g))
|
|
22298
|
+
const filtered = groups.filter((g) => !isSignetMatcherGroup(g) && !isLegacySignetMatcherGroup(g)).map((group) => {
|
|
22299
|
+
if (typeof group !== "object" || group === null)
|
|
22300
|
+
return group;
|
|
22301
|
+
const { _signet: _legacyGroupMarker, ...preserved } = group;
|
|
22302
|
+
return preserved;
|
|
22303
|
+
});
|
|
22302
22304
|
if (filtered.length === 0) {
|
|
22303
22305
|
delete events[key];
|
|
22304
22306
|
} else {
|
|
@@ -22307,9 +22309,6 @@ function removeSignetEntries(file) {
|
|
|
22307
22309
|
}
|
|
22308
22310
|
if (Object.keys(events).length === 0)
|
|
22309
22311
|
cleaned.hooks = undefined;
|
|
22310
|
-
const hasSignet = cleaned.hooks ? Object.values(cleaned.hooks).some((groups) => Array.isArray(groups) && groups.some(isSignetMatcherGroup)) : false;
|
|
22311
|
-
if (!hasSignet)
|
|
22312
|
-
cleaned._signet = undefined;
|
|
22313
22312
|
return cleaned;
|
|
22314
22313
|
}
|
|
22315
22314
|
var CODEX_HOOK_EVENT_LABELS = {
|
|
@@ -22437,29 +22436,15 @@ function removeHookTrustState(path, entries) {
|
|
|
22437
22436
|
writeFileSync2(path, updated);
|
|
22438
22437
|
return true;
|
|
22439
22438
|
}
|
|
22440
|
-
function migrateLegacyHooksFile(file
|
|
22441
|
-
if (isSignetOwned(file) && file.hooks && Object.keys(file.hooks).length > 0)
|
|
22442
|
-
return file;
|
|
22439
|
+
function migrateLegacyHooksFile(file) {
|
|
22443
22440
|
const legacyKeys = ["sessionStart", "userPromptSubmit", "stop"];
|
|
22444
22441
|
const hasLegacy = legacyKeys.some((k) => Array.isArray(file[k]) && file[k].some(isLegacySignetMatcherGroup));
|
|
22445
22442
|
if (!hasLegacy)
|
|
22446
22443
|
return file;
|
|
22447
|
-
const
|
|
22448
|
-
|
|
22449
|
-
|
|
22450
|
-
|
|
22451
|
-
for (const key of HOOK_EVENT_KEYS) {
|
|
22452
|
-
const existing = file.hooks[key];
|
|
22453
|
-
if (!Array.isArray(existing))
|
|
22454
|
-
continue;
|
|
22455
|
-
const kept = existing.filter((g) => !isSignetMatcherGroup(g) && !isLegacySignetMatcherGroup(g));
|
|
22456
|
-
const ours = fresh.hooks?.[key] ?? [];
|
|
22457
|
-
fresh.hooks[key] = [...kept, ...ours];
|
|
22458
|
-
}
|
|
22459
|
-
}
|
|
22460
|
-
for (const k of legacyKeys)
|
|
22461
|
-
delete fresh[k];
|
|
22462
|
-
return fresh;
|
|
22444
|
+
const migrated = structuredClone(file);
|
|
22445
|
+
for (const key of legacyKeys)
|
|
22446
|
+
delete migrated[key];
|
|
22447
|
+
return migrated;
|
|
22463
22448
|
}
|
|
22464
22449
|
function tomlQuote(s) {
|
|
22465
22450
|
if (!s.includes("'"))
|
|
@@ -22672,12 +22657,12 @@ ${result.stderr ?? ""}`;
|
|
|
22672
22657
|
const hooksPath = this.getHooksJsonPath();
|
|
22673
22658
|
const existing = readHooksFile(hooksPath);
|
|
22674
22659
|
if (existing) {
|
|
22675
|
-
const migrated = migrateLegacyHooksFile(existing
|
|
22660
|
+
const migrated = migrateLegacyHooksFile(existing);
|
|
22676
22661
|
const cleaned = removeSignetEntries(migrated);
|
|
22677
22662
|
const hasHooks = cleaned.hooks && Object.keys(cleaned.hooks).length > 0;
|
|
22678
22663
|
if (hasHooks) {
|
|
22679
22664
|
const signet = buildHooksFile(signetArgs);
|
|
22680
|
-
const merged = { ...cleaned
|
|
22665
|
+
const merged = { ...cleaned };
|
|
22681
22666
|
merged.hooks = { ...cleaned.hooks };
|
|
22682
22667
|
for (const key of HOOK_EVENT_KEYS) {
|
|
22683
22668
|
const current = merged.hooks[key] ?? [];
|
|
@@ -22688,7 +22673,7 @@ ${result.stderr ?? ""}`;
|
|
|
22688
22673
|
warnings.push("Merged Signet hooks into existing hooks.json — existing hooks preserved");
|
|
22689
22674
|
} else {
|
|
22690
22675
|
const signet = buildHooksFile(signetArgs);
|
|
22691
|
-
writeHooksFile(hooksPath, { ...cleaned,
|
|
22676
|
+
writeHooksFile(hooksPath, { ...cleaned, hooks: signet.hooks });
|
|
22692
22677
|
}
|
|
22693
22678
|
} else {
|
|
22694
22679
|
writeHooksFile(hooksPath, buildHooksFile(signetArgs));
|
|
@@ -22705,12 +22690,12 @@ ${result.stderr ?? ""}`;
|
|
|
22705
22690
|
const existing = readHooksFile(hooksPath);
|
|
22706
22691
|
const hookTrustEntries = existing ? buildHookTrustEntries(hooksPath, existing) : [];
|
|
22707
22692
|
if (existing) {
|
|
22708
|
-
const hasMarker =
|
|
22693
|
+
const hasMarker = hasLegacySignetMarker(existing);
|
|
22709
22694
|
const events = existing.hooks;
|
|
22710
22695
|
const hasHandlers = events && typeof events === "object" && Object.values(events).some((groups) => Array.isArray(groups) && groups.some(isSignetMatcherGroup));
|
|
22711
22696
|
if (hasMarker || hasHandlers) {
|
|
22712
22697
|
const cleaned = removeSignetEntries(existing);
|
|
22713
|
-
const remaining = Object.keys(cleaned).filter((k) => k !== "
|
|
22698
|
+
const remaining = Object.keys(cleaned).filter((k) => k !== "hooks");
|
|
22714
22699
|
const hooksRemain = cleaned.hooks && Object.keys(cleaned.hooks).length > 0;
|
|
22715
22700
|
if (remaining.length === 0 && !hooksRemain) {
|
|
22716
22701
|
rmSync(hooksPath, { force: true });
|
|
@@ -22809,12 +22794,12 @@ ${result.stderr ?? ""}`;
|
|
|
22809
22794
|
const existing = readHooksFile(hooksPath);
|
|
22810
22795
|
const hookTrustEntries = existing ? buildHookTrustEntries(hooksPath, existing) : [];
|
|
22811
22796
|
if (existing) {
|
|
22812
|
-
const hasMarker =
|
|
22797
|
+
const hasMarker = hasLegacySignetMarker(existing);
|
|
22813
22798
|
const events = existing.hooks;
|
|
22814
22799
|
const hasHandlers = events && typeof events === "object" && Object.values(events).some((groups) => Array.isArray(groups) && groups.some(isSignetMatcherGroup));
|
|
22815
22800
|
if (hasMarker || hasHandlers) {
|
|
22816
22801
|
const cleaned = removeSignetEntries(existing);
|
|
22817
|
-
const remaining = Object.keys(cleaned).filter((k) => k !== "
|
|
22802
|
+
const remaining = Object.keys(cleaned).filter((k) => k !== "hooks");
|
|
22818
22803
|
const hooksRemain = cleaned.hooks && Object.keys(cleaned.hooks).length > 0;
|
|
22819
22804
|
if (remaining.length === 0 && !hooksRemain) {
|
|
22820
22805
|
rmSync(hooksPath, { force: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-codex",
|
|
3
|
-
"version": "0.148.
|
|
3
|
+
"version": "0.148.8",
|
|
4
4
|
"description": "Signet connector for Codex CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"typecheck": "tsc --noEmit"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@signetai/connector-base": "0.148.
|
|
28
|
-
"@signetai/core": "0.148.
|
|
27
|
+
"@signetai/connector-base": "0.148.8",
|
|
28
|
+
"@signetai/core": "0.148.8"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.0.0",
|