longtable 0.1.54 → 0.1.56
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/package.json +1 -1
- package/src/bridge.mjs +26 -0
- package/src/client-rules.mjs +1 -1
- package/src/context.mjs +208 -0
- package/src/copy-guard.mjs +71 -0
- package/src/extras.mjs +7 -5
- package/src/local.mjs +30 -3
- package/src/pointed.mjs +11 -12
- package/src/prompts.mjs +365 -0
- package/src/repo.mjs +1 -1
- package/src/run.mjs +62 -674
- package/src/signin.mjs +3 -0
- package/src/store.mjs +5 -0
- package/src/typecheck.mjs +3 -3
package/src/signin.mjs
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
import http from "node:http";
|
|
9
9
|
import { randomBytes } from "node:crypto";
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
11
|
+
// The package's only two dependencies, used only here, at connect (bin/longtable.mjs loads this file then): they come
|
|
12
|
+
// with the npx run that connects. The copy that keeps itself up to date (update.mjs) carries no node_modules, so
|
|
13
|
+
// nothing that runs after connecting may import a package; the terminal fetches its own (pty.mjs).
|
|
11
14
|
import pty from "@lydell/node-pty";
|
|
12
15
|
import headless from "@xterm/headless";
|
|
13
16
|
import { childEnv, tokenWorks } from "./claude.mjs";
|
package/src/store.mjs
CHANGED
|
@@ -127,3 +127,8 @@ if (existsSync(oldClaudeToken) && !existsSync(defaultClaudeToken)) {
|
|
|
127
127
|
mkdirSync(join(defaultHome, "secrets"), { recursive: true });
|
|
128
128
|
renameSync(oldClaudeToken, defaultClaudeToken);
|
|
129
129
|
}
|
|
130
|
+
|
|
131
|
+
// A tripwire: something that should never happen, written to this computer's log in one fixed sentence (never a
|
|
132
|
+
// path, a name or anything from a file) and nothing more. It never stops or changes the job. sweep-notes/rules.md
|
|
133
|
+
// lists each one.
|
|
134
|
+
export function trip(what) { try { log(`tripwire: ${what}`); } catch {} }
|
package/src/typecheck.mjs
CHANGED
|
@@ -9,10 +9,9 @@
|
|
|
9
9
|
import { execFile, execFileSync } from "node:child_process";
|
|
10
10
|
import { copyFileSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, rmSync, rmdirSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { dirname, join } from "node:path";
|
|
12
|
+
import { isSecretName } from "./pointed.mjs";
|
|
12
13
|
|
|
13
14
|
const win = process.platform === "win32";
|
|
14
|
-
// Never linked or copied into a working folder, whatever git ignores.
|
|
15
|
-
const SECRET = /(^|\/)(\.env[^/]*|.*\.(pem|key|p12|pfx)|id_[a-z0-9]+|\.npmrc|\.netrc|credentials[^/]*)(\/|$)/i;
|
|
16
15
|
|
|
17
16
|
export function tscOf(folder) {
|
|
18
17
|
const tsc = folder ? join(folder, "node_modules", "typescript", "bin", "tsc") : null;
|
|
@@ -34,7 +33,8 @@ export function mirrorIgnored(dir, folder) {
|
|
|
34
33
|
for (const raw of list) {
|
|
35
34
|
const isDir = raw.endsWith("/");
|
|
36
35
|
const p = raw.replace(/\/$/, "");
|
|
37
|
-
|
|
36
|
+
// Never a key or sign-in file, whatever git ignores.
|
|
37
|
+
if (!p || p.startsWith("..") || p.split("/").some(isSecretName) || p.split("/").includes(".git")) continue;
|
|
38
38
|
const at = join(dir, ...p.split("/"));
|
|
39
39
|
if (existsSync(at) || !existsSync(dirname(at))) continue;
|
|
40
40
|
try {
|