@pushary/agent-hooks 0.25.0 → 0.27.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 (102) hide show
  1. package/data/cursor-plugin/scripts/pushary-gate.mjs +21 -1
  2. package/dist/bin/pushary-clean.js +3 -2
  3. package/dist/bin/pushary-codex-hook.js +37 -12
  4. package/dist/bin/pushary-codex.js +2 -1
  5. package/dist/bin/pushary-doctor.js +52 -10
  6. package/dist/bin/pushary-gemini-hook.js +36 -11
  7. package/dist/bin/pushary-hook.js +3 -2
  8. package/dist/bin/pushary-mode.js +5 -3
  9. package/dist/bin/pushary-post-hook.js +8 -2
  10. package/dist/bin/pushary-prompt-hook.js +8 -2
  11. package/dist/bin/pushary-setup.js +11 -21
  12. package/dist/bin/pushary-stop-hook.js +2 -1
  13. package/dist/bin/pushary-wait.d.ts +1 -0
  14. package/dist/bin/pushary-wait.js +86 -0
  15. package/dist/bin/pushary.js +4 -0
  16. package/dist/{chunk-WPVL6VIT.js → chunk-FDR5WYT7.js} +50 -2
  17. package/dist/chunk-IIENZE2J.js +15 -0
  18. package/dist/{chunk-5MA3CPZB.js → chunk-MVNOP5IZ.js} +5 -1
  19. package/dist/{chunk-GYPPVD3P.js → chunk-TUILTFLS.js} +74 -184
  20. package/dist/{chunk-O2QL6U6G.js → chunk-VHD3GMZ3.js} +40 -3
  21. package/dist/{chunk-JPRRYC5X.js → chunk-WXWHRXDK.js} +32 -3
  22. package/dist/src/index.d.ts +7 -1
  23. package/dist/src/index.js +3 -2
  24. package/package.json +4 -3
  25. package/dist/chunk-22CV7V7A.js +0 -38
  26. package/dist/chunk-2BE2IPMO.js +0 -315
  27. package/dist/chunk-2CRLBMOX.js +0 -244
  28. package/dist/chunk-2HMNOZPY.js +0 -109
  29. package/dist/chunk-2I6DLXJN.js +0 -219
  30. package/dist/chunk-2Q6XPZ4Q.js +0 -395
  31. package/dist/chunk-3LC4YUMA.js +0 -194
  32. package/dist/chunk-3MIR7ODJ.js +0 -112
  33. package/dist/chunk-3QZESA66.js +0 -222
  34. package/dist/chunk-4Z4MB37G.js +0 -96
  35. package/dist/chunk-5GFUI5N6.js +0 -132
  36. package/dist/chunk-5JEDLXEC.js +0 -99
  37. package/dist/chunk-5LTQNC7R.js +0 -824
  38. package/dist/chunk-5QHQVXWN.js +0 -174
  39. package/dist/chunk-6A3WCJO2.js +0 -416
  40. package/dist/chunk-6QWFMVCD.js +0 -328
  41. package/dist/chunk-6SRXMZAN.js +0 -99
  42. package/dist/chunk-7PTU7TGE.js +0 -96
  43. package/dist/chunk-AB4KX4XT.js +0 -109
  44. package/dist/chunk-AC4UYAGX.js +0 -136
  45. package/dist/chunk-ACE77TKQ.js +0 -328
  46. package/dist/chunk-BHAMEPOP.js +0 -323
  47. package/dist/chunk-BYNYYZWW.js +0 -412
  48. package/dist/chunk-C5TFTNHG.js +0 -244
  49. package/dist/chunk-CH53PBQN.js +0 -265
  50. package/dist/chunk-DF3BM6BF.js +0 -195
  51. package/dist/chunk-DKZVKEOW.js +0 -175
  52. package/dist/chunk-EMPL27ZV.js +0 -96
  53. package/dist/chunk-EQJXMEIR.js +0 -175
  54. package/dist/chunk-FGZZRCOG.js +0 -194
  55. package/dist/chunk-FXYTRZHC.js +0 -177
  56. package/dist/chunk-GTJGZBTQ.js +0 -328
  57. package/dist/chunk-HJMFYDWY.js +0 -222
  58. package/dist/chunk-HRQEECB6.js +0 -315
  59. package/dist/chunk-HWEMAAOY.js +0 -370
  60. package/dist/chunk-IBWCHA5M.js +0 -10
  61. package/dist/chunk-KTM4ZQ3W.js +0 -96
  62. package/dist/chunk-KTP2EPVB.js +0 -27
  63. package/dist/chunk-KYARP7KP.js +0 -97
  64. package/dist/chunk-M2N5DYWN.js +0 -247
  65. package/dist/chunk-M4GDBGXF.js +0 -824
  66. package/dist/chunk-M5F2L4KF.js +0 -177
  67. package/dist/chunk-M6S3M6E3.js +0 -244
  68. package/dist/chunk-N7VXDBQU.js +0 -6
  69. package/dist/chunk-O6A5RHWY.js +0 -122
  70. package/dist/chunk-ODUXELPM.js +0 -219
  71. package/dist/chunk-OF5WIOYS.js +0 -129
  72. package/dist/chunk-OP4QAN23.js +0 -99
  73. package/dist/chunk-P4JH2Q7Z.js +0 -102
  74. package/dist/chunk-PMD5JSV3.js +0 -242
  75. package/dist/chunk-PSSHNBEL.js +0 -177
  76. package/dist/chunk-QEPRH7JB.js +0 -315
  77. package/dist/chunk-QRXWPZKN.js +0 -308
  78. package/dist/chunk-QY4L6XHN.js +0 -384
  79. package/dist/chunk-RNWPCELY.js +0 -176
  80. package/dist/chunk-RSHN2AQ7.js +0 -29
  81. package/dist/chunk-RZLVE57X.js +0 -38
  82. package/dist/chunk-SDCIKREA.js +0 -241
  83. package/dist/chunk-SDREQWNI.js +0 -175
  84. package/dist/chunk-SH26ZOHU.js +0 -159
  85. package/dist/chunk-TRLBBLSS.js +0 -176
  86. package/dist/chunk-U6OXZPYC.js +0 -384
  87. package/dist/chunk-UIBTFZUD.js +0 -314
  88. package/dist/chunk-USUCPCUC.js +0 -156
  89. package/dist/chunk-V4GLWPD7.js +0 -174
  90. package/dist/chunk-VC6U3QGF.js +0 -142
  91. package/dist/chunk-VIST7ACL.js +0 -88
  92. package/dist/chunk-VUNL35KE.js +0 -16
  93. package/dist/chunk-VWBNI4SC.js +0 -174
  94. package/dist/chunk-W5KRWUNE.js +0 -262
  95. package/dist/chunk-WCGKLHCL.js +0 -154
  96. package/dist/chunk-WNXGIEX7.js +0 -219
  97. package/dist/chunk-XPVSZIA3.js +0 -315
  98. package/dist/chunk-Y633ZIJF.js +0 -384
  99. package/dist/chunk-YCL4GUFR.js +0 -222
  100. package/dist/chunk-YTMKB44I.js +0 -220
  101. package/dist/chunk-ZWBS3T7Q.js +0 -244
  102. package/dist/pushary-mode-T7XOPI6Z.js +0 -83
@@ -1,96 +0,0 @@
1
- import {
2
- callMcpTool
3
- } from "./chunk-3MIR7ODJ.js";
4
-
5
- // src/validate.ts
6
- var isPolicyConfig = (data) => {
7
- if (!data || typeof data !== "object") return false;
8
- const d = data;
9
- return Array.isArray(d.policies) && typeof d.defaultTimeoutSeconds === "number" && typeof d.defaultTimeoutAction === "string";
10
- };
11
- var isAskUserResponse = (data) => {
12
- if (!data || typeof data !== "object") return false;
13
- const d = data;
14
- return typeof d.correlationId === "string" && typeof d.status === "string";
15
- };
16
- var isWaitForAnswerResponse = (data) => {
17
- if (!data || typeof data !== "object") return false;
18
- const d = data;
19
- return typeof d.answered === "boolean";
20
- };
21
-
22
- // src/api.ts
23
- var askUser = async (apiKey, params) => {
24
- const result = await callMcpTool(apiKey, "ask_user", { ...params, wait: false });
25
- if (!isAskUserResponse(result)) throw new Error("Invalid ask_user response");
26
- return result;
27
- };
28
- var waitForAnswer = async (apiKey, correlationId, timeoutMs = 3e4) => {
29
- const result = await callMcpTool(apiKey, "wait_for_answer", {
30
- correlationId,
31
- timeoutMs
32
- });
33
- if (!isWaitForAnswerResponse(result)) throw new Error("Invalid wait_for_answer response");
34
- return result;
35
- };
36
- var cancelQuestion = async (apiKey, correlationId) => {
37
- await callMcpTool(apiKey, "cancel_question", { correlationId });
38
- };
39
- var sendNotification = async (apiKey, params) => {
40
- await callMcpTool(apiKey, "send_notification", { ...params });
41
- };
42
-
43
- // src/describe.ts
44
- var hookPrefixes = {
45
- Bash: (input) => `bash: ${input.command ?? "(no command)"}`,
46
- Write: (input) => `write file: ${input.file_path ?? "(unknown path)"}`,
47
- Edit: (input) => `edit file: ${input.file_path ?? "(unknown path)"}`,
48
- Read: (input) => `read file: ${input.file_path ?? "(unknown path)"}`
49
- };
50
- var eventPrefixes = {
51
- Bash: (input) => `ran: ${String(input.command ?? "").slice(0, 120)}`,
52
- Write: (input) => `wrote: ${input.file_path ?? "unknown"}`,
53
- Edit: (input) => `edited: ${input.file_path ?? "unknown"}`,
54
- Read: (input) => `read: ${input.file_path ?? "unknown"}`
55
- };
56
- var describeToolCall = (toolName, toolInput, format = "hook") => {
57
- const prefixes = format === "hook" ? hookPrefixes : eventPrefixes;
58
- const builder = prefixes[toolName];
59
- if (builder) return builder(toolInput);
60
- return format === "hook" ? `${toolName}: ${JSON.stringify(toolInput).slice(0, 200)}` : `${toolName}: done`;
61
- };
62
-
63
- // src/pending.ts
64
- import { join } from "path";
65
- import { tmpdir } from "os";
66
- import { existsSync, mkdirSync, writeFileSync, readdirSync, unlinkSync } from "fs";
67
- var PENDING_DIR = join(tmpdir(), "pushary-pending");
68
- var savePendingQuestion = (correlationId) => {
69
- if (!existsSync(PENDING_DIR)) mkdirSync(PENDING_DIR, { recursive: true });
70
- writeFileSync(join(PENDING_DIR, correlationId), "", "utf-8");
71
- };
72
- var listPendingQuestions = () => {
73
- try {
74
- return readdirSync(PENDING_DIR);
75
- } catch {
76
- return [];
77
- }
78
- };
79
- var removePendingQuestion = (correlationId) => {
80
- try {
81
- unlinkSync(join(PENDING_DIR, correlationId));
82
- } catch {
83
- }
84
- };
85
-
86
- export {
87
- isPolicyConfig,
88
- askUser,
89
- waitForAnswer,
90
- cancelQuestion,
91
- sendNotification,
92
- describeToolCall,
93
- savePendingQuestion,
94
- listPendingQuestions,
95
- removePendingQuestion
96
- };
@@ -1,27 +0,0 @@
1
- import {
2
- callMcpTool
3
- } from "./chunk-VIST7ACL.js";
4
-
5
- // src/api.ts
6
- var askUser = async (apiKey, params) => {
7
- return callMcpTool(apiKey, "ask_user", { ...params });
8
- };
9
- var waitForAnswer = async (apiKey, correlationId, timeoutMs = 3e4) => {
10
- return callMcpTool(apiKey, "wait_for_answer", {
11
- correlationId,
12
- timeoutMs
13
- });
14
- };
15
- var cancelQuestion = async (apiKey, correlationId) => {
16
- await callMcpTool(apiKey, "cancel_question", { correlationId });
17
- };
18
- var sendNotification = async (apiKey, params) => {
19
- await callMcpTool(apiKey, "send_notification", { ...params });
20
- };
21
-
22
- export {
23
- askUser,
24
- waitForAnswer,
25
- cancelQuestion,
26
- sendNotification
27
- };
@@ -1,97 +0,0 @@
1
- import {
2
- cancelQuestion,
3
- describeToolCall,
4
- listPendingQuestions,
5
- removePendingQuestion
6
- } from "./chunk-4Z4MB37G.js";
7
- import {
8
- getApiKey,
9
- getBaseUrl,
10
- withRetry
11
- } from "./chunk-O6A5RHWY.js";
12
-
13
- // src/events.ts
14
- import { hostname } from "os";
15
- import { basename } from "path";
16
- var cleanupPendingQuestions = async () => {
17
- try {
18
- const files = listPendingQuestions();
19
- const apiKey = getApiKey();
20
- for (const correlationId of files) {
21
- try {
22
- await cancelQuestion(apiKey, correlationId);
23
- } catch {
24
- }
25
- removePendingQuestion(correlationId);
26
- }
27
- } catch {
28
- }
29
- };
30
- var reportEvent = async (event) => {
31
- const apiKey = getApiKey();
32
- const baseUrl = getBaseUrl();
33
- await withRetry(async () => {
34
- await fetch(`${baseUrl}/api/agent/event`, {
35
- method: "POST",
36
- headers: {
37
- "Content-Type": "application/json",
38
- "Authorization": `Bearer ${apiKey}`
39
- },
40
- body: JSON.stringify({
41
- ...event,
42
- machineId: event.machineId ?? hostname()
43
- }),
44
- signal: AbortSignal.timeout(1e4)
45
- });
46
- }, { maxAttempts: 2, baseDelayMs: 300 });
47
- };
48
- var handlePostToolUse = async (input) => {
49
- try {
50
- const projectName = basename(input.cwd ?? process.cwd());
51
- const action = describeToolCall(input.tool_name, input.tool_input, "event");
52
- const isError = input.tool_result && ("error" in input.tool_result || "is_error" in input.tool_result);
53
- await Promise.allSettled([
54
- cleanupPendingQuestions(),
55
- reportEvent({
56
- event: isError ? "tool_error" : "tool_complete",
57
- agentType: "claude_code",
58
- agentName: `Claude Code - ${projectName}`,
59
- action,
60
- error: isError ? String(input.tool_result?.error ?? input.tool_result?.stderr ?? "").slice(0, 500) : void 0
61
- })
62
- ]);
63
- } catch {
64
- }
65
- };
66
- var handleStop = async (input) => {
67
- try {
68
- const projectName = basename(input.cwd ?? process.cwd());
69
- await reportEvent({
70
- event: "session_end",
71
- agentType: "claude_code",
72
- agentName: `Claude Code - ${projectName}`,
73
- action: "Session ended"
74
- });
75
- } catch {
76
- }
77
- };
78
- var handleNotification = async (input) => {
79
- try {
80
- const projectName = basename(input.cwd ?? process.cwd());
81
- await reportEvent({
82
- event: input.type === "error" ? "error" : "notification",
83
- agentType: "claude_code",
84
- agentName: `Claude Code - ${projectName}`,
85
- action: input.title ?? input.message ?? "Notification",
86
- error: input.type === "error" ? input.message : void 0
87
- });
88
- } catch {
89
- }
90
- };
91
-
92
- export {
93
- reportEvent,
94
- handlePostToolUse,
95
- handleStop,
96
- handleNotification
97
- };
@@ -1,247 +0,0 @@
1
- import {
2
- isApprovalMode
3
- } from "./chunk-IBWCHA5M.js";
4
- import {
5
- askUser,
6
- describeToolCall,
7
- isPolicyConfig,
8
- savePendingQuestion,
9
- sendNotification,
10
- waitForAnswer
11
- } from "./chunk-7PTU7TGE.js";
12
- import {
13
- withRetry
14
- } from "./chunk-3MIR7ODJ.js";
15
- import {
16
- getApiKey,
17
- getBaseUrl
18
- } from "./chunk-VUNL35KE.js";
19
-
20
- // src/policy.ts
21
- import { createHash } from "crypto";
22
- import { existsSync, readFileSync, writeFileSync } from "fs";
23
- import { join } from "path";
24
- import { tmpdir } from "os";
25
- var CACHE_TTL_MS = 5 * 60 * 1e3;
26
- var cacheFile = (apiKey) => {
27
- const hash = createHash("sha256").update(apiKey).digest("hex").slice(0, 12);
28
- return join(tmpdir(), `pushary-policy-${hash}.json`);
29
- };
30
- var fetchPolicy = async (apiKey) => {
31
- return withRetry(async () => {
32
- const baseUrl = getBaseUrl();
33
- const response = await fetch(`${baseUrl}/api/mcp/policy`, {
34
- headers: { "Authorization": `Bearer ${apiKey}` },
35
- signal: AbortSignal.timeout(1e4)
36
- });
37
- if (!response.ok) {
38
- throw new Error(`Failed to fetch policy: ${response.status}`);
39
- }
40
- const raw = await response.json();
41
- if (!isPolicyConfig(raw)) throw new Error("Invalid policy response");
42
- return raw;
43
- }, { maxAttempts: 2 });
44
- };
45
- var getPolicy = async (apiKey) => {
46
- const path = cacheFile(apiKey);
47
- let staleCache = null;
48
- if (existsSync(path)) {
49
- try {
50
- const stat = readFileSync(path, "utf-8");
51
- const cached = JSON.parse(stat);
52
- if (!isPolicyConfig(cached)) throw new Error("Corrupted cache");
53
- if (!cached._cachedAt || Date.now() - cached._cachedAt < CACHE_TTL_MS) {
54
- return cached;
55
- }
56
- staleCache = cached;
57
- } catch {
58
- }
59
- }
60
- try {
61
- const policy = await fetchPolicy(apiKey);
62
- try {
63
- writeFileSync(path, JSON.stringify({ ...policy, _cachedAt: Date.now() }), "utf-8");
64
- } catch {
65
- }
66
- return policy;
67
- } catch {
68
- if (staleCache) return staleCache;
69
- throw new Error("Failed to fetch policy and no cached policy available");
70
- }
71
- };
72
- var resolvePolicy = (config, toolName, modeOverride) => {
73
- const base = config.policies.find((p) => p.tool === toolName) ?? config.policies.find((p) => p.tool === "*") ?? {
74
- tool: toolName,
75
- timeoutSeconds: config.defaultTimeoutSeconds,
76
- timeoutAction: config.defaultTimeoutAction,
77
- mode: config.defaultMode ?? "push_first",
78
- pushFirstSeconds: config.defaultPushFirstSeconds ?? 20
79
- };
80
- const effectiveOverride = modeOverride ?? config.modeOverride;
81
- if (effectiveOverride) {
82
- return { ...base, mode: effectiveOverride };
83
- }
84
- return base;
85
- };
86
- var fetchModeOverride = async (apiKey) => {
87
- try {
88
- const baseUrl = getBaseUrl();
89
- const response = await fetch(`${baseUrl}/api/mcp/mode`, {
90
- headers: { "Authorization": `Bearer ${apiKey}` },
91
- signal: AbortSignal.timeout(3e3)
92
- });
93
- if (!response.ok) return null;
94
- const data = await response.json();
95
- const mode = data.override?.mode;
96
- if (isApprovalMode(mode)) {
97
- return mode;
98
- }
99
- return null;
100
- } catch {
101
- return null;
102
- }
103
- };
104
-
105
- // src/hook.ts
106
- import { basename } from "path";
107
- var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
108
- var allow = () => ({
109
- hookSpecificOutput: {
110
- hookEventName: "PreToolUse",
111
- permissionDecision: "allow"
112
- }
113
- });
114
- var deny = (reason) => ({
115
- hookSpecificOutput: {
116
- hookEventName: "PreToolUse",
117
- permissionDecision: "deny",
118
- permissionDecisionReason: reason
119
- }
120
- });
121
- var ask = (reason) => ({
122
- hookSpecificOutput: {
123
- hookEventName: "PreToolUse",
124
- permissionDecision: "ask",
125
- ...reason ? { permissionDecisionReason: reason } : {}
126
- }
127
- });
128
- var pollForAnswer = async (apiKey, correlationId, deadlineMs, pollInterval = 2e3) => {
129
- while (Date.now() < deadlineMs) {
130
- const remaining = Math.min(Math.max(deadlineMs - Date.now(), 1e3), 3e4);
131
- let answer;
132
- try {
133
- answer = await waitForAnswer(apiKey, correlationId, remaining);
134
- } catch {
135
- if (Date.now() + pollInterval >= deadlineMs) break;
136
- await sleep(pollInterval);
137
- continue;
138
- }
139
- if (answer.answered) return answer;
140
- if (Date.now() + pollInterval >= deadlineMs) break;
141
- await sleep(pollInterval);
142
- }
143
- return { answered: false };
144
- };
145
- var handlePushOnly = async (apiKey, description, projectName, timeoutSeconds, timeoutAction) => {
146
- let result;
147
- try {
148
- result = await askUser(apiKey, {
149
- question: `Allow ${description}?`,
150
- type: "confirm",
151
- context: `Agent wants to run this in ${projectName}`,
152
- agentName: `Claude Code - ${projectName}`
153
- });
154
- } catch {
155
- switch (timeoutAction) {
156
- case "approve":
157
- return allow();
158
- case "deny":
159
- return deny("Push notification failed, denying per policy");
160
- default:
161
- return ask("Push notification failed, asking in terminal");
162
- }
163
- }
164
- const deadline = Date.now() + timeoutSeconds * 1e3;
165
- const answer = await pollForAnswer(apiKey, result.correlationId, deadline);
166
- if (answer.answered) {
167
- return answer.value === "yes" ? allow() : deny("Denied via push notification");
168
- }
169
- switch (timeoutAction) {
170
- case "approve":
171
- return allow();
172
- case "deny":
173
- return deny("No response within timeout");
174
- default:
175
- return ask("No push response, asking in terminal");
176
- }
177
- };
178
- var handleTerminalOnly = () => {
179
- return ask();
180
- };
181
- var handlePushFirst = async (apiKey, description, projectName, pushFirstSeconds) => {
182
- let result;
183
- try {
184
- result = await askUser(apiKey, {
185
- question: `Allow ${description}?`,
186
- type: "confirm",
187
- context: `Agent wants to run this in ${projectName}`,
188
- agentName: `Claude Code - ${projectName}`
189
- });
190
- } catch {
191
- return ask("Push notification failed, asking in terminal");
192
- }
193
- const deadline = Date.now() + pushFirstSeconds * 1e3;
194
- const answer = await pollForAnswer(apiKey, result.correlationId, deadline, 1500);
195
- if (answer.answered) {
196
- return answer.value === "yes" ? allow() : deny("Denied via push notification");
197
- }
198
- savePendingQuestion(result.correlationId);
199
- return ask("Sent as push notification. You can also approve here.");
200
- };
201
- var handleNotifyOnly = async (apiKey, description, projectName) => {
202
- try {
203
- await sendNotification(apiKey, {
204
- title: "Agent needs approval",
205
- body: description,
206
- agentName: `Claude Code - ${projectName}`
207
- });
208
- } catch {
209
- }
210
- return ask();
211
- };
212
- var handlePreToolUse = async (input) => {
213
- try {
214
- const apiKey = getApiKey();
215
- const [policy, modeOverride] = await Promise.all([
216
- getPolicy(apiKey),
217
- fetchModeOverride(apiKey)
218
- ]);
219
- const toolPolicy = resolvePolicy(policy, input.tool_name, modeOverride);
220
- if (toolPolicy.timeoutSeconds === 0 && toolPolicy.timeoutAction === "approve") {
221
- return allow();
222
- }
223
- const description = describeToolCall(input.tool_name, input.tool_input, "hook");
224
- const projectName = basename(input.cwd ?? process.cwd());
225
- switch (toolPolicy.mode) {
226
- case "push_only":
227
- return handlePushOnly(apiKey, description, projectName, toolPolicy.timeoutSeconds, toolPolicy.timeoutAction);
228
- case "terminal_only":
229
- return handleTerminalOnly();
230
- case "push_first":
231
- return handlePushFirst(apiKey, description, projectName, toolPolicy.pushFirstSeconds);
232
- case "notify_only":
233
- return handleNotifyOnly(apiKey, description, projectName);
234
- default:
235
- return handlePushFirst(apiKey, description, projectName, toolPolicy.pushFirstSeconds);
236
- }
237
- } catch {
238
- return ask("Pushary unavailable, falling back to terminal approval");
239
- }
240
- };
241
-
242
- export {
243
- getPolicy,
244
- resolvePolicy,
245
- fetchModeOverride,
246
- handlePreToolUse
247
- };