hinacode 0.2.0-alpha.0 → 0.2.0-alpha.1

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.
@@ -4,7 +4,7 @@ import { homedir, hostname } from "node:os";
4
4
  import { dirname, delimiter, basename, join } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import QRCode from "qrcode";
7
- import { S as Struct, e as effect, U as Updates, g as gen, u as unsupported, E as Events, t as tryPromise, d as decodeUnknownSync, m as make$1, s as suspend, r as repeat, a as spaced, f as forkScoped, T as Threads, W as Worktrees, b as Terminals, c as forEach, o as orElseSucceed, h as sync, i as isThreadBusy, j as String$1, v as void_, k as andThen, l as matchEffect, n as forkDetach, p as flatMap, q as UsageError, w as USAGE, x as parseCommand, y as serveConfig, z as hydratePath, A as make$2, B as makeAppLayer, C as autoUpdate, D as applyServeRelay, R as RemoteAccess, F as layer$1, G as provideMerge, H as mergeAll, I as layer$2, J as layer$3, K as noKeyring, L as layer$4, M as provide, N as succeed, O as MinimumLogLevel, P as Settings, Q as storedTunnel, V as isPortInUse, X as pairingUrl, Y as restartCommand } from "./chunks/shellPath-B8h-TJ4C.js";
7
+ import { S as Struct, e as effect, U as Updates, g as gen, u as unsupported, E as Events, t as tryPromise, d as decodeUnknownSync, m as make$1, s as suspend, r as repeat, a as spaced, f as forkScoped, T as Threads, W as Worktrees, b as Terminals, c as forEach, o as orElseSucceed, h as sync, i as isThreadBusy, j as String$1, v as void_, k as andThen, l as matchEffect, n as forkDetach, p as flatMap, q as UsageError, w as USAGE, x as parseCommand, y as serveConfig, z as hydratePath, A as make$2, B as makeAppLayer, C as autoUpdate, D as applyServeRelay, R as RemoteAccess, F as layer$1, G as provideMerge, H as mergeAll, I as layer$2, J as layer$3, K as noKeyring, L as layer$4, M as provide, N as succeed, O as MinimumLogLevel, P as Settings, Q as storedTunnel, V as isPortInUse, X as pairingUrl, Y as restartCommand } from "./chunks/shellPath-b-g7j5HA.js";
8
8
  import { execFile } from "node:child_process";
9
9
  import { promisify } from "node:util";
10
10
  import "node:crypto";
@@ -17,15 +17,16 @@ import "@modelcontextprotocol/sdk/types.js";
17
17
  import "@muse-code/sdk";
18
18
  import "node:sqlite";
19
19
  import "node-pty";
20
+ import "playwright";
21
+ import "ws";
22
+ import "@noble/hashes/hmac.js";
23
+ import "@noble/hashes/sha2.js";
24
+ import "@noble/hashes/utils.js";
20
25
  import "node:http";
21
26
  import "node:stream/promises";
22
27
  import "node:zlib";
23
- import "ws";
24
28
  import "node:net";
25
29
  import "node:tls";
26
- import "@noble/hashes/hmac.js";
27
- import "@noble/hashes/sha2.js";
28
- import "@noble/hashes/utils.js";
29
30
  const execFileAsync = promisify(execFile);
30
31
  const CHECK_INTERVAL = "4 hours";
31
32
  const AUTO_INSTALL_INTERVAL = "1 minute";
package/out/main/index.js CHANGED
@@ -2,7 +2,7 @@ import { existsSync, renameSync } from "node:fs";
2
2
  import { join, delimiter } from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { Notification, nativeImage, BrowserWindow, ipcMain, app, shell, dialog, protocol, safeStorage, powerMonitor, Menu, net, session } from "electron";
5
- import { h as sync, Z as catchDefect, _ as succeed, $ as callback, a0 as timeoutOrElse, a1 as seconds, a2 as TaggedError, j as String$1, a3 as promise, t as tryPromise, S as Struct, a4 as optional, a5 as RpcCall, a6 as decodeUnknownOption, a7 as EVENT_CHANNEL, a8 as RPC_CHANNEL, a9 as isTrustedSender, g as gen, aa as getOrUndefined, ab as dispatch, ac as Environments, p as flatMap, ad as catch_, ae as all$1, af as map, ag as externalUrl, v as void_, ah as logWarning, ai as decodeUnknownEffect, aj as RpcMethods, ak as inlineSource, u as unsupported, E as Events, al as runFork, r as repeat, a as spaced, f as forkScoped, U as Updates, s as suspend, e as effect, am as ignore, z as hydratePath, an as ATTACHMENT_PROTOCOL, ao as GITHUB_ASSET_PROTOCOL, ap as PROJECT_FILE_PROTOCOL, N as succeed$1, aq as Keyring, A as make$1, B as makeAppLayer, ar as isInside, as as githubAssetId, at as GitHub, au as projectFileRequest, av as Files, aw as BROWSER_PARTITION, ax as lockDownWebview, ay as isAllowedNavigation } from "./chunks/shellPath-B8h-TJ4C.js";
5
+ import { h as sync, Z as catchDefect, _ as succeed, $ as callback, a0 as timeoutOrElse, a1 as seconds, a2 as TaggedError, j as String$1, a3 as promise, t as tryPromise, a4 as EVENT_CHANNEL, a5 as RPC_CHANNEL, a6 as isTrustedSender, a7 as route, a8 as map, a9 as externalUrl, v as void_, aa as catch_, ab as logWarning, g as gen, u as unsupported, E as Events, ac as runFork, r as repeat, a as spaced, f as forkScoped, U as Updates, s as suspend, e as effect, ad as ignore, z as hydratePath, ae as ATTACHMENT_PROTOCOL, af as GITHUB_ASSET_PROTOCOL, ag as PROJECT_FILE_PROTOCOL, ah as decodeUnknownOption, ai as RpcMethods, N as succeed$1, aj as Keyring, A as make$1, B as makeAppLayer, p as flatMap, ak as Environments, al as isInside, am as githubAssetId, an as GitHub, ao as projectFileRequest, ap as Files, aq as BROWSER_PARTITION, ar as lockDownWebview, as as getOrUndefined, at as isAllowedNavigation } from "./chunks/shellPath-b-g7j5HA.js";
6
6
  import { createRequire } from "node:module";
7
7
  import { execFile, spawn } from "node:child_process";
8
8
  import { access } from "node:fs/promises";
@@ -19,174 +19,16 @@ import "@modelcontextprotocol/sdk/types.js";
19
19
  import "@muse-code/sdk";
20
20
  import "node:sqlite";
21
21
  import "node-pty";
22
+ import "playwright";
23
+ import "ws";
24
+ import "@noble/hashes/hmac.js";
25
+ import "@noble/hashes/sha2.js";
26
+ import "@noble/hashes/utils.js";
22
27
  import "node:http";
23
28
  import "node:stream/promises";
24
29
  import "node:zlib";
25
- import "ws";
26
30
  import "node:net";
27
31
  import "node:tls";
28
- import "@noble/hashes/hmac.js";
29
- import "@noble/hashes/sha2.js";
30
- import "@noble/hashes/utils.js";
31
- const client = { to: "client" };
32
- const all = { to: "all" };
33
- const named = { to: "named" };
34
- const owner = (entity, key) => ({ to: "owner", entity, key });
35
- const thread = owner("thread", "threadId");
36
- const project = owner("project", "id");
37
- const root = owner("root", "root");
38
- const routes = {
39
- "app.ready": client,
40
- "app.focus": client,
41
- "dialog.pickFolder": client,
42
- "dialog.pickFiles": client,
43
- "shell.reveal": client,
44
- "shell.openers": client,
45
- "shell.openWith": client,
46
- "notifications.permission": client,
47
- "notifications.askPermission": client,
48
- "clientSettings.get": client,
49
- "clientSettings.set": client,
50
- "environments.list": client,
51
- "environments.add": client,
52
- "environments.remove": client,
53
- "environments.reconnect": client,
54
- "relayAccount.status": client,
55
- "relayAccount.signIn": client,
56
- "relayAccount.signOut": client,
57
- "relayAccount.sync": client,
58
- "relayAccount.machines": client,
59
- "relayAccount.setShown": client,
60
- "relayAccount.removeMachine": client,
61
- "relayAccount.pendingLink": client,
62
- "relayAccount.approveLink": client,
63
- "updates.status": named,
64
- "updates.check": named,
65
- "updates.install": named,
66
- "agents.updates": client,
67
- "agents.update": client,
68
- "links.favicon": client,
69
- "projects.list": all,
70
- "threads.list": all,
71
- "worktrees.list": all,
72
- "worktrees.checkouts": all,
73
- "pullRequests.all": all,
74
- "linear.issues": all,
75
- "limits.list": named,
76
- "search.threads": all,
77
- "settings.get": named,
78
- "settings.set": named,
79
- "accounts.list": named,
80
- "accounts.create": named,
81
- "accounts.rename": named,
82
- "accounts.delete": named,
83
- "agents.account": named,
84
- "models.list": named,
85
- "secrets.has": named,
86
- "secrets.set": named,
87
- "secrets.clear": named,
88
- "github.auth": named,
89
- "github.pullRequest": named,
90
- "github.pullRequestDetail": named,
91
- "github.pullRequestFiles": named,
92
- "pullRequestGuides.get": named,
93
- "pullRequestGuides.retry": named,
94
- "github.merge": named,
95
- "github.close": named,
96
- "vm.host": named,
97
- "network.addresses": named,
98
- "system.resources": named,
99
- "remote.status": named,
100
- "remote.pairing": named,
101
- "remote.rotateToken": named,
102
- "remote.setupRelay": named,
103
- "remote.removeRelay": named,
104
- "projects.create": named,
105
- "projects.clone": named,
106
- "ports.kill": named,
107
- "automations.list": named,
108
- "projects.update": project,
109
- "projects.delete": project,
110
- "projects.currentBranch": project,
111
- "projects.defaultBranch": project,
112
- "projects.branches": project,
113
- "projects.pullRequests": project,
114
- "projects.searchPullRequests": project,
115
- "projects.fetch": project,
116
- "projects.icon": project,
117
- "threads.create": owner("project", "projectId"),
118
- "worktrees.create": owner("project", "projectId"),
119
- "automations.create": owner("project", "projectId"),
120
- "github.repository": owner("project", "projectId"),
121
- "threads.update": owner("thread", "id"),
122
- "threads.delete": owner("thread", "id"),
123
- "threads.resumeAtReset": owner("thread", "id"),
124
- "threads.switchAccount": owner("thread", "id"),
125
- "threads.changes": thread,
126
- "threads.archive": thread,
127
- "threads.unarchive": thread,
128
- "threads.transcript": thread,
129
- "threads.send": thread,
130
- "threads.steer": thread,
131
- "threads.queue": thread,
132
- "threads.unqueue": thread,
133
- "threads.interrupt": thread,
134
- "threads.usage": thread,
135
- "commands.list": thread,
136
- "files.list": thread,
137
- "search.files": thread,
138
- "subagents.list": thread,
139
- "subagents.stop": thread,
140
- "backgroundTasks.list": thread,
141
- "backgroundTasks.stop": thread,
142
- "pullRequests.list": thread,
143
- "pullRequests.unlink": thread,
144
- "pullRequests.create": thread,
145
- "pullRequests.watch": thread,
146
- "pullRequests.unwatch": thread,
147
- "mcp.connection": thread,
148
- "ports.list": thread,
149
- "terminal.open": thread,
150
- "terminal.list": thread,
151
- "vm.get": thread,
152
- "vm.start": thread,
153
- "vm.stop": thread,
154
- "vm.control": thread,
155
- "vm.screen.open": thread,
156
- "vm.files.drop": thread,
157
- "vm.profile.save": thread,
158
- "vm.screenshot.save": thread,
159
- "vm.passkey.get": thread,
160
- "vm.passkey.prepare": thread,
161
- "vm.passkey.cancel": thread,
162
- "attachments.stage": thread,
163
- "attachments.read": named,
164
- "worktrees.remove": owner("worktree", "id"),
165
- "worktrees.setupLog": owner("worktree", "id"),
166
- "worktrees.stopSetup": owner("worktree", "id"),
167
- "worktrees.pullRequest": owner("worktree", "id"),
168
- "terminal.write": owner("terminal", "id"),
169
- "terminal.resize": owner("terminal", "id"),
170
- "terminal.close": owner("terminal", "id"),
171
- "terminal.attach": owner("terminal", "id"),
172
- "automations.update": owner("automation", "id"),
173
- "automations.delete": owner("automation", "id"),
174
- "automations.runNow": owner("automation", "id"),
175
- "automations.runs": owner("automation", "id"),
176
- "automations.webhookUrl": owner("automation", "id"),
177
- "approvals.respond": owner("request", "requestId"),
178
- "questions.respond": owner("request", "requestId"),
179
- "secrets.respond": owner("request", "requestId"),
180
- "git.log": root,
181
- "git.show": root,
182
- "fs.list": root,
183
- "fs.read": root,
184
- "fs.preview": root,
185
- "fs.write": root,
186
- "fs.watch": root,
187
- "vm.screen.send": owner("stream", "streamId"),
188
- "vm.screen.close": owner("stream", "streamId")
189
- };
190
32
  const require$1 = createRequire(import.meta.url);
191
33
  const notificationPermission = sync(() => {
192
34
  if (process.platform !== "darwin") return "unknown";
@@ -319,38 +161,6 @@ const desktopCalls = (window) => ({
319
161
  const untrustedSender = {
320
162
  error: { tag: "UntrustedSender", message: "RPC is only available to the HinaCode window" }
321
163
  };
322
- const WindowCall = Struct({ ...RpcCall.fields, environment: optional(String$1) });
323
- const decodeWindowCall = decodeUnknownOption(WindowCall);
324
- const payloadId = (payload, key) => {
325
- const id = typeof payload === "object" && payload !== null ? payload[key] : void 0;
326
- return typeof id === "string" ? id : void 0;
327
- };
328
- const inlineLocalAttachment = (method, payload) => method !== "attachments.stage" ? succeed(payload) : decodeUnknownEffect(RpcMethods[method].request)(payload).pipe(
329
- flatMap(
330
- (request) => "path" in request.source ? map(inlineSource(request.source.path), (source) => ({ ...request, source })) : succeed(request)
331
- )
332
- );
333
- const route = (raw, desktop) => gen(function* () {
334
- const decoded = getOrUndefined(decodeWindowCall(raw));
335
- if (decoded === void 0) return yield* dispatch(raw, desktop);
336
- const environments = yield* Environments;
337
- const { method, payload, environment } = decoded;
338
- const where = routes[method];
339
- const owned = where.to === "owner" ? payloadId(payload, where.key) : void 0;
340
- const target = where.to === "named" ? environment : where.to === "owner" && owned !== void 0 ? environments.owner(where.entity, owned) : void 0;
341
- if (target !== void 0) {
342
- return yield* inlineLocalAttachment(method, payload).pipe(
343
- flatMap((forwarded) => environments.forward(target, { method, payload: forwarded })),
344
- catch_((error) => succeed({ error: { tag: error._tag, message: error.message } }))
345
- );
346
- }
347
- if (where.to !== "all") return yield* dispatch(raw, desktop);
348
- const [local, clouds] = yield* all$1([dispatch(raw, desktop), environments.gather({ method, payload })], {
349
- concurrency: "unbounded"
350
- });
351
- if ("error" in local || !Array.isArray(local.result)) return local;
352
- return { result: [...local.result, ...clouds] };
353
- });
354
164
  const registerIpc = (runtime, appUrl2) => {
355
165
  ipcMain.handle(
356
166
  RPC_CHANNEL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hinacode",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "0.2.0-alpha.1",
4
4
  "description": "Run coding agents on this machine and drive them from the HinaCode desktop or phone app",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -43,13 +43,14 @@
43
43
  "@fontsource-variable/geist": "^5.3.0",
44
44
  "@linear/sdk": "97.1.0",
45
45
  "@modelcontextprotocol/sdk": "1.32.1",
46
- "@muse-code/sdk": "1.4.7",
46
+ "@muse-code/sdk": "1.4.13",
47
47
  "@noble/hashes": "2.4.0",
48
48
  "anser": "2.3.5",
49
49
  "effect": "4.0.3",
50
50
  "electron-updater": "6.8.9",
51
51
  "node-pty": "1.2.0-beta.15",
52
52
  "pele": "1.9.0",
53
+ "playwright": "1.64.0",
53
54
  "qrcode": "^1.5.4",
54
55
  "ws": "8.22.0"
55
56
  },
@@ -84,6 +85,7 @@
84
85
  "@wterm/dom": "0.5.4",
85
86
  "@wterm/ghostty": "0.5.4",
86
87
  "babel-plugin-react-compiler": "1.0.0",
88
+ "chrono-node": "2.10.3",
87
89
  "class-variance-authority": "^0.7.1",
88
90
  "cn": "^0.4.0",
89
91
  "electron": "44.9.3",
@@ -94,6 +96,7 @@
94
96
  "node-gyp": "12.2.0",
95
97
  "oxfmt": "0.72.0",
96
98
  "oxlint": "1.87.0",
99
+ "oxlint-plugin-hinacode": "workspace:*",
97
100
  "oxlint-plugin-react-doctor": "0.9.17",
98
101
  "playwright-bdd": "9.2.1",
99
102
  "react": "19.3.0",