@lore-co/cli 0.1.30 → 0.2.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.
- package/README.md +35 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +6 -24
- package/dist/agents.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +38 -38
- package/dist/cli.js.map +1 -1
- package/dist/codex-hook-approval.d.ts.map +1 -1
- package/dist/codex-hook-approval.js +5 -4
- package/dist/codex-hook-approval.js.map +1 -1
- package/dist/demo.d.ts.map +1 -1
- package/dist/demo.js +3 -2
- package/dist/demo.js.map +1 -1
- package/dist/devin-cli.d.ts +1 -1
- package/dist/devin-cli.d.ts.map +1 -1
- package/dist/devin-cli.js +17 -9
- package/dist/devin-cli.js.map +1 -1
- package/dist/devin-client.d.ts +1 -1
- package/dist/generated-assets.d.ts +5 -5
- package/dist/generated-assets.d.ts.map +1 -1
- package/dist/generated-assets.js +5 -5
- package/dist/generated-assets.js.map +1 -1
- package/dist/github.js +1 -1
- package/dist/github.js.map +1 -1
- package/dist/handoff.d.ts.map +1 -1
- package/dist/handoff.js +2 -1
- package/dist/handoff.js.map +1 -1
- package/dist/invocation-health-writer.d.ts.map +1 -1
- package/dist/invocation-health-writer.js +14 -4
- package/dist/invocation-health-writer.js.map +1 -1
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +74 -11
- package/dist/live.js.map +1 -1
- package/dist/platform.d.ts +21 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +102 -0
- package/dist/platform.js.map +1 -0
- package/dist/pty.d.ts.map +1 -1
- package/dist/pty.js +3 -0
- package/dist/pty.js.map +1 -1
- package/dist/recovery-cloud.d.ts.map +1 -1
- package/dist/recovery-cloud.js +4 -1
- package/dist/recovery-cloud.js.map +1 -1
- package/dist/recovery-codex.js +1 -1
- package/dist/recovery-codex.js.map +1 -1
- package/dist/recovery-desktop.d.ts.map +1 -1
- package/dist/recovery-desktop.js +3 -0
- package/dist/recovery-desktop.js.map +1 -1
- package/dist/recovery-hooks.d.ts.map +1 -1
- package/dist/recovery-hooks.js +12 -5
- package/dist/recovery-hooks.js.map +1 -1
- package/dist/recovery-hosts.d.ts.map +1 -1
- package/dist/recovery-hosts.js +10 -5
- package/dist/recovery-hosts.js.map +1 -1
- package/dist/recovery-polytoken.js +1 -1
- package/dist/recovery-polytoken.js.map +1 -1
- package/dist/recovery-remote.js +1 -1
- package/dist/recovery-remote.js.map +1 -1
- package/dist/recovery-transfer.d.ts.map +1 -1
- package/dist/recovery-transfer.js +8 -1
- package/dist/recovery-transfer.js.map +1 -1
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +12 -11
- package/dist/recovery.js.map +1 -1
- package/dist/reliability-store.d.ts.map +1 -1
- package/dist/reliability-store.js +20 -4
- package/dist/reliability-store.js.map +1 -1
- package/dist/self-host.d.ts +1 -1
- package/dist/self-host.d.ts.map +1 -1
- package/dist/self-host.js +3 -3
- package/dist/self-host.js.map +1 -1
- package/dist/uninstall.d.ts.map +1 -1
- package/dist/uninstall.js +22 -10
- package/dist/uninstall.js.map +1 -1
- package/dist/update.d.ts +1 -1
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +43 -11
- package/dist/update.js.map +1 -1
- package/dist/windows-permissions.d.ts +4 -0
- package/dist/windows-permissions.d.ts.map +1 -0
- package/dist/windows-permissions.js +45 -0
- package/dist/windows-permissions.js.map +1 -0
- package/dist/windows-pty.d.ts +3 -0
- package/dist/windows-pty.d.ts.map +1 -0
- package/dist/windows-pty.js +160 -0
- package/dist/windows-pty.js.map +1 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -25,6 +25,37 @@ lore doctor
|
|
|
25
25
|
|
|
26
26
|
The package requires Node.js 22 or newer and installs the `lore` command.
|
|
27
27
|
|
|
28
|
+
### Windows
|
|
29
|
+
|
|
30
|
+
Native Windows support is available in Lore 0.2.0 and newer.
|
|
31
|
+
Use PowerShell on 64-bit Windows 10 (1809 or newer) or Windows 11. Git and
|
|
32
|
+
the coding agents you want to connect must be installed on Windows too.
|
|
33
|
+
The npm package uses the same commands as macOS and Linux:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
npm.cmd install --global @lore-co/cli
|
|
37
|
+
lore.cmd connect --login --agent claude --agent codex
|
|
38
|
+
lore.cmd doctor
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For a standalone installation:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
irm https://uselore.co/install.ps1 | iex
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
It verifies the release checksum and installs `lore.exe` in
|
|
48
|
+
`%LOCALAPPDATA%\Lore\bin`, then adds that directory to your user PATH.
|
|
49
|
+
No administrator access or WSL is needed. `lore update` and `lore uninstall`
|
|
50
|
+
also work with this installation.
|
|
51
|
+
|
|
52
|
+
Windows hooks use PowerShell. Lore protects local credentials and recordings
|
|
53
|
+
with Windows access permissions. Automatic recovery adds Lore-owned functions
|
|
54
|
+
to your PowerShell profiles; open a new terminal after connecting. If your
|
|
55
|
+
organization blocks profile scripts, use `lore run <agent> --` explicitly.
|
|
56
|
+
Live sessions use Windows' ConPTY terminal support. Each agent's own platform
|
|
57
|
+
requirements, permissions, and hook approval still apply.
|
|
58
|
+
|
|
28
59
|
## Find the right command
|
|
29
60
|
|
|
30
61
|
Run `lore help` for the command list, `lore help <command>` for its use case,
|
|
@@ -56,7 +87,8 @@ guarantee lifecycle hooks in ACP mode. Lore does not install a duplicate T3
|
|
|
56
87
|
lifecycle layer. `--agent cowork` is credential-only: it prepares the secure
|
|
57
88
|
CLI config consumed by the separately uploaded Cowork MCP plugin without
|
|
58
89
|
installing lifecycle hooks.
|
|
59
|
-
Configuration is stored in `~/.lore/config.json` with mode `0600
|
|
90
|
+
Configuration is stored in `~/.lore/config.json` with mode `0600` on macOS and
|
|
91
|
+
Linux, or a private Windows ACL.
|
|
60
92
|
`--login` opens a 10-minute dashboard approval and mints an attributed,
|
|
61
93
|
revocable 90-day credential without exposing it in terminal or agent output.
|
|
62
94
|
If the final login response is interrupted, the CLI retries within that window
|
|
@@ -192,7 +224,7 @@ content-free `guard_check` audit event.
|
|
|
192
224
|
|
|
193
225
|
```sh
|
|
194
226
|
lore update
|
|
195
|
-
lore update --version v0.
|
|
227
|
+
lore update --version v0.2.0
|
|
196
228
|
```
|
|
197
229
|
|
|
198
230
|
`update` resolves the latest release to an exact tag, or uses the exact
|
|
@@ -527,7 +559,7 @@ same-repository, non-draft pull requests bearing the corresponding
|
|
|
527
559
|
`lore:codex-review` or `lore:devin-review` label.
|
|
528
560
|
|
|
529
561
|
Generated jobs require a published standalone binary release and default to
|
|
530
|
-
`treadiehq/lore-releases` at `v0.
|
|
562
|
+
`treadiehq/lore-releases` at `v0.2.0`. Set `LORE_CLI_REPOSITORY` to the publicly
|
|
531
563
|
readable `owner/repository` and `LORE_CLI_VERSION` to an existing release tag
|
|
532
564
|
when using another release source.
|
|
533
565
|
|
package/dist/agents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,yFAA0F,CAAC;AACzH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AACjE,eAAO,MAAM,gBAAgB,yFAAoB,CAAC;AAClD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/D,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,eAAe,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAQpH,CAAC;AACF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,eAA2E,CAAC;AAClI,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,cAAyE,CAAC;AAEpI,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAM/E;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,oBAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAMpG;AAED,6FAA6F;AAC7F,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,oBAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAOrG;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAmCrI"}
|
package/dist/agents.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { access, realpath, stat } from "node:fs/promises";
|
|
3
|
-
import { delimiter, resolve } from "node:path";
|
|
1
|
+
import { findExecutable } from "./platform.js";
|
|
4
2
|
/** Local terminal clients. Cloud and desktop surfaces need different transports. */
|
|
5
3
|
export const LAUNCHABLE_AGENTS = ["claude", "codex", "opencode", "devin", "cursor", "copilot-cli", "polytoken"];
|
|
6
4
|
export const RECOVERY_SOURCES = LAUNCHABLE_AGENTS;
|
|
@@ -28,17 +26,9 @@ export function launchArguments(agent, brief) {
|
|
|
28
26
|
}
|
|
29
27
|
export async function findAgentExecutable(agent, env = process.env) {
|
|
30
28
|
for (const command of AGENTS[agent].commands) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const path = resolve(directory, command);
|
|
35
|
-
try {
|
|
36
|
-
await access(path, constants.X_OK);
|
|
37
|
-
if ((await stat(path)).isFile())
|
|
38
|
-
return await realpath(path);
|
|
39
|
-
}
|
|
40
|
-
catch { /* next PATH entry */ }
|
|
41
|
-
}
|
|
29
|
+
const executable = await findExecutable(command, env);
|
|
30
|
+
if (executable)
|
|
31
|
+
return executable;
|
|
42
32
|
}
|
|
43
33
|
throw new Error(`${AGENTS[agent].label} is not installed or is not on PATH (expected ${AGENTS[agent].commands.join(" or ")}).`);
|
|
44
34
|
}
|
|
@@ -47,16 +37,8 @@ export async function agentShellCommands(agent, env = process.env) {
|
|
|
47
37
|
const executable = await findAgentExecutable(agent, env);
|
|
48
38
|
const names = [];
|
|
49
39
|
for (const name of AGENTS[agent].commands) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const path = resolve(directory, name);
|
|
53
|
-
await access(path, constants.X_OK);
|
|
54
|
-
if (await realpath(path) === executable)
|
|
55
|
-
names.push(name);
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
catch { /* Next PATH entry. */ }
|
|
59
|
-
}
|
|
40
|
+
if (await findExecutable(name, env) === executable)
|
|
41
|
+
names.push(name);
|
|
60
42
|
}
|
|
61
43
|
return names;
|
|
62
44
|
}
|
package/dist/agents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,oFAAoF;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAU,CAAC;AAEzH,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAElD,MAAM,CAA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I,EAAE,MAAM,CAAC;QACzF,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC;QACxF,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;KACrF,CAAC;IACF,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1D,0EAA0E;IAC1E,uEAAuE;IACvE,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;QAC7I,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;YACrB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,OAAO,KAAK,CAAC;YACvC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,CAAC,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA2BA,OAAO,EAw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EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,yBAAyB,CAAC;IACpC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,aAAa,CAAC,CAiKxB;AA0ND,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAKvE;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AA4aD,wBAAsB,sBAAsB,CAAC,KAAK,GAAE,SAA0B,EAAE,oBAAoB,UAAQ,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,KAAK,CAAC;IAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA6D1L;AAqVD,wBAAsB,MAAM,CAC1B,IAAI,GAAE,SAAS,MAAM,EAA0B,GAC9C,OAAO,CAAC,IAAI,CAAC,CAyLf"}
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { secureWindowsDirectory, windowsPermissionsArePrivate } from "./windows-permissions.js";
|
|
2
3
|
import { COMMAND_GUIDES, ROOT_HELP, helpTopic } from "./command-help.js";
|
|
3
4
|
import { runShareCommand } from "./share.js";
|
|
4
5
|
import { codexApprovalDetail, inspectCodexHookApproval } from "./codex-hook-approval.js";
|
|
5
6
|
import { claudeOnlyCommand, disableDevinCli, runDevinCliHook } from "./devin-cli.js";
|
|
6
7
|
import { access, chmod, copyFile, mkdir, open, readFile, readdir, rename, rm, stat, writeFile, } from "node:fs/promises";
|
|
7
8
|
import { constants as fsConstants, realpathSync } from "node:fs";
|
|
8
|
-
import { spawn } from "
|
|
9
|
+
import { spawn, isWindows, windowsCommand, commandText, findExecutable, openBrowser } from "./platform.js";
|
|
9
10
|
import { createHash, randomUUID } from "node:crypto";
|
|
10
|
-
import {
|
|
11
|
+
import { dirname, resolve } from "node:path";
|
|
11
12
|
import { homedir, hostname, platform } from "node:os";
|
|
12
13
|
import { setTimeout as delay } from "node:timers/promises";
|
|
13
14
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -146,7 +147,7 @@ function cloneObject(value) {
|
|
|
146
147
|
return structuredClone(value);
|
|
147
148
|
}
|
|
148
149
|
export function getLorePaths(home, environment = process.env, cwd = process.cwd()) {
|
|
149
|
-
const resolvedHome = resolve(home ?? environment.HOME ?? homedir());
|
|
150
|
+
const resolvedHome = resolve(home ?? environment.HOME ?? environment.USERPROFILE ?? homedir());
|
|
150
151
|
const loreDirectory = resolve(resolvedHome, ".lore");
|
|
151
152
|
const xdgConfigHome = environment.XDG_CONFIG_HOME?.trim() === undefined ||
|
|
152
153
|
environment.XDG_CONFIG_HOME.trim() === ""
|
|
@@ -178,7 +179,8 @@ export function getLorePaths(home, environment = process.env, cwd = process.cwd(
|
|
|
178
179
|
cursorMcp: resolve(resolvedHome, ".cursor", "mcp.json"),
|
|
179
180
|
cursorUserData: platform() === "darwin"
|
|
180
181
|
? resolve(resolvedHome, "Library", "Application Support", "Cursor")
|
|
181
|
-
: resolve(resolvedHome, "
|
|
182
|
+
: isWindows() ? resolve(environment.APPDATA || resolve(resolvedHome, "AppData", "Roaming"), "Cursor")
|
|
183
|
+
: resolve(resolvedHome, ".config", "Cursor"),
|
|
182
184
|
openCodeConfig: resolve(resolvedHome, ".config", "opencode", "opencode.json"),
|
|
183
185
|
polytokenHooks: resolve(xdgConfigHome, "polytoken", "hooks.json"),
|
|
184
186
|
t3Settings: resolve(t3Home, "userdata", "settings.json"),
|
|
@@ -197,6 +199,14 @@ function isConnectAgent(value) {
|
|
|
197
199
|
value === "t3code");
|
|
198
200
|
}
|
|
199
201
|
function hookCommand(agent, paths, event) {
|
|
202
|
+
if (isWindows()) {
|
|
203
|
+
const invocation = IS_STANDALONE_BINARY ? [process.execPath, "hook"] : [process.execPath, paths.runtime];
|
|
204
|
+
const command = windowsCommand([...invocation, "--agent", agent, "--owner", "lore"], {
|
|
205
|
+
LORE_HOME: paths.home, ...(event === undefined ? {} : { LORE_HOOK_EVENT: event }),
|
|
206
|
+
...(IS_STANDALONE_BINARY ? { BUN_OPTIONS: undefined, BUN_BE_BUN: undefined } : {}),
|
|
207
|
+
});
|
|
208
|
+
return agent === "claude" ? claudeOnlyCommand(command) : command;
|
|
209
|
+
}
|
|
200
210
|
const loreHome = `LORE_HOME=${shellQuote(paths.home)}`;
|
|
201
211
|
const hookEvent = event === undefined ? "" : ` LORE_HOOK_EVENT=${shellQuote(event)}`;
|
|
202
212
|
if (IS_STANDALONE_BINARY) {
|
|
@@ -210,7 +220,7 @@ function isLoreHook(value) {
|
|
|
210
220
|
if (!isObject(value) || value.type !== "command") {
|
|
211
221
|
return false;
|
|
212
222
|
}
|
|
213
|
-
const command = value.command;
|
|
223
|
+
const command = commandText(value.command);
|
|
214
224
|
return (typeof command === "string" &&
|
|
215
225
|
(/(?:^|\s)--owner(?:=|\s+)lore(?:\s|$)/u.test(command) ||
|
|
216
226
|
command.includes("/.lore/bin/lore-hook.mjs")));
|
|
@@ -425,7 +435,7 @@ export function countLoreCursorHooks(input) {
|
|
|
425
435
|
function copilotCliEventHandler(event, paths) {
|
|
426
436
|
return {
|
|
427
437
|
type: "command",
|
|
428
|
-
bash: hookCommand("copilot-cli", paths, event),
|
|
438
|
+
[isWindows() ? "powershell" : "bash"]: hookCommand("copilot-cli", paths, event),
|
|
429
439
|
timeoutSec: event === "sessionEnd"
|
|
430
440
|
? 2
|
|
431
441
|
: event === "agentStop"
|
|
@@ -439,11 +449,12 @@ function isLoreCopilotHook(value) {
|
|
|
439
449
|
if (!isObject(value) || value.type !== "command") {
|
|
440
450
|
return false;
|
|
441
451
|
}
|
|
442
|
-
const command = typeof value.
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
452
|
+
const command = commandText(typeof value.powershell === "string" ? value.powershell :
|
|
453
|
+
typeof value.bash === "string"
|
|
454
|
+
? value.bash
|
|
455
|
+
: typeof value.command === "string"
|
|
456
|
+
? value.command
|
|
457
|
+
: "");
|
|
447
458
|
return (/(?:^|\s)--owner(?:=|\s+)lore(?:\s|$)/u.test(command) ||
|
|
448
459
|
command.includes("/.lore/bin/lore-hook.mjs"));
|
|
449
460
|
}
|
|
@@ -596,7 +607,7 @@ function isLorePolytokenHook(value) {
|
|
|
596
607
|
if (!isObject(value) || !isObject(value.handler)) {
|
|
597
608
|
return false;
|
|
598
609
|
}
|
|
599
|
-
const command = value.handler.bash;
|
|
610
|
+
const command = commandText(value.handler.bash);
|
|
600
611
|
return (typeof command === "string" &&
|
|
601
612
|
(/(?:^|\s)--owner(?:=|\s+)lore(?:\s|$)/u.test(command) ||
|
|
602
613
|
command.includes("/.lore/bin/lore-hook.mjs")));
|
|
@@ -1069,16 +1080,7 @@ async function isExecutable(path) {
|
|
|
1069
1080
|
}
|
|
1070
1081
|
}
|
|
1071
1082
|
async function commandExists(command) {
|
|
1072
|
-
|
|
1073
|
-
if (path === undefined) {
|
|
1074
|
-
return false;
|
|
1075
|
-
}
|
|
1076
|
-
for (const directory of path.split(delimiter)) {
|
|
1077
|
-
if (directory !== "" && (await isExecutable(resolve(directory, command)))) {
|
|
1078
|
-
return true;
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
return false;
|
|
1083
|
+
return await findExecutable(command) !== null;
|
|
1082
1084
|
}
|
|
1083
1085
|
async function pathExists(path) {
|
|
1084
1086
|
try {
|
|
@@ -1390,6 +1392,7 @@ async function installRuntime(paths) {
|
|
|
1390
1392
|
rm(paths.runtime, { force: true }),
|
|
1391
1393
|
rm(paths.runtimeRepository, { force: true }),
|
|
1392
1394
|
rm(paths.runtimeReliabilityStore, { force: true }),
|
|
1395
|
+
rm(resolve(dirname(paths.runtime), "windows-permissions.js"), { force: true }),
|
|
1393
1396
|
rm(paths.runtimeSignedSnapshot, { force: true }),
|
|
1394
1397
|
rm(paths.runtimeCanonicalJson, { force: true }),
|
|
1395
1398
|
rm(resolve(dirname(paths.runtime), "guard-evaluation.js"), { force: true }),
|
|
@@ -1428,6 +1431,7 @@ async function installRuntime(paths) {
|
|
|
1428
1431
|
"image-capture.js": imageCapture,
|
|
1429
1432
|
"repository.js": repository,
|
|
1430
1433
|
"reliability-store.js": reliabilityStore,
|
|
1434
|
+
"windows-permissions.js": await readFile(resolve(sourceDirectory, "windows-permissions.js"), "utf8"),
|
|
1431
1435
|
"signed-snapshot.js": standaloneSignedSnapshot,
|
|
1432
1436
|
"canonical-json.js": canonicalJson,
|
|
1433
1437
|
"context-fallback.js": contextFallback,
|
|
@@ -1450,6 +1454,7 @@ async function installRuntime(paths) {
|
|
|
1450
1454
|
atomicWrite(resolve(dirname(paths.runtime), "image-capture.js"), imageCapture, 0o600),
|
|
1451
1455
|
atomicWrite(paths.runtimeRepository, repository, 0o600),
|
|
1452
1456
|
atomicWrite(paths.runtimeReliabilityStore, reliabilityStore, 0o600),
|
|
1457
|
+
atomicWrite(resolve(dirname(paths.runtime), "windows-permissions.js"), runtimeFiles["windows-permissions.js"], 0o600),
|
|
1453
1458
|
atomicWrite(paths.runtimeSignedSnapshot, standaloneSignedSnapshot, 0o600),
|
|
1454
1459
|
atomicWrite(paths.runtimeCanonicalJson, canonicalJson, 0o600),
|
|
1455
1460
|
atomicWrite(paths.runtimeContextFallback, contextFallback, 0o600),
|
|
@@ -1585,8 +1590,8 @@ function writeResult(value, json, text) {
|
|
|
1585
1590
|
process.stdout.write(json ? `${JSON.stringify(value, null, 2)}\n` : text);
|
|
1586
1591
|
}
|
|
1587
1592
|
export async function connectWithCredential(options) {
|
|
1588
|
-
if (platform() !== "darwin" && platform() !== "linux") {
|
|
1589
|
-
throw new Error("Lore agent integrations
|
|
1593
|
+
if (platform() !== "darwin" && platform() !== "linux" && !isWindows()) {
|
|
1594
|
+
throw new Error("Lore agent integrations support macOS, Linux, and Windows");
|
|
1590
1595
|
}
|
|
1591
1596
|
const paths = getLorePaths(options.home, options.home === undefined ? process.env : {}, options.cwd);
|
|
1592
1597
|
if (options.recovery === false && options.fallback)
|
|
@@ -1602,6 +1607,7 @@ export async function connectWithCredential(options) {
|
|
|
1602
1607
|
}
|
|
1603
1608
|
const timeoutMs = options.timeoutMs ?? existing?.timeoutMs ?? 2_500;
|
|
1604
1609
|
const identity = await authenticatedIdentity(apiUrl, token.trim(), timeoutMs);
|
|
1610
|
+
await secureWindowsDirectory(paths.loreDirectory);
|
|
1605
1611
|
const recoveryEnv = options.home === undefined ? process.env : { ...process.env, ZDOTDIR: paths.home };
|
|
1606
1612
|
let recoveryWarning;
|
|
1607
1613
|
const externalRecoveryHost = options.agents.some(agent => ["t3code", "cowork", "copilot-vscode"].includes(agent));
|
|
@@ -1760,15 +1766,7 @@ async function requestDeviceAuthorization(input) {
|
|
|
1760
1766
|
: new URL(`${serverApprovalUrl.pathname}${serverApprovalUrl.search}`, `${input.dashboardUrl}/`).toString();
|
|
1761
1767
|
process.stderr.write(`Approve Lore access with code ${authorization.data.userCode}:\n${approvalUrl}\n`);
|
|
1762
1768
|
if (input.openBrowser) {
|
|
1763
|
-
|
|
1764
|
-
const child = spawn(command, [approvalUrl], {
|
|
1765
|
-
detached: true,
|
|
1766
|
-
stdio: "ignore",
|
|
1767
|
-
});
|
|
1768
|
-
child.once("error", () => {
|
|
1769
|
-
// The printed URL remains the safe fallback.
|
|
1770
|
-
});
|
|
1771
|
-
child.unref();
|
|
1769
|
+
openBrowser(approvalUrl);
|
|
1772
1770
|
}
|
|
1773
1771
|
const expiresAt = Date.parse(authorization.data.expiresAt);
|
|
1774
1772
|
const intervalMs = authorization.data.intervalSeconds * 1_000;
|
|
@@ -1951,7 +1949,7 @@ async function readRuntimeFile(path, maxBytes, executable = false) {
|
|
|
1951
1949
|
const metadata = await handle.stat();
|
|
1952
1950
|
if (!metadata.isFile() ||
|
|
1953
1951
|
metadata.size > maxBytes ||
|
|
1954
|
-
(executable && (metadata.mode & 0o111) === 0)) {
|
|
1952
|
+
(executable && !isWindows() && (metadata.mode & 0o111) === 0)) {
|
|
1955
1953
|
throw new Error("Runtime file is unsafe or exceeds its size limit");
|
|
1956
1954
|
}
|
|
1957
1955
|
const buffer = Buffer.allocUnsafe(maxBytes + 1);
|
|
@@ -1992,6 +1990,7 @@ async function inspectRuntimeInstallation(required, paths) {
|
|
|
1992
1990
|
"image-capture.js": resolve(dirname(paths.runtime), "image-capture.js"),
|
|
1993
1991
|
"repository.js": paths.runtimeRepository,
|
|
1994
1992
|
"reliability-store.js": paths.runtimeReliabilityStore,
|
|
1993
|
+
"windows-permissions.js": resolve(dirname(paths.runtime), "windows-permissions.js"),
|
|
1995
1994
|
"signed-snapshot.js": paths.runtimeSignedSnapshot,
|
|
1996
1995
|
"canonical-json.js": paths.runtimeCanonicalJson,
|
|
1997
1996
|
"context-fallback.js": paths.runtimeContextFallback,
|
|
@@ -2175,7 +2174,8 @@ async function statusData(paths) {
|
|
|
2175
2174
|
const config = await readConnectorConfig(paths);
|
|
2176
2175
|
let configMode = null;
|
|
2177
2176
|
try {
|
|
2178
|
-
|
|
2177
|
+
const metadata = await stat(paths.config);
|
|
2178
|
+
configMode = isWindows() ? (await windowsPermissionsArePrivate(paths.config) ? "private-acl" : "unsafe-acl") : metadata.mode.toString(8).slice(-3);
|
|
2179
2179
|
}
|
|
2180
2180
|
catch {
|
|
2181
2181
|
// Missing configuration is represented as disconnected.
|
|
@@ -2388,7 +2388,7 @@ async function verifyConnectedInstallation() {
|
|
|
2388
2388
|
return false;
|
|
2389
2389
|
}
|
|
2390
2390
|
const status = await statusData(paths);
|
|
2391
|
-
if (status.configMode
|
|
2391
|
+
if (!(["600", "private-acl"].includes(status.configMode ?? "")) ||
|
|
2392
2392
|
status.agents.some((agent) => agent.configured && agent.installation.state !== "complete")) {
|
|
2393
2393
|
return false;
|
|
2394
2394
|
}
|
|
@@ -2405,7 +2405,7 @@ async function doctorCommand(args) {
|
|
|
2405
2405
|
const checks = [];
|
|
2406
2406
|
checks.push({
|
|
2407
2407
|
name: "platform",
|
|
2408
|
-
status: platform() === "darwin" || platform() === "linux" ? "ok" : "error",
|
|
2408
|
+
status: platform() === "darwin" || platform() === "linux" || isWindows() ? "ok" : "error",
|
|
2409
2409
|
detail: `${platform()} ${process.arch}`,
|
|
2410
2410
|
});
|
|
2411
2411
|
checks.push(IS_STANDALONE_BINARY
|
|
@@ -2426,7 +2426,7 @@ async function doctorCommand(args) {
|
|
|
2426
2426
|
});
|
|
2427
2427
|
checks.push({
|
|
2428
2428
|
name: "config-permissions",
|
|
2429
|
-
status: status.configMode
|
|
2429
|
+
status: ["600", "private-acl"].includes(status.configMode ?? "") ? "ok" : "error",
|
|
2430
2430
|
detail: status.configMode ?? "missing",
|
|
2431
2431
|
});
|
|
2432
2432
|
if (status.runtimeRequired) {
|