pi-remote-call 0.0.0-stage → 0.1.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.
@@ -0,0 +1,79 @@
1
+ import { assertKnownHost, type RemoteCallConfig } from "./config.ts";
2
+ import { asRemoteCallError } from "./errors.ts";
3
+ import { SshConnection } from "./transport.ts";
4
+
5
+ interface HostEntry {
6
+ pending?: Promise<SshConnection>;
7
+ connection?: SshConnection;
8
+ cancelled?: boolean;
9
+ }
10
+
11
+ export class HostManager {
12
+ private readonly entries = new Map<string, HostEntry>();
13
+
14
+ constructor(readonly config: RemoteCallConfig) {}
15
+
16
+ list(): Array<{ host: string; connected: boolean; home?: string; hostname?: string; user?: string; platform?: string }> {
17
+ return this.config.hosts.map((host) => {
18
+ const connection = this.entries.get(host)?.connection;
19
+ return {
20
+ host,
21
+ connected: connection?.isOpen ?? false,
22
+ ...(connection?.isOpen
23
+ ? {
24
+ home: connection.facts.home,
25
+ hostname: connection.facts.hostname,
26
+ user: connection.facts.user,
27
+ platform: connection.facts.platform,
28
+ }
29
+ : {}),
30
+ };
31
+ });
32
+ }
33
+
34
+ async get(host: string): Promise<SshConnection> {
35
+ assertKnownHost(this.config, host);
36
+ const existing = this.entries.get(host);
37
+ if (existing?.connection?.isOpen) return existing.connection;
38
+ if (existing?.pending) return existing.pending;
39
+ const entry: HostEntry = {};
40
+ const pending = SshConnection.connect(host)
41
+ .then((connection) => {
42
+ entry.pending = undefined;
43
+ if (entry.cancelled) {
44
+ connection.close();
45
+ throw new Error(`Connection attempt cancelled for ${host}`);
46
+ }
47
+ entry.connection = connection;
48
+ connection.onClose = () => {
49
+ if (this.entries.get(host) === entry) this.entries.delete(host);
50
+ };
51
+ return connection;
52
+ })
53
+ .catch((error) => {
54
+ if (this.entries.get(host) === entry) this.entries.delete(host);
55
+ throw asRemoteCallError(error, "E_CONNECT", `Cannot connect to ${host}`);
56
+ });
57
+ entry.pending = pending;
58
+ this.entries.set(host, entry);
59
+ return pending;
60
+ }
61
+
62
+ close(host: string): boolean {
63
+ assertKnownHost(this.config, host);
64
+ const entry = this.entries.get(host);
65
+ if (!entry) return false;
66
+ entry.cancelled = true;
67
+ this.entries.delete(host);
68
+ entry.connection?.close();
69
+ return true;
70
+ }
71
+
72
+ closeAll(): void {
73
+ for (const entry of this.entries.values()) {
74
+ entry.cancelled = true;
75
+ entry.connection?.close();
76
+ }
77
+ this.entries.clear();
78
+ }
79
+ }
package/src/index.ts ADDED
@@ -0,0 +1,58 @@
1
+ import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
+ import { loadConfig } from "./config.ts";
3
+ import { RemoteCallError } from "./errors.ts";
4
+ import { HostManager } from "./host-manager.ts";
5
+ import { registerRemoteTools } from "./tools.ts";
6
+
7
+ function errorMessage(error: unknown): string {
8
+ if (error instanceof RemoteCallError) return error.toString();
9
+ return error instanceof Error ? error.message : String(error);
10
+ }
11
+
12
+ function formatHosts(manager: HostManager): string {
13
+ return manager.list().map((host) => {
14
+ if (!host.connected) return `${host.host} — disconnected`;
15
+ return `${host.host} — ${host.user}@${host.hostname} (${host.platform}), home: ${host.home}`;
16
+ }).join("\n");
17
+ }
18
+
19
+ async function runCommand(args: string, ctx: ExtensionCommandContext, manager: HostManager): Promise<void> {
20
+ const [command = "list", host] = args.trim() ? args.trim().split(/\s+/) : [];
21
+ try {
22
+ switch (command) {
23
+ case "list":
24
+ ctx.ui.notify(formatHosts(manager), "info");
25
+ return;
26
+ case "status": {
27
+ if (!host) {
28
+ ctx.ui.notify("Usage: /remote-call status <ssh-alias>", "warning");
29
+ return;
30
+ }
31
+ const connection = await manager.get(host);
32
+ ctx.ui.notify(JSON.stringify(connection.facts, null, 2), "info");
33
+ return;
34
+ }
35
+ case "disconnect":
36
+ if (!host) {
37
+ ctx.ui.notify("Usage: /remote-call disconnect <ssh-alias>", "warning");
38
+ return;
39
+ }
40
+ ctx.ui.notify(manager.close(host) ? `Disconnected: ${host}` : `Not connected: ${host}`, "info");
41
+ return;
42
+ default:
43
+ ctx.ui.notify("Usage: /remote-call [list] | status <alias> | disconnect <alias>", "warning");
44
+ }
45
+ } catch (error) {
46
+ ctx.ui.notify(errorMessage(error), "error");
47
+ }
48
+ }
49
+
50
+ export default function piRemoteCall(pi: ExtensionAPI): void {
51
+ const manager = new HostManager(loadConfig());
52
+ registerRemoteTools(pi, manager);
53
+ pi.registerCommand("remote-call", {
54
+ description: "List, check, or disconnect remote-call SSH hosts",
55
+ handler: (args, ctx) => runCommand(args, ctx, manager),
56
+ });
57
+ pi.on("session_shutdown", () => manager.closeAll());
58
+ }
@@ -0,0 +1,18 @@
1
+ import { posix } from "node:path";
2
+
3
+ export function resolveRemotePath(home: string, input: string, cwd?: string): string {
4
+ const value = input;
5
+ const base = cwd ? resolveRemotePath(home, cwd) : home;
6
+ if (value === "~") return home;
7
+ if (value.startsWith("~/")) return posix.resolve(home, value.slice(2));
8
+ return posix.resolve(base, value || ".");
9
+ }
10
+
11
+ /** Quote one argument for the remote Bash script. */
12
+ export function shellQuote(value: string): string {
13
+ return `'${value.replace(/'/g, `'"'"'`)}'`;
14
+ }
15
+
16
+ export function remoteCommandScript(command: string, cwd: string): string {
17
+ return `${cwd ? `cd -- ${shellQuote(cwd)} || exit $?\n` : ""}${command}`;
18
+ }
package/src/sftp.ts ADDED
@@ -0,0 +1,96 @@
1
+ import { randomBytes } from "node:crypto";
2
+ import { posix } from "node:path";
3
+ import type { SFTPWrapper, Stats } from "ssh2";
4
+
5
+ export function sftpRealpath(sftp: SFTPWrapper, path: string): Promise<string> {
6
+ return new Promise((resolve, reject) => sftp.realpath(path, (error, result) => (error ? reject(error) : resolve(result))));
7
+ }
8
+
9
+ export function sftpStat(sftp: SFTPWrapper, path: string): Promise<Stats> {
10
+ return new Promise((resolve, reject) => sftp.stat(path, (error, stats) => (error ? reject(error) : resolve(stats))));
11
+ }
12
+
13
+ export function sftpMkdir(sftp: SFTPWrapper, path: string): Promise<void> {
14
+ return new Promise((resolve, reject) => sftp.mkdir(path, (error) => (error ? reject(error) : resolve())));
15
+ }
16
+
17
+ export function sftpUnlink(sftp: SFTPWrapper, path: string): Promise<void> {
18
+ return new Promise((resolve, reject) => sftp.unlink(path, (error) => (error ? reject(error) : resolve())));
19
+ }
20
+
21
+ export async function sftpAccess(sftp: SFTPWrapper, path: string, write = false): Promise<void> {
22
+ const handle = await new Promise<Buffer>((resolve, reject) =>
23
+ sftp.open(path, write ? "r+" : "r", (error, value) => (error ? reject(error) : resolve(value))),
24
+ );
25
+ await new Promise<void>((resolve, reject) => sftp.close(handle, (error) => (error ? reject(error) : resolve())));
26
+ }
27
+
28
+ export async function sftpMkdirP(sftp: SFTPWrapper, path: string): Promise<void> {
29
+ const normalized = posix.resolve(path);
30
+ const parts = normalized.split("/").filter(Boolean);
31
+ let current = "/";
32
+ for (const part of parts) {
33
+ current = posix.join(current, part);
34
+ try {
35
+ await sftpMkdir(sftp, current);
36
+ } catch (error) {
37
+ const stats = await sftpStat(sftp, current).catch(() => undefined);
38
+ if (!stats?.isDirectory()) throw error;
39
+ }
40
+ }
41
+ }
42
+
43
+ export function sftpReadFile(sftp: SFTPWrapper, path: string): Promise<Buffer> {
44
+ return new Promise((resolve, reject) => {
45
+ const chunks: Buffer[] = [];
46
+ const stream = sftp.createReadStream(path);
47
+ stream.on("data", (chunk: Buffer) => chunks.push(Buffer.from(chunk)));
48
+ stream.once("error", reject);
49
+ stream.once("end", () => resolve(Buffer.concat(chunks)));
50
+ });
51
+ }
52
+
53
+ function sftpRename(sftp: SFTPWrapper, source: string, destination: string): Promise<void> {
54
+ return new Promise((resolve, reject) => {
55
+ sftp.ext_openssh_rename(source, destination, (error) => {
56
+ if (!error) return resolve();
57
+ sftp.rename(source, destination, (fallbackError) => (fallbackError ? reject(fallbackError) : resolve()));
58
+ });
59
+ });
60
+ }
61
+
62
+ export async function sftpWriteFileAtomic(sftp: SFTPWrapper, path: string, content: string): Promise<void> {
63
+ const stats = await sftpStat(sftp, path).catch(() => undefined);
64
+ const temporary = posix.join(
65
+ posix.dirname(path),
66
+ `.pi-remote-call-${process.pid}-${randomBytes(6).toString("hex")}.tmp`,
67
+ );
68
+ try {
69
+ await new Promise<void>((resolve, reject) => {
70
+ const stream = sftp.createWriteStream(temporary, { flags: "w", mode: stats ? stats.mode & 0o777 : 0o600 });
71
+ stream.once("error", reject);
72
+ stream.once("close", resolve);
73
+ stream.end(content, "utf8");
74
+ });
75
+ await sftpRename(sftp, temporary, path);
76
+ } catch (error) {
77
+ await sftpUnlink(sftp, temporary).catch(() => undefined);
78
+ throw error;
79
+ }
80
+ }
81
+
82
+ export function detectImageMimeType(path: string): string | null {
83
+ switch (posix.extname(path).toLowerCase()) {
84
+ case ".png":
85
+ return "image/png";
86
+ case ".jpg":
87
+ case ".jpeg":
88
+ return "image/jpeg";
89
+ case ".gif":
90
+ return "image/gif";
91
+ case ".webp":
92
+ return "image/webp";
93
+ default:
94
+ return null;
95
+ }
96
+ }
@@ -0,0 +1,128 @@
1
+ import { execFile } from "node:child_process";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { promisify } from "node:util";
5
+ import { RemoteCallError } from "./errors.ts";
6
+
7
+ const execFileAsync = promisify(execFile);
8
+
9
+ export interface EffectiveSshConfig {
10
+ alias: string;
11
+ host: string;
12
+ port: number;
13
+ user: string;
14
+ identityFiles: string[];
15
+ identityAgent?: string;
16
+ identitiesOnly: boolean;
17
+ knownHostsFiles: string[];
18
+ proxyJump?: string;
19
+ proxyCommand?: string;
20
+ hostKeyAlias?: string;
21
+ }
22
+
23
+ function unquote(value: string): string {
24
+ const trimmed = value.trim();
25
+ if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
26
+ try {
27
+ return JSON.parse(trimmed);
28
+ } catch {
29
+ return trimmed.slice(1, -1);
30
+ }
31
+ }
32
+ if (trimmed.startsWith("'") && trimmed.endsWith("'")) return trimmed.slice(1, -1);
33
+ return trimmed;
34
+ }
35
+
36
+ export function splitSshWords(value: string): string[] {
37
+ const words: string[] = [];
38
+ const pattern = /"((?:\\.|[^"\\])*)"|'([^']*)'|(\S+)/g;
39
+ for (let match = pattern.exec(value); match; match = pattern.exec(value)) {
40
+ if (match[1] !== undefined) {
41
+ try {
42
+ words.push(JSON.parse(`"${match[1]}"`));
43
+ } catch {
44
+ words.push(match[1]);
45
+ }
46
+ } else {
47
+ words.push(match[2] ?? match[3]);
48
+ }
49
+ }
50
+ return words;
51
+ }
52
+
53
+ function expandHome(path: string): string {
54
+ if (path === "~") return homedir();
55
+ if (path.startsWith("~/") || path.startsWith("~\\")) return join(homedir(), path.slice(2));
56
+ return path;
57
+ }
58
+
59
+ export function parseSshG(alias: string, output: string): EffectiveSshConfig {
60
+ const values = new Map<string, string[]>();
61
+ for (const line of output.split(/\r?\n/)) {
62
+ if (!line.trim()) continue;
63
+ const separator = line.search(/\s/);
64
+ if (separator < 1) continue;
65
+ const key = line.slice(0, separator).toLowerCase();
66
+ const value = line.slice(separator).trim();
67
+ const list = values.get(key) ?? [];
68
+ list.push(value);
69
+ values.set(key, list);
70
+ }
71
+ const one = (key: string): string | undefined => {
72
+ const value = values.get(key)?.[0];
73
+ return value === undefined ? undefined : unquote(value);
74
+ };
75
+ const host = one("hostname");
76
+ if (!host) {
77
+ throw new RemoteCallError("E_SSH_CONFIG", `ssh -G ${alias} returned no hostname`);
78
+ }
79
+ const portText = one("port") ?? "22";
80
+ const port = Number(portText);
81
+ if (!Number.isInteger(port) || port < 1 || port > 65535) {
82
+ throw new RemoteCallError("E_SSH_CONFIG", `Invalid SSH port for ${alias}: ${portText}`);
83
+ }
84
+ const identityFiles = (values.get("identityfile") ?? []).flatMap(splitSshWords).map(expandHome);
85
+ const configuredAgent = one("identityagent");
86
+ let identityAgent = configuredAgent;
87
+ if (configuredAgent?.startsWith("$")) identityAgent = process.env[configuredAgent.slice(1)];
88
+ if (!identityAgent && process.env.SSH_AUTH_SOCK) identityAgent = process.env.SSH_AUTH_SOCK;
89
+ if (!identityAgent && process.platform === "win32") identityAgent = "\\\\.\\pipe\\openssh-ssh-agent";
90
+ if (identityAgent === "none") identityAgent = undefined;
91
+ const knownHostsFiles = [
92
+ ...(values.get("userknownhostsfile") ?? []).flatMap(splitSshWords),
93
+ ...(values.get("globalknownhostsfile") ?? []).flatMap(splitSshWords),
94
+ ].map(expandHome);
95
+ if (knownHostsFiles.length === 0) knownHostsFiles.push(join(homedir(), ".ssh", "known_hosts"));
96
+ const proxyJump = one("proxyjump");
97
+ return {
98
+ alias,
99
+ host,
100
+ port,
101
+ user: one("user") ?? process.env.USERNAME ?? process.env.USER ?? "root",
102
+ identityFiles: [...new Set(identityFiles)],
103
+ identityAgent,
104
+ identitiesOnly: one("identitiesonly") === "yes",
105
+ knownHostsFiles: [...new Set(knownHostsFiles)],
106
+ proxyJump: proxyJump && proxyJump !== "none" ? proxyJump : undefined,
107
+ proxyCommand: one("proxycommand") && one("proxycommand") !== "none" ? one("proxycommand") : undefined,
108
+ hostKeyAlias: one("hostkeyalias"),
109
+ };
110
+ }
111
+
112
+ export async function resolveSshConfig(alias: string): Promise<EffectiveSshConfig> {
113
+ try {
114
+ const { stdout } = await execFileAsync("ssh", ["-G", alias], {
115
+ timeout: 10_000,
116
+ windowsHide: true,
117
+ maxBuffer: 4 * 1024 * 1024,
118
+ });
119
+ return parseSshG(alias, stdout);
120
+ } catch (error) {
121
+ throw new RemoteCallError(
122
+ "E_SSH_CONFIG",
123
+ `Cannot resolve SSH alias ${alias} with ssh -G`,
124
+ `Run: ssh -G ${alias}`,
125
+ { cause: error },
126
+ );
127
+ }
128
+ }
package/src/tools.ts ADDED
@@ -0,0 +1,152 @@
1
+ import {
2
+ createBashTool,
3
+ createReadTool,
4
+ defineTool,
5
+ type ExtensionAPI,
6
+ } from "@earendil-works/pi-coding-agent";
7
+ import { Type } from "typebox";
8
+ import { editRemoteFile, remoteReadOperations, writeRemoteFile } from "./file-tools.ts";
9
+ import type { HostManager } from "./host-manager.ts";
10
+ import { resolveRemotePath } from "./remote-path.ts";
11
+
12
+ const namespace = {
13
+ name: "remote-call",
14
+ aliases: ["remote_call"],
15
+ description: "Shell and file tools on configured SSH hosts; no remote Pi or agent is installed.",
16
+ instructions: "Every remote tool requires host, which must exactly match an entry in the configured hosts[] SSH alias allowlist. cwd defaults to the remote user's home directory.",
17
+ };
18
+
19
+ function textResult(text: string, details: unknown) {
20
+ return { content: [{ type: "text" as const, text }], details };
21
+ }
22
+
23
+ export function registerRemoteTools(pi: ExtensionAPI, manager: HostManager): void {
24
+ const hostSchema = Type.Unsafe<string>({ type: "string", enum: manager.config.hosts, description: "Configured SSH alias" });
25
+ const cwdSchema = Type.Optional(Type.String({ description: "Remote working directory; defaults to ~" }));
26
+ const bashOutputSchema = createBashTool(process.cwd()).outputSchema;
27
+ const readOutputSchema = createReadTool(process.cwd()).outputSchema;
28
+
29
+ pi.registerTool(defineTool({
30
+ name: "remote_hosts",
31
+ label: "Remote Hosts",
32
+ description: "List configured SSH aliases, show cached connection status, or diagnose a live connection",
33
+ promptSnippet: "List or check SSH hosts available to remote_* tools",
34
+ promptGuidelines: ["Use remote_hosts to discover valid host values before a remote_* call when the user has not named a configured host."],
35
+ parameters: Type.Object({
36
+ action: Type.Unsafe<"list" | "status" | "diagnose">({ type: "string", enum: ["list", "status", "diagnose"] }),
37
+ host: Type.Optional(hostSchema),
38
+ }),
39
+ namespace,
40
+ annotations: { readOnlyHint: true, openWorldHint: true },
41
+ async execute(_id, { action, host }) {
42
+ if (action === "diagnose") {
43
+ if (!host) throw new Error("host is required when action=diagnose");
44
+ const connection = await manager.get(host);
45
+ const details = {
46
+ ...connection.facts,
47
+ checks: { sshConfig: true, knownHosts: true, authentication: true, sftp: true, bash: true },
48
+ };
49
+ return textResult(JSON.stringify(details, null, 2), details);
50
+ }
51
+ if (action === "status" && host) {
52
+ const status = manager.list().find((entry) => entry.host === host)!;
53
+ return textResult(JSON.stringify(status, null, 2), status);
54
+ }
55
+ const hosts = manager.list();
56
+ return textResult(JSON.stringify(hosts, null, 2), { hosts });
57
+ },
58
+ }));
59
+
60
+ pi.registerTool(defineTool({
61
+ name: "remote_bash",
62
+ label: "Remote Bash",
63
+ description: "Execute a Bash command on a configured SSH host. Output and truncation follow Pi's native bash tool.",
64
+ promptSnippet: "Execute Bash commands on a configured remote SSH host",
65
+ promptGuidelines: ["Use remote_bash for commands on a configured remote host; host is required and cwd defaults to ~."],
66
+ parameters: Type.Object({
67
+ host: hostSchema,
68
+ command: Type.String({ description: "Bash command to execute remotely" }),
69
+ cwd: cwdSchema,
70
+ timeout: Type.Optional(Type.Number({ description: "Timeout in seconds" })),
71
+ }),
72
+ outputSchema: bashOutputSchema,
73
+ namespace,
74
+ annotations: { destructiveHint: true, openWorldHint: true },
75
+ async execute(id, { host, command, cwd, timeout }, signal, onUpdate) {
76
+ const connection = await manager.get(host);
77
+ const remoteCwd = resolveRemotePath(connection.facts.home, cwd ?? "~");
78
+ const tool = createBashTool(remoteCwd, {
79
+ operations: connection.bashOperations(),
80
+ exposeSessionEnvironment: false,
81
+ });
82
+ return tool.execute(id, { command, timeout }, signal, onUpdate);
83
+ },
84
+ }));
85
+
86
+ pi.registerTool(defineTool({
87
+ name: "remote_read",
88
+ label: "Remote Read",
89
+ description: "Read a text file or image from a configured SSH host, with Pi's native pagination and truncation",
90
+ promptSnippet: "Read files on a configured remote SSH host",
91
+ promptGuidelines: ["Use remote_read instead of remote_bash cat for remote file reads; host is required and relative paths start at cwd or ~."],
92
+ parameters: Type.Object({
93
+ host: hostSchema,
94
+ path: Type.String({ description: "Remote absolute path, ~/path, or path relative to cwd" }),
95
+ cwd: cwdSchema,
96
+ offset: Type.Optional(Type.Number({ description: "1-based starting line" })),
97
+ limit: Type.Optional(Type.Number({ description: "Maximum lines to read" })),
98
+ }),
99
+ outputSchema: readOutputSchema,
100
+ namespace,
101
+ annotations: { readOnlyHint: true, openWorldHint: true },
102
+ async execute(id, { host, path, cwd, offset, limit }, signal, onUpdate) {
103
+ const connection = await manager.get(host);
104
+ const absolutePath = resolveRemotePath(connection.facts.home, path, cwd ?? "~");
105
+ const tool = createReadTool("/", { operations: remoteReadOperations(connection.readOperations()) });
106
+ return tool.execute(id, { path: absolutePath, offset, limit }, signal, onUpdate);
107
+ },
108
+ }));
109
+
110
+ pi.registerTool(defineTool({
111
+ name: "remote_write",
112
+ label: "Remote Write",
113
+ description: "Create or completely overwrite a file on a configured SSH host through SFTP",
114
+ promptSnippet: "Create or overwrite files on a configured remote SSH host",
115
+ promptGuidelines: ["Use remote_write only for new remote files or complete rewrites; use remote_edit for targeted changes."],
116
+ parameters: Type.Object({
117
+ host: hostSchema,
118
+ path: Type.String({ description: "Remote absolute path, ~/path, or path relative to cwd" }),
119
+ content: Type.String(),
120
+ cwd: cwdSchema,
121
+ }),
122
+ namespace,
123
+ annotations: { destructiveHint: true, openWorldHint: true },
124
+ async execute(id, { host, path, content, cwd }, signal, onUpdate) {
125
+ const connection = await manager.get(host);
126
+ return writeRemoteFile(connection.facts.home, cwd ?? "~", path, content, connection.writeOperations(), signal);
127
+ },
128
+ }));
129
+
130
+ pi.registerTool(defineTool({
131
+ name: "remote_edit",
132
+ label: "Remote Edit",
133
+ description: "Apply exact text replacements to a file on a configured SSH host through SFTP",
134
+ promptSnippet: "Make exact-text edits on a configured remote SSH host",
135
+ promptGuidelines: ["Use remote_edit for targeted remote changes. Every edits[].oldText must exactly and uniquely match the remote file."],
136
+ parameters: Type.Object({
137
+ host: hostSchema,
138
+ path: Type.String({ description: "Remote absolute path, ~/path, or path relative to cwd" }),
139
+ cwd: cwdSchema,
140
+ edits: Type.Array(Type.Object({
141
+ oldText: Type.String(),
142
+ newText: Type.String(),
143
+ }), { minItems: 1 }),
144
+ }),
145
+ namespace,
146
+ annotations: { destructiveHint: true, openWorldHint: true },
147
+ async execute(id, { host, path, cwd, edits }, signal, onUpdate) {
148
+ const connection = await manager.get(host);
149
+ return editRemoteFile(connection.facts.home, cwd ?? "~", path, edits, connection.editOperations(), signal);
150
+ },
151
+ }));
152
+ }