@pushary/agent-hooks 1.9.145 → 1.9.148
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/CHANGELOG.md +25 -0
- package/README.md +5 -4
- package/data/SKILL.md +3 -3
- package/data/cursor-plugin/scripts/redaction.mjs +2 -1
- package/data/cursor-plugin/skills/pushary/SKILL.md +2 -2
- package/data/openclaw-plugin/LICENSE +21 -0
- package/data/openclaw-plugin/README.md +113 -0
- package/data/openclaw-plugin/dist/api-key-shape.js +5 -0
- package/data/openclaw-plugin/dist/approval-hook.js +88 -0
- package/data/openclaw-plugin/dist/approval-question.js +66 -0
- package/data/openclaw-plugin/dist/connection.js +101 -0
- package/data/openclaw-plugin/dist/decision-reply.js +6 -0
- package/data/openclaw-plugin/dist/gate-result.js +58 -0
- package/data/openclaw-plugin/dist/gate.js +173 -0
- package/data/openclaw-plugin/dist/hook-budget.js +19 -0
- package/data/openclaw-plugin/dist/host-api.js +1 -0
- package/data/openclaw-plugin/dist/host-version.js +25 -0
- package/data/openclaw-plugin/dist/index.js +32 -0
- package/data/openclaw-plugin/dist/openclaw-paths.js +43 -0
- package/data/openclaw-plugin/dist/openclaw-write-guard.js +93 -0
- package/data/openclaw-plugin/dist/protected-writes.js +217 -0
- package/data/openclaw-plugin/dist/pushary-client.js +103 -0
- package/data/openclaw-plugin/dist/pushary-hosts.js +3 -0
- package/data/openclaw-plugin/dist/redaction.js +53 -0
- package/data/openclaw-plugin/dist/replies.js +65 -0
- package/data/openclaw-plugin/dist/settings.js +103 -0
- package/data/openclaw-plugin/openclaw.plugin.json +32 -0
- package/data/openclaw-plugin/package.json +70 -0
- package/data/vscode-plugin/scripts/redaction.mjs +2 -1
- package/data/vscode-plugin/skills/pushary/SKILL.md +2 -2
- package/dist/{api-KWJQMO6G.js → api-H7H75ARS.js} +11 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +28 -28
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-claude.js +27 -27
- package/dist/bin/pushary-clean.js +76 -39
- package/dist/bin/pushary-codex-bridge.js +23 -23
- package/dist/bin/pushary-codex-hook.js +35 -35
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +16 -16
- package/dist/bin/pushary-connect.js +78 -36
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +44 -43
- package/dist/bin/pushary-disconnect.js +28 -28
- package/dist/bin/pushary-display-hook.js +96 -44
- package/dist/bin/pushary-doctor.js +124 -55
- package/dist/bin/pushary-elicitation-hook.js +28 -28
- package/dist/bin/pushary-gemini-bridge.js +17 -17
- package/dist/bin/pushary-gemini-hook.js +32 -32
- package/dist/bin/pushary-hook.js +35 -35
- package/dist/bin/pushary-login.js +22 -22
- package/dist/bin/pushary-logout.js +33 -31
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +16 -16
- package/dist/bin/pushary-notification-hook.js +27 -27
- package/dist/bin/pushary-opencode-hook.js +31 -31
- package/dist/bin/pushary-permission-denied-hook.js +35 -35
- package/dist/bin/pushary-permission-hook.js +35 -35
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +27 -27
- package/dist/bin/pushary-session-end-hook.js +27 -27
- package/dist/bin/pushary-session-start-hook.js +37 -36
- package/dist/bin/pushary-setup.js +144 -106
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +38 -36
- package/dist/bin/pushary-stop-hook.js +27 -27
- package/dist/bin/pushary-stopfailure-hook.js +27 -27
- package/dist/bin/pushary-suggestions.js +16 -16
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +25 -25
- package/dist/bin/pushary-upgrade.js +42 -41
- package/dist/bin/pushary-wait.js +16 -16
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-6IWOMXUF.js → chunk-2VPRLAKF.js} +4 -4
- package/dist/{chunk-GK5X2ZTN.js → chunk-3AAQJ75F.js} +5 -5
- package/dist/{chunk-YNCVSKUW.js → chunk-3OPXQK4D.js} +5 -5
- package/dist/{chunk-ZORBUQFG.js → chunk-3T7RA7WJ.js} +2 -2
- package/dist/{chunk-PXZTCR4M.js → chunk-3WD3BEPB.js} +2 -2
- package/dist/{chunk-VTJ4WZOC.js → chunk-43NHQUCY.js} +24 -3
- package/dist/{chunk-S7HGPKCL.js → chunk-4L2IYNLC.js} +1 -1
- package/dist/{chunk-KFALRZIN.js → chunk-5IG3VPHT.js} +4 -4
- package/dist/{chunk-S3A4PCRR.js → chunk-5ZIYTFPW.js} +10 -10
- package/dist/{chunk-A2H256WR.js → chunk-6HO36P3A.js} +1 -1
- package/dist/{chunk-FCSPMSDC.js → chunk-6RYJ3XCD.js} +200 -59
- package/dist/{chunk-PY6CM4NK.js → chunk-6YX3VB5P.js} +19 -12
- package/dist/{chunk-BYKRAYGD.js → chunk-A3URJPYH.js} +1 -1
- package/dist/{chunk-KS3PNTRT.js → chunk-ABTQG6XU.js} +1 -1
- package/dist/{chunk-72LP4RPC.js → chunk-AQ7L2E2U.js} +98 -47
- package/dist/{chunk-FNAH3YJC.js → chunk-B6RTPP3X.js} +16 -16
- package/dist/{chunk-K2SKUBYY.js → chunk-BP5HLKR6.js} +12 -12
- package/dist/{chunk-4L5WPDTB.js → chunk-BPKB7BI4.js} +1 -1
- package/dist/{chunk-YRJZF5RG.js → chunk-CABBLJD5.js} +3 -3
- package/dist/{chunk-ZBMVOMFG.js → chunk-CAHULQIO.js} +1 -1
- package/dist/chunk-CBIS7IYQ.js +157 -0
- package/dist/{chunk-LJRPWUST.js → chunk-CDQOARIF.js} +3 -3
- package/dist/{chunk-ZSOCJHL7.js → chunk-CIRTRWHM.js} +309 -5
- package/dist/{chunk-NTMKJRQ3.js → chunk-CMTDMZPV.js} +2 -2
- package/dist/{chunk-WOSO4YFQ.js → chunk-CU5SYUMK.js} +3 -6
- package/dist/{chunk-L4OGTRVW.js → chunk-D3QT4S7U.js} +4 -4
- package/dist/{chunk-YU5XE6VC.js → chunk-DHCJDYBT.js} +8 -7
- package/dist/{chunk-2LGDEPVL.js → chunk-DLPI45DF.js} +6 -6
- package/dist/{chunk-ZJZNT2G5.js → chunk-ENRL4WFD.js} +4 -4
- package/dist/{chunk-6UK4K5RS.js → chunk-FQLS37AX.js} +1 -1
- package/dist/{chunk-B4JQIH5M.js → chunk-H6FFNTSR.js} +7 -7
- package/dist/{chunk-JKWUF776.js → chunk-HEOBF5H6.js} +3 -3
- package/dist/{chunk-MNU5N3CQ.js → chunk-JSZ6LKX5.js} +23 -12
- package/dist/{chunk-RO6EVL5C.js → chunk-JUEQUYAT.js} +2 -2
- package/dist/{chunk-GURIOZE7.js → chunk-KP6ERYOA.js} +8 -8
- package/dist/{chunk-QKTF7WS6.js → chunk-KWJJYZ3T.js} +4 -4
- package/dist/{chunk-EPWOARGR.js → chunk-KXNAB76Z.js} +16 -5
- package/dist/chunk-LC53HRZ6.js +36 -0
- package/dist/{chunk-52UXNCZG.js → chunk-M7HJZ7HO.js} +3 -3
- package/dist/{chunk-WMBWKPKJ.js → chunk-MT4GBXLM.js} +10 -74
- package/dist/{chunk-WPBWJMBZ.js → chunk-MUSINFEU.js} +5 -5
- package/dist/{chunk-LD4R2P6N.js → chunk-NHZV2H63.js} +1 -1
- package/dist/{chunk-USFZJAB4.js → chunk-NLED3JGR.js} +1 -1
- package/dist/{chunk-DZIZ3XFL.js → chunk-NRPQUU3D.js} +2 -2
- package/dist/{chunk-LQXUWXQP.js → chunk-O5ARO3JM.js} +33 -10
- package/dist/chunk-OYIN77HO.js +72 -0
- package/dist/{chunk-TJXJGMSP.js → chunk-PH3MVQCQ.js} +21 -11
- package/dist/{chunk-2ELNRGNX.js → chunk-PUTX5BBE.js} +7 -4
- package/dist/{chunk-R34RWVN2.js → chunk-PVBDITRS.js} +14 -5
- package/dist/{chunk-33BYPZ52.js → chunk-Q7GZKNMH.js} +1 -1
- package/dist/{chunk-7LTP2GHO.js → chunk-QSZYHL7Z.js} +2 -2
- package/dist/{chunk-CUR2DCZN.js → chunk-QTQRQZIU.js} +4 -4
- package/dist/{chunk-SQL5YXUH.js → chunk-R2JRRCZK.js} +1 -1
- package/dist/{chunk-4KDRT3OA.js → chunk-RMBY7JGO.js} +1 -1
- package/dist/{chunk-KKPT7ROP.js → chunk-RWTH5RYA.js} +2 -2
- package/dist/chunk-RYDDLS62.js +176 -0
- package/dist/{chunk-Q6P7G4NY.js → chunk-S3MEI2D2.js} +17 -5
- package/dist/{chunk-HOQH5CLZ.js → chunk-T3CMGGNW.js} +1 -1
- package/dist/{chunk-IIN26HL7.js → chunk-T4PX3DRF.js} +1 -1
- package/dist/{chunk-6LZ7MXHD.js → chunk-TXXAQRX4.js} +7 -5
- package/dist/{chunk-YZA3YBHX.js → chunk-UAHBSOO4.js} +2 -2
- package/dist/{chunk-LMU6NG2G.js → chunk-UFGFO7QB.js} +1 -1
- package/dist/{chunk-TRV3ETGY.js → chunk-UJUGFLVF.js} +5 -5
- package/dist/{chunk-IRPIMQ7U.js → chunk-UL2NNDKD.js} +3 -3
- package/dist/{chunk-BWREST4F.js → chunk-VPADWVYD.js} +1 -1
- package/dist/{chunk-5TWW7ZUL.js → chunk-VPMSV35B.js} +5 -5
- package/dist/{chunk-G3VSMI7K.js → chunk-WQEJCDMR.js} +2 -2
- package/dist/{chunk-JZT2LPRM.js → chunk-WQJ5NJ35.js} +1 -1
- package/dist/{chunk-63WX5KZN.js → chunk-X4OEGFOG.js} +3 -3
- package/dist/{chunk-RWLNTZK5.js → chunk-X4OQ5UMH.js} +5 -5
- package/dist/{chunk-MOC2DN42.js → chunk-XSBW6TUH.js} +2 -2
- package/dist/{chunk-WH4ODOCE.js → chunk-XZGQZDFP.js} +6 -6
- package/dist/{chunk-FO3MDD26.js → chunk-YM2T76UM.js} +27 -0
- package/dist/{chunk-WUT3PO33.js → chunk-YOP7LFHW.js} +8 -8
- package/dist/{chunk-KGFB2LEB.js → chunk-YTD7RV6F.js} +3 -3
- package/dist/{chunk-IDLOJIIS.js → chunk-YWSIN7IH.js} +1 -1
- package/dist/{chunk-MKHVLDMN.js → chunk-ZCB5SCYM.js} +2 -2
- package/dist/{chunk-OONMKLUF.js → chunk-ZOATPL53.js} +4 -4
- package/dist/{chunk-Y7INHH5G.js → chunk-ZX2O66NS.js} +3 -3
- package/dist/{codex-app-cards-switch-F7WQ7Y3I.js → codex-app-cards-switch-BCM547E6.js} +11 -11
- package/dist/{codex-card-routing-EVL5L36G.js → codex-card-routing-222EKZJR.js} +2 -2
- package/dist/{codex-desktop-launch-PL6Z2ELZ.js → codex-desktop-launch-6AFOLMZ7.js} +1 -1
- package/dist/{codex-session-launch-7NQEAUDU.js → codex-session-launch-4YJR4ZGN.js} +20 -20
- package/dist/{config-KFFD4VWH.js → config-GWNPGS47.js} +3 -3
- package/dist/{global-upgrade-L3CY6EFF.js → global-upgrade-VRF6OSSU.js} +9 -9
- package/dist/{identity-DPYYIMHL.js → identity-PQIM7R2N.js} +4 -4
- package/dist/{live-capabilities-QJEXK6GH.js → live-capabilities-G3LMKZUB.js} +4 -4
- package/dist/{paths-PEF6C64P.js → paths-TFGIP5PU.js} +7 -3
- package/dist/{reapply-7APCQRRK.js → reapply-3IRAI6JF.js} +30 -29
- package/dist/src/index.js +34 -34
- package/dist/{upgrade-lock-A7OKXMRW.js → upgrade-lock-2G7ANYYO.js} +6 -4
- package/dist/{usage-HSS33762.js → usage-K3EGYCSU.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-D3UFDCTQ.js +0 -87
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
formatVersion,
|
|
4
4
|
quoteIfNeeded,
|
|
5
5
|
shellDoubleQuoted
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-43NHQUCY.js";
|
|
7
7
|
import {
|
|
8
8
|
writeFileAtomic
|
|
9
9
|
} from "./chunk-TODDEIYG.js";
|
|
@@ -18,9 +18,10 @@ import {
|
|
|
18
18
|
HOOK_BUDGETS,
|
|
19
19
|
HOOK_LOCATOR_BINARY,
|
|
20
20
|
PRETOOLUSE_GATED_TOOLS,
|
|
21
|
+
PUSHARY_HOSTS,
|
|
21
22
|
PUSHARY_TOOL_PREFIX,
|
|
22
23
|
withHookHoldBudget
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-O5ARO3JM.js";
|
|
24
25
|
|
|
25
26
|
// src/setup/paths.ts
|
|
26
27
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -33,7 +34,7 @@ var claudeUserConfigFile = (home = homedir(), environment = { CLAUDE_CONFIG_DIR:
|
|
|
33
34
|
|
|
34
35
|
// src/setup/paths.ts
|
|
35
36
|
import { homedir as homedir4 } from "os";
|
|
36
|
-
import { join as
|
|
37
|
+
import { join as join7 } from "path";
|
|
37
38
|
|
|
38
39
|
// src/codex-config.ts
|
|
39
40
|
import { createHash } from "crypto";
|
|
@@ -883,7 +884,7 @@ var addPusharyToolPermissions = (settings) => {
|
|
|
883
884
|
permissions.allow = filtered;
|
|
884
885
|
};
|
|
885
886
|
var addPusharyHooks = (settings, binDir, version = null) => {
|
|
886
|
-
const
|
|
887
|
+
const resolve3 = (name) => guardBinary(binDir ? join4(binDir, name) : name);
|
|
887
888
|
const hooks = ensureRecord2(settings, "hooks");
|
|
888
889
|
const supported = new Map(supportedClaudeEvents(version).map((hook) => [hook.event, hook]));
|
|
889
890
|
for (const known of CLAUDE_HOOK_EVENTS) {
|
|
@@ -891,7 +892,7 @@ var addPusharyHooks = (settings, binDir, version = null) => {
|
|
|
891
892
|
const oursButUnjudged = version === null && current.some((item) => isPusharyHook(item));
|
|
892
893
|
const definition = supported.get(known.event) ?? (oursButUnjudged ? known : void 0);
|
|
893
894
|
if (definition) {
|
|
894
|
-
hooks[known.event] = registerHookEntry(current, isPusharyHook, entry(definition,
|
|
895
|
+
hooks[known.event] = registerHookEntry(current, isPusharyHook, entry(definition, resolve3));
|
|
895
896
|
continue;
|
|
896
897
|
}
|
|
897
898
|
const others = current.filter((item) => !isPusharyHook(item));
|
|
@@ -904,14 +905,14 @@ var addPusharyHooks = (settings, binDir, version = null) => {
|
|
|
904
905
|
for (const extra of CLAUDE_EXTRA_PRETOOLUSE_HOOKS) {
|
|
905
906
|
if (!supported.has(extra.event)) continue;
|
|
906
907
|
const current = Array.isArray(hooks[extra.event]) ? hooks[extra.event] : [];
|
|
907
|
-
hooks[extra.event] = [...current, entry(extra,
|
|
908
|
+
hooks[extra.event] = [...current, entry(extra, resolve3)];
|
|
908
909
|
}
|
|
909
910
|
};
|
|
910
|
-
var entry = (definition,
|
|
911
|
+
var entry = (definition, resolve3) => ({
|
|
911
912
|
...definition.matcher ? { matcher: definition.matcher } : {},
|
|
912
913
|
hooks: [{
|
|
913
914
|
type: "command",
|
|
914
|
-
command: withHookHoldBudget(
|
|
915
|
+
command: withHookHoldBudget(resolve3(definition.binary), holdBudgetOf(definition)),
|
|
915
916
|
timeout: definition.timeout
|
|
916
917
|
}]
|
|
917
918
|
});
|
|
@@ -1069,7 +1070,7 @@ var hasInstructionBlock = (filePath) => {
|
|
|
1069
1070
|
};
|
|
1070
1071
|
|
|
1071
1072
|
// src/pushary-mcp-url.ts
|
|
1072
|
-
var PUSHARY_MCP_HOSTS =
|
|
1073
|
+
var PUSHARY_MCP_HOSTS = new Set(PUSHARY_HOSTS);
|
|
1073
1074
|
var PUSHARY_MCP_PATH_PREFIX = "/api/mcp";
|
|
1074
1075
|
var isPusharyMcpPath = (pathname) => pathname === PUSHARY_MCP_PATH_PREFIX || pathname.startsWith(`${PUSHARY_MCP_PATH_PREFIX}/`);
|
|
1075
1076
|
var PUSHARY_FULL_ACCESS_MCP_PATHS = /* @__PURE__ */ new Set(["/api/mcp/mcp", "/api/mcp/sse"]);
|
|
@@ -1228,46 +1229,90 @@ var clineInstructionsBody = () => `${renderAgentInstructions(CLINE_LABEL)}
|
|
|
1228
1229
|
|
|
1229
1230
|
${CLINE_TOOL_NOTE}`;
|
|
1230
1231
|
|
|
1232
|
+
// src/openclaw/openclaw-paths.ts
|
|
1233
|
+
import { join as join6, resolve as resolve2 } from "path";
|
|
1234
|
+
var OPENCLAW_ENVIRONMENT_KEYS = ["OPENCLAW_HOME", "OPENCLAW_STATE_DIR", "OPENCLAW_CONFIG_PATH", "OPENCLAW_PROFILE"];
|
|
1235
|
+
var STATE_DIRECTORY_NAME = ".openclaw";
|
|
1236
|
+
var PUSHARY_DIRECTORY_NAME = ".pushary";
|
|
1237
|
+
var OWNED_PLUGIN_FOLDER_NAME = "openclaw-plugin";
|
|
1238
|
+
var CONFIG_FILE_NAME = "openclaw.json";
|
|
1239
|
+
var ENVIRONMENT_FILE_NAME = ".env";
|
|
1240
|
+
var UNSET_SPELLINGS = /* @__PURE__ */ new Set(["undefined", "null"]);
|
|
1241
|
+
var HOME_PREFIX = /^~(?=$|[\\/])/;
|
|
1242
|
+
var setValue = (value) => {
|
|
1243
|
+
const trimmed = value?.trim();
|
|
1244
|
+
return trimmed && !UNSET_SPELLINGS.has(trimmed) ? trimmed : void 0;
|
|
1245
|
+
};
|
|
1246
|
+
var expandedFrom = (path, home) => resolve2(path.replace(HOME_PREFIX, () => home));
|
|
1247
|
+
var homeOf = (environment, osHome) => {
|
|
1248
|
+
const configured = setValue(environment.OPENCLAW_HOME);
|
|
1249
|
+
if (configured === void 0) return resolve2(osHome);
|
|
1250
|
+
return HOME_PREFIX.test(configured) ? expandedFrom(configured, osHome) : resolve2(configured);
|
|
1251
|
+
};
|
|
1252
|
+
var pathSetting = (value, home) => {
|
|
1253
|
+
const configured = value?.trim();
|
|
1254
|
+
if (!configured) return void 0;
|
|
1255
|
+
return HOME_PREFIX.test(configured) ? expandedFrom(configured, home) : resolve2(configured);
|
|
1256
|
+
};
|
|
1257
|
+
var openClawPathsFrom = (environment, osHome) => {
|
|
1258
|
+
const home = homeOf(environment, osHome);
|
|
1259
|
+
const stateDirectory = pathSetting(environment.OPENCLAW_STATE_DIR, home) ?? join6(home, STATE_DIRECTORY_NAME);
|
|
1260
|
+
return {
|
|
1261
|
+
home,
|
|
1262
|
+
stateDirectory,
|
|
1263
|
+
configFile: pathSetting(environment.OPENCLAW_CONFIG_PATH, home) ?? join6(stateDirectory, CONFIG_FILE_NAME),
|
|
1264
|
+
environmentFile: join6(stateDirectory, ENVIRONMENT_FILE_NAME)
|
|
1265
|
+
};
|
|
1266
|
+
};
|
|
1267
|
+
var openClawDirectoriesToLookIn = (paths) => [.../* @__PURE__ */ new Set([paths.stateDirectory, paths.configFile, join6(paths.home, STATE_DIRECTORY_NAME)])];
|
|
1268
|
+
var openClawEnvironmentOf = (environment) => Object.fromEntries(OPENCLAW_ENVIRONMENT_KEYS.flatMap((key) => {
|
|
1269
|
+
const value = environment[key];
|
|
1270
|
+
return value === void 0 ? [] : [[key, value]];
|
|
1271
|
+
}));
|
|
1272
|
+
var ownedPluginFolderIn = (osHome) => join6(osHome, PUSHARY_DIRECTORY_NAME, OWNED_PLUGIN_FOLDER_NAME);
|
|
1273
|
+
|
|
1231
1274
|
// src/setup/paths.ts
|
|
1232
|
-
var claudeSettings = (environment = process.env) =>
|
|
1275
|
+
var claudeSettings = (environment = process.env) => join7(claudeConfigDir(homedir4(), environment), "settings.json");
|
|
1233
1276
|
var claudeJson = (environment = process.env) => claudeUserConfigFile(homedir4(), environment);
|
|
1234
|
-
var claudeSkillDir = (environment = process.env) =>
|
|
1235
|
-
var cursorPluginDir = () =>
|
|
1236
|
-
var cursorUserHooks = () =>
|
|
1237
|
-
var cursorPluginMcp = () =>
|
|
1238
|
-
var cursorPluginManifest = () =>
|
|
1239
|
-
var cursorPluginRule = () =>
|
|
1240
|
-
var cursorUserMcp = () =>
|
|
1241
|
-
var vscodePluginDir = () =>
|
|
1242
|
-
var vscodePluginMcp = () =>
|
|
1243
|
-
var claudeSettingsLocal = () =>
|
|
1244
|
-
var pusharyDir = () =>
|
|
1245
|
-
var bridgeStub = () =>
|
|
1246
|
-
var bridgeCache = () =>
|
|
1247
|
-
var claudeSetupDir = () => process.env.CLAUDE_CONFIG_DIR ?
|
|
1248
|
-
var claudeMcpReceipt = () =>
|
|
1249
|
-
var bridgeAgentKey = () =>
|
|
1250
|
-
var autoUpdateState = () =>
|
|
1251
|
-
var autoUpdateLock = () =>
|
|
1252
|
-
var serviceOwedBackMark = () =>
|
|
1253
|
-
var autoUpdateLog = () =>
|
|
1254
|
-
var clientReportClaims = () =>
|
|
1255
|
-
var claudeRegistrationReceipt = () =>
|
|
1256
|
-
var hermesConfig = () =>
|
|
1257
|
-
var hermesConfigReceipt = () =>
|
|
1258
|
-
var hermesSetupReceipt = () =>
|
|
1259
|
-
var
|
|
1260
|
-
var
|
|
1261
|
-
var
|
|
1262
|
-
var
|
|
1263
|
-
var
|
|
1264
|
-
var
|
|
1265
|
-
var
|
|
1266
|
-
var
|
|
1267
|
-
var
|
|
1268
|
-
var
|
|
1269
|
-
var
|
|
1270
|
-
var
|
|
1277
|
+
var claudeSkillDir = (environment = process.env) => join7(claudeConfigDir(homedir4(), environment), "skills", "pushary");
|
|
1278
|
+
var cursorPluginDir = () => join7(homedir4(), ".cursor", "plugins", "local", "pushary");
|
|
1279
|
+
var cursorUserHooks = () => join7(homedir4(), ".cursor", "hooks.json");
|
|
1280
|
+
var cursorPluginMcp = () => join7(cursorPluginDir(), "mcp.json");
|
|
1281
|
+
var cursorPluginManifest = () => join7(cursorPluginDir(), ".cursor-plugin", "plugin.json");
|
|
1282
|
+
var cursorPluginRule = () => join7(cursorPluginDir(), "rules", "pushary.mdc");
|
|
1283
|
+
var cursorUserMcp = () => join7(homedir4(), ".cursor", "mcp.json");
|
|
1284
|
+
var vscodePluginDir = () => join7(homedir4(), ".pushary", "plugins", "vscode");
|
|
1285
|
+
var vscodePluginMcp = () => join7(vscodePluginDir(), ".mcp.json");
|
|
1286
|
+
var claudeSettingsLocal = () => join7(claudeConfigDir(), "settings.local.json");
|
|
1287
|
+
var pusharyDir = () => join7(homedir4(), ".pushary");
|
|
1288
|
+
var bridgeStub = () => join7(pusharyDir(), "bin", HOOK_LOCATOR_BINARY);
|
|
1289
|
+
var bridgeCache = () => join7(pusharyDir(), "bin", BRIDGE_CACHE_FILE);
|
|
1290
|
+
var claudeSetupDir = () => process.env.CLAUDE_CONFIG_DIR ? join7(pusharyDir(), "setup", "claude-profiles", createHash2("sha256").update(claudeUserConfigFile()).digest("hex").slice(0, 32)) : join7(pusharyDir(), "setup");
|
|
1291
|
+
var claudeMcpReceipt = () => join7(claudeSetupDir(), "claude-mcp.json");
|
|
1292
|
+
var bridgeAgentKey = () => join7(pusharyDir(), "bridge-auth", "agent-key.json");
|
|
1293
|
+
var autoUpdateState = () => join7(pusharyDir(), "auto-update.json");
|
|
1294
|
+
var autoUpdateLock = () => join7(pusharyDir(), "auto-update.lock");
|
|
1295
|
+
var serviceOwedBackMark = () => join7(pusharyDir(), "service-owed-back");
|
|
1296
|
+
var autoUpdateLog = () => join7(pusharyDir(), "logs", "auto-update.log");
|
|
1297
|
+
var clientReportClaims = () => join7(pusharyDir(), "client-reports");
|
|
1298
|
+
var claudeRegistrationReceipt = () => join7(claudeSetupDir(), "claude-registration.json");
|
|
1299
|
+
var hermesConfig = () => join7(homedir4(), ".hermes", "config.yaml");
|
|
1300
|
+
var hermesConfigReceipt = () => join7(pusharyDir(), "setup", "hermes-config.json");
|
|
1301
|
+
var hermesSetupReceipt = () => join7(pusharyDir(), "setup", "hermes-plugin.json");
|
|
1302
|
+
var openClawSetupReceiptDirectory = () => join7(pusharyDir(), "setup", "openclaw");
|
|
1303
|
+
var openClawPluginFolder = () => ownedPluginFolderIn(homedir4());
|
|
1304
|
+
var hermesAppWiringRecord = () => join7(pusharyDir(), "setup", "hermes-wired-by-mac-app");
|
|
1305
|
+
var fxQuestionRuleReceipt = () => join7(pusharyDir(), "setup", "fx-question-rule.json");
|
|
1306
|
+
var hookTakeoverReceipt = (agent) => join7(agent === "claude_code" ? claudeSetupDir() : join7(pusharyDir(), "setup"), `hook-takeover-${agent}.json`);
|
|
1307
|
+
var codexSkillDir2 = () => join7(codexHome(), "skills", "pushary");
|
|
1308
|
+
var codexAgentsMd2 = () => join7(codexHome(), "AGENTS.md");
|
|
1309
|
+
var geminiSettings = () => join7(homedir4(), ".gemini", "settings.json");
|
|
1310
|
+
var geminiMd = () => join7(homedir4(), ".gemini", "GEMINI.md");
|
|
1311
|
+
var pusharyConfigFile = () => join7(homedir4(), ".pushary", "config.json");
|
|
1312
|
+
var fxConfigDir = () => join7(homedir4(), ".fx");
|
|
1313
|
+
var fxMcpProfile = () => join7(fxConfigDir(), "mcp.json");
|
|
1314
|
+
var fxSettings = () => join7(fxConfigDir(), "settings.json");
|
|
1315
|
+
var fxAgentsMd = () => join7(fxConfigDir(), "AGENTS.md");
|
|
1271
1316
|
var clineLocation = () => ({ home: homedir4(), environment: process.env });
|
|
1272
1317
|
var clineMcpSettings = () => clineMcpSettingsPath(clineLocation());
|
|
1273
1318
|
var clineRules = () => clineRulesFile(clineLocation());
|
|
@@ -1390,6 +1435,10 @@ export {
|
|
|
1390
1435
|
otherPusharyServerNames,
|
|
1391
1436
|
clineSettingsText,
|
|
1392
1437
|
clineInstructionsBody,
|
|
1438
|
+
OPENCLAW_ENVIRONMENT_KEYS,
|
|
1439
|
+
openClawPathsFrom,
|
|
1440
|
+
openClawDirectoriesToLookIn,
|
|
1441
|
+
openClawEnvironmentOf,
|
|
1393
1442
|
claudeSettings,
|
|
1394
1443
|
claudeJson,
|
|
1395
1444
|
claudeSkillDir,
|
|
@@ -1416,6 +1465,8 @@ export {
|
|
|
1416
1465
|
hermesConfig,
|
|
1417
1466
|
hermesConfigReceipt,
|
|
1418
1467
|
hermesSetupReceipt,
|
|
1468
|
+
openClawSetupReceiptDirectory,
|
|
1469
|
+
openClawPluginFolder,
|
|
1419
1470
|
hermesAppWiringRecord,
|
|
1420
1471
|
fxQuestionRuleReceipt,
|
|
1421
1472
|
hookTakeoverReceipt,
|
|
@@ -2,37 +2,37 @@ import {
|
|
|
2
2
|
forgetPhoneApproval,
|
|
3
3
|
rememberPhoneApproval,
|
|
4
4
|
takePhoneApproval
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QSZYHL7Z.js";
|
|
6
6
|
import {
|
|
7
7
|
claudeSettingsLocationFor,
|
|
8
8
|
readClaudePermissionRules
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CMTDMZPV.js";
|
|
10
10
|
import {
|
|
11
11
|
askAgentQuestions,
|
|
12
12
|
defersToNativeMode,
|
|
13
13
|
outcomeOfFailedAsk,
|
|
14
14
|
storedWaitDeadline
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UJUGFLVF.js";
|
|
16
16
|
import {
|
|
17
17
|
reportMachineDenial
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-X4OEGFOG.js";
|
|
19
19
|
import {
|
|
20
20
|
isGatingMoment,
|
|
21
21
|
recordKeylessMoment
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-Q7GZKNMH.js";
|
|
23
23
|
import {
|
|
24
24
|
isAdmitted,
|
|
25
25
|
readAdmissionRules
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VPMSV35B.js";
|
|
27
27
|
import {
|
|
28
28
|
isDeferAnswer,
|
|
29
29
|
oncePerSession
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NLED3JGR.js";
|
|
31
31
|
import {
|
|
32
32
|
activeHookSource,
|
|
33
33
|
activeIdentity,
|
|
34
34
|
namedSource
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-PVBDITRS.js";
|
|
36
36
|
import {
|
|
37
37
|
DEFAULT_SESSION,
|
|
38
38
|
approvalAwaitingRetry,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
settleQuestionsForToolUse,
|
|
54
54
|
sweepFilesOlderThan,
|
|
55
55
|
userScope
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-BP5HLKR6.js";
|
|
57
57
|
import {
|
|
58
58
|
UNNAMED_ACTION,
|
|
59
59
|
deriveAction,
|
|
@@ -64,12 +64,12 @@ import {
|
|
|
64
64
|
patchDeletesFiles,
|
|
65
65
|
permissionDeniedAction,
|
|
66
66
|
scopePathFor
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-WQJ5NJ35.js";
|
|
68
68
|
import {
|
|
69
69
|
branchFor,
|
|
70
70
|
repoKeyFor,
|
|
71
71
|
repositoryScopeFor
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-FQLS37AX.js";
|
|
73
73
|
import {
|
|
74
74
|
askUser,
|
|
75
75
|
cancelQuestion,
|
|
@@ -86,20 +86,20 @@ import {
|
|
|
86
86
|
waitForQuestion,
|
|
87
87
|
waitsForThePhone,
|
|
88
88
|
withdrawQuestion
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-DHCJDYBT.js";
|
|
90
90
|
import {
|
|
91
91
|
getMachineId
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-ABTQG6XU.js";
|
|
93
93
|
import {
|
|
94
94
|
getApiKey,
|
|
95
95
|
getBaseUrl
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-VPADWVYD.js";
|
|
97
97
|
import {
|
|
98
98
|
writeFileAtomic
|
|
99
99
|
} from "./chunk-TODDEIYG.js";
|
|
100
100
|
import {
|
|
101
101
|
NPX_LATEST_COMMAND
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-TXXAQRX4.js";
|
|
103
103
|
import {
|
|
104
104
|
AGENT_QUESTION_STRATEGY,
|
|
105
105
|
AGENT_QUESTION_TOOL,
|
|
@@ -168,7 +168,7 @@ import {
|
|
|
168
168
|
timeoutActionWithoutLocalPrompt,
|
|
169
169
|
unansweredRefusalReason,
|
|
170
170
|
unapprovedScopeReason
|
|
171
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-O5ARO3JM.js";
|
|
172
172
|
|
|
173
173
|
// src/terminal-answer-watch.ts
|
|
174
174
|
import { closeSync, openSync, readSync, statSync } from "fs";
|
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
toolResultErrorText,
|
|
28
28
|
transcriptTokensIn,
|
|
29
29
|
transcriptUsageRequest
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WQJ5NJ35.js";
|
|
31
31
|
import {
|
|
32
32
|
branchFor,
|
|
33
33
|
repoKeyFor
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-FQLS37AX.js";
|
|
35
35
|
import {
|
|
36
36
|
cancelQuestion,
|
|
37
37
|
clientErrorKindOf,
|
|
@@ -39,39 +39,39 @@ import {
|
|
|
39
39
|
reportClientError,
|
|
40
40
|
sendNotification,
|
|
41
41
|
waitForAnswer
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-DHCJDYBT.js";
|
|
43
43
|
import {
|
|
44
44
|
isRetryable,
|
|
45
45
|
withRetry
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-MUSINFEU.js";
|
|
47
47
|
import {
|
|
48
48
|
RETRY_ACK,
|
|
49
49
|
readCommandAck,
|
|
50
50
|
refusedReceiptMessage
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-A3URJPYH.js";
|
|
52
52
|
import {
|
|
53
53
|
fetchAsCredential
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-4L2IYNLC.js";
|
|
55
55
|
import {
|
|
56
56
|
getMachineId
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-ABTQG6XU.js";
|
|
58
58
|
import {
|
|
59
59
|
reportedInstallSource
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-XSBW6TUH.js";
|
|
61
61
|
import {
|
|
62
62
|
IDLE_PROMPT_NOTIFICATION,
|
|
63
63
|
NOTIFICATION_PUSH_TYPES,
|
|
64
64
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS,
|
|
65
65
|
claudeConfigDir
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-AQ7L2E2U.js";
|
|
67
67
|
import {
|
|
68
68
|
compareVersion,
|
|
69
69
|
parseVersion
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-43NHQUCY.js";
|
|
71
71
|
import {
|
|
72
72
|
getApiKey,
|
|
73
73
|
getBaseUrl
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-VPADWVYD.js";
|
|
75
75
|
import {
|
|
76
76
|
writeFileAtomic,
|
|
77
77
|
writeJsonAtomicDurable
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
resolveAutoResolveOrigin,
|
|
101
101
|
resolvePolicy,
|
|
102
102
|
unansweredRefusalReason
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-O5ARO3JM.js";
|
|
104
104
|
|
|
105
105
|
// src/pending.ts
|
|
106
106
|
import { join } from "path";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CDQOARIF.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-YU2EUD7O.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VPADWVYD.js";
|
|
10
10
|
import {
|
|
11
11
|
EXIT
|
|
12
12
|
} from "./chunk-BG4HHB7E.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-O5ARO3JM.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HERMES_APPROVAL_TRANSPORT_KEY,
|
|
3
|
+
HERMES_COMMAND_ALLOWLIST_KEY,
|
|
4
|
+
HERMES_DOCKER_MOUNT_CWD_KEY,
|
|
5
|
+
HERMES_DOCKER_VOLUMES_KEY,
|
|
6
|
+
HERMES_GATE_TOOLS_KEY,
|
|
7
|
+
HERMES_TERMINAL_ENV_KEY,
|
|
8
|
+
HERMES_TERMINAL_SECTION,
|
|
9
|
+
gateToolsWithShell,
|
|
10
|
+
gatesHermesShell,
|
|
11
|
+
hermesAlwaysAllowsShell,
|
|
12
|
+
hermesApprovalCoverage,
|
|
13
|
+
hermesGateToolsFrom,
|
|
14
|
+
hermesShellGateState,
|
|
15
|
+
readHermesSetting,
|
|
16
|
+
readSetupReceipt,
|
|
17
|
+
receiptWithSnapshot,
|
|
18
|
+
settingSnapshot,
|
|
19
|
+
writeHermesSetting,
|
|
20
|
+
writeSetupReceipt
|
|
21
|
+
} from "./chunk-CIRTRWHM.js";
|
|
22
|
+
import {
|
|
23
|
+
OPENCLAW_MIN_VERSION,
|
|
24
|
+
OPENCLAW_PLUGIN_ID,
|
|
25
|
+
OPENCLAW_PLUGIN_PACKAGE
|
|
26
|
+
} from "./chunk-RYDDLS62.js";
|
|
27
|
+
import {
|
|
28
|
+
retryAgentCommand
|
|
29
|
+
} from "./chunk-PUTX5BBE.js";
|
|
30
|
+
import {
|
|
31
|
+
configFilePath
|
|
32
|
+
} from "./chunk-VPADWVYD.js";
|
|
33
|
+
import {
|
|
34
|
+
readJsonSafe,
|
|
35
|
+
writeJsonAtomic
|
|
36
|
+
} from "./chunk-TODDEIYG.js";
|
|
37
|
+
import {
|
|
38
|
+
readSetupOutcomeProperties
|
|
39
|
+
} from "./chunk-O5ARO3JM.js";
|
|
40
|
+
|
|
41
|
+
// src/hermes/shell-gate.ts
|
|
42
|
+
var readHermesShellGate = async (launcher) => {
|
|
43
|
+
const [terminal, terminalEnv, dockerVolumes, dockerMountCwd, gateReading, allowlist, transport] = await Promise.all([
|
|
44
|
+
readHermesSetting(launcher, HERMES_TERMINAL_SECTION),
|
|
45
|
+
readHermesSetting(launcher, HERMES_TERMINAL_ENV_KEY),
|
|
46
|
+
readHermesSetting(launcher, HERMES_DOCKER_VOLUMES_KEY),
|
|
47
|
+
readHermesSetting(launcher, HERMES_DOCKER_MOUNT_CWD_KEY),
|
|
48
|
+
readHermesSetting(launcher, HERMES_GATE_TOOLS_KEY),
|
|
49
|
+
readHermesSetting(launcher, HERMES_COMMAND_ALLOWLIST_KEY),
|
|
50
|
+
readHermesSetting(launcher, HERMES_APPROVAL_TRANSPORT_KEY)
|
|
51
|
+
]);
|
|
52
|
+
return hermesShellGateState({
|
|
53
|
+
coverage: hermesApprovalCoverage({ terminal, terminalEnv, dockerVolumes, dockerMountCwd }),
|
|
54
|
+
gate: hermesGateToolsFrom(gateReading),
|
|
55
|
+
alwaysAllowed: hermesAlwaysAllowsShell({ allowlist, transport })
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var RECEIPT_FAILURES = {
|
|
59
|
+
missing: "receipt_missing",
|
|
60
|
+
invalid: "receipt_invalid"
|
|
61
|
+
};
|
|
62
|
+
var gateHermesShell = async (request) => {
|
|
63
|
+
const stored = readSetupReceipt(request.receipts);
|
|
64
|
+
if (stored.kind !== "ok") return { kind: "failed", reason: RECEIPT_FAILURES[stored.kind] };
|
|
65
|
+
const reading = await readHermesSetting(request.launcher, HERMES_GATE_TOOLS_KEY);
|
|
66
|
+
const gate = hermesGateToolsFrom(reading);
|
|
67
|
+
if (gatesHermesShell(gate)) return { kind: "already_gated" };
|
|
68
|
+
const value = gateToolsWithShell(gate);
|
|
69
|
+
if (reading === null || value === null) return { kind: "failed", reason: "setting_unreadable" };
|
|
70
|
+
writeSetupReceipt(request.receipts, receiptWithSnapshot(stored.receipt, settingSnapshot(HERMES_GATE_TOOLS_KEY, reading)));
|
|
71
|
+
return await writeHermesSetting(request.launcher, HERMES_GATE_TOOLS_KEY, value) ? { kind: "gated", value } : { kind: "failed", reason: "setting_refused" };
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// src/openclaw/messages.ts
|
|
75
|
+
var OPENCLAW_ENABLE_COMMAND = `openclaw plugins enable ${OPENCLAW_PLUGIN_ID} --accept-capabilities`;
|
|
76
|
+
var OPENCLAW_UPDATE_COMMAND = "openclaw update";
|
|
77
|
+
var OPENCLAW_RESTART_NOTE = "A running OpenClaw gateway picks the plugin up now; one that is stopped loads it at its next start.";
|
|
78
|
+
var SETUP_AGAIN_COMMAND = retryAgentCommand("openclaw");
|
|
79
|
+
var pluginLabel = (version) => version ? `${OPENCLAW_PLUGIN_PACKAGE} ${version}` : OPENCLAW_PLUGIN_PACKAGE;
|
|
80
|
+
var withDetail = (message, detail) => detail ? `${message} OpenClaw said: ${detail}` : message;
|
|
81
|
+
var describeOpenClawInstallFailure = (reason, detail) => {
|
|
82
|
+
switch (reason) {
|
|
83
|
+
case "plugin_id_taken":
|
|
84
|
+
return `Another OpenClaw plugin already uses the id "${OPENCLAW_PLUGIN_ID}"${detail ? ` (${detail})` : ""}, so Pushary left it alone. Remove it, then run ${SETUP_AGAIN_COMMAND}.`;
|
|
85
|
+
case "bundle_missing":
|
|
86
|
+
return `This copy of the Pushary CLI does not carry the OpenClaw plugin. Run ${SETUP_AGAIN_COMMAND} to fetch the current CLI.`;
|
|
87
|
+
case "inspect_unreadable":
|
|
88
|
+
return `OpenClaw would not report its plugins through openclaw plugins inspect, so Pushary changed nothing. Run ${OPENCLAW_UPDATE_COMMAND}, then ${SETUP_AGAIN_COMMAND}.`;
|
|
89
|
+
case "receipt_invalid":
|
|
90
|
+
return `A setup record in ~/.pushary/setup/openclaw is unreadable, so Pushary changed nothing. Move that file aside, then run ${SETUP_AGAIN_COMMAND}.`;
|
|
91
|
+
case "config_unreadable":
|
|
92
|
+
return `OpenClaw would not report plugins.entries.pushary through openclaw config get, so Pushary changed nothing. Run ${OPENCLAW_UPDATE_COMMAND}, then ${SETUP_AGAIN_COMMAND}.`;
|
|
93
|
+
case "plugin_write_failed":
|
|
94
|
+
return `Pushary could not write the plugin to ~/.pushary/openclaw-plugin. Check that folder, then run ${SETUP_AGAIN_COMMAND}.`;
|
|
95
|
+
case "install_timed_out":
|
|
96
|
+
return `OpenClaw did not finish installing ${OPENCLAW_PLUGIN_PACKAGE} in time. Run ${SETUP_AGAIN_COMMAND} again.`;
|
|
97
|
+
case "install_failed":
|
|
98
|
+
return `${withDetail(`OpenClaw could not install ${OPENCLAW_PLUGIN_PACKAGE}.`, detail)} The plugin needs OpenClaw ${OPENCLAW_MIN_VERSION} or later; on an older OpenClaw run ${OPENCLAW_UPDATE_COMMAND}, then ${SETUP_AGAIN_COMMAND}.`;
|
|
99
|
+
case "enable_failed":
|
|
100
|
+
return withDetail(`OpenClaw installed ${OPENCLAW_PLUGIN_PACKAGE} but would not enable it. Run ${OPENCLAW_ENABLE_COMMAND}.`, detail);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var describeOpenClawState = (state) => {
|
|
104
|
+
switch (state.kind) {
|
|
105
|
+
case "not_installed":
|
|
106
|
+
return `${OPENCLAW_PLUGIN_PACKAGE} is not installed`;
|
|
107
|
+
case "unreadable":
|
|
108
|
+
return "OpenClaw would not report its plugins through openclaw plugins inspect";
|
|
109
|
+
case "not_ours":
|
|
110
|
+
return `the "${OPENCLAW_PLUGIN_ID}" plugin in OpenClaw is ${state.packageName ?? "another package"}, not ${OPENCLAW_PLUGIN_PACKAGE}`;
|
|
111
|
+
case "disabled":
|
|
112
|
+
return `${pluginLabel(state.version)} is installed but disabled`;
|
|
113
|
+
case "failed_to_load":
|
|
114
|
+
return `${pluginLabel(state.version)} is installed but did not register its before_tool_call gate`;
|
|
115
|
+
case "wired":
|
|
116
|
+
return state.gateVerified ? `${pluginLabel(state.version)} is enabled and registers before_tool_call` : `${pluginLabel(state.version)} is enabled`;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
var openClawRepairStep = (state) => {
|
|
120
|
+
switch (state.kind) {
|
|
121
|
+
case "disabled":
|
|
122
|
+
return OPENCLAW_ENABLE_COMMAND;
|
|
123
|
+
case "not_ours":
|
|
124
|
+
return `openclaw plugins uninstall ${OPENCLAW_PLUGIN_ID}, then ${SETUP_AGAIN_COMMAND}`;
|
|
125
|
+
case "unreadable":
|
|
126
|
+
return `${OPENCLAW_UPDATE_COMMAND}, then ${SETUP_AGAIN_COMMAND}`;
|
|
127
|
+
default:
|
|
128
|
+
return SETUP_AGAIN_COMMAND;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// src/setup/failure-record.ts
|
|
133
|
+
import { dirname, join } from "path";
|
|
134
|
+
var failurePath = () => join(dirname(configFilePath()), "last-setup-failure.json");
|
|
135
|
+
var saveSetupFailure = (body, path = failurePath()) => {
|
|
136
|
+
const properties = readSetupOutcomeProperties(body);
|
|
137
|
+
if (properties.exitCode === null || properties.exitCode === 0) return;
|
|
138
|
+
writeJsonAtomic(path, { ...properties, recordedAt: (/* @__PURE__ */ new Date()).toISOString() }, 384);
|
|
139
|
+
};
|
|
140
|
+
var readSetupFailure = (path = failurePath()) => {
|
|
141
|
+
const result = readJsonSafe(path);
|
|
142
|
+
if (result.kind !== "ok" || typeof result.value !== "object" || result.value === null || Array.isArray(result.value)) return null;
|
|
143
|
+
const body = result.value;
|
|
144
|
+
if (!("recordedAt" in body) || typeof body.recordedAt !== "string" || body.recordedAt.length > 30 || !Number.isFinite(Date.parse(body.recordedAt))) return null;
|
|
145
|
+
return { ...readSetupOutcomeProperties({ ...body }), recordedAt: body.recordedAt };
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export {
|
|
149
|
+
readHermesShellGate,
|
|
150
|
+
gateHermesShell,
|
|
151
|
+
OPENCLAW_RESTART_NOTE,
|
|
152
|
+
describeOpenClawInstallFailure,
|
|
153
|
+
describeOpenClawState,
|
|
154
|
+
openClawRepairStep,
|
|
155
|
+
saveSetupFailure,
|
|
156
|
+
readSetupFailure
|
|
157
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readExistingMachineId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ABTQG6XU.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-YU2EUD7O.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VPADWVYD.js";
|
|
10
10
|
import {
|
|
11
11
|
getPackageVersion
|
|
12
12
|
} from "./chunk-WIIMW5YO.js";
|
|
13
13
|
import {
|
|
14
14
|
clientContextHeaders,
|
|
15
15
|
redactSecretsFromContent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-O5ARO3JM.js";
|
|
17
17
|
|
|
18
18
|
// src/cli/net.ts
|
|
19
19
|
import { createRequire } from "module";
|