@prover-coder-ai/docker-git 1.0.9 → 1.0.10
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.release.bak +4 -4
- package/CHANGELOG.md +6 -0
- package/dist/main.js +57 -32
- package/dist/main.js.map +1 -1
- package/dist/src/docker-git/cli/parser-options.js +6 -0
- package/dist/src/docker-git/cli/parser-scrap.js +74 -0
- package/dist/src/docker-git/cli/parser.js +4 -1
- package/dist/src/docker-git/cli/usage.js +5 -0
- package/dist/src/docker-git/program.js +5 -2
- package/package.json +4 -4
- package/src/docker-git/cli/parser-options.ts +8 -0
- package/src/docker-git/cli/parser-scrap.ts +106 -0
- package/src/docker-git/cli/parser.ts +25 -22
- package/src/docker-git/cli/usage.ts +5 -0
- package/src/docker-git/program.ts +28 -21
- package/tests/docker-git/parser.test.ts +48 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prover-coder-ai/docker-git",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Minimal Vite-powered TypeScript console starter using Effect",
|
|
5
5
|
"main": "dist/src/docker-git/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"build:app": "vite build --ssr src/app/main.ts",
|
|
16
16
|
"dev": "vite build --watch --ssr src/app/main.ts",
|
|
17
17
|
"prelint": "pnpm -C ../lib build",
|
|
18
|
-
"lint": "
|
|
19
|
-
"lint:tests": "
|
|
20
|
-
"lint:effect": "
|
|
18
|
+
"lint": "PATH=../../scripts:$PATH vibecode-linter src/",
|
|
19
|
+
"lint:tests": "PATH=../../scripts:$PATH vibecode-linter tests/",
|
|
20
|
+
"lint:effect": "PATH=../../scripts:$PATH eslint --config eslint.effect-ts-check.config.mjs .",
|
|
21
21
|
"prebuild:docker-git": "pnpm -C ../lib build",
|
|
22
22
|
"build:docker-git": "tsc -p tsconfig.build.json",
|
|
23
23
|
"check": "pnpm run typecheck",
|
package/CHANGELOG.md
CHANGED
package/dist/main.js
CHANGED
|
@@ -182,6 +182,14 @@ class CommandFailedError extends Data.TaggedError("CommandFailedError") {
|
|
|
182
182
|
}
|
|
183
183
|
class AuthError extends Data.TaggedError("AuthError") {
|
|
184
184
|
}
|
|
185
|
+
class ScrapArchiveNotFoundError extends Data.TaggedError("ScrapArchiveNotFoundError") {
|
|
186
|
+
}
|
|
187
|
+
class ScrapArchiveInvalidError extends Data.TaggedError("ScrapArchiveInvalidError") {
|
|
188
|
+
}
|
|
189
|
+
class ScrapTargetDirUnsupportedError extends Data.TaggedError("ScrapTargetDirUnsupportedError") {
|
|
190
|
+
}
|
|
191
|
+
class ScrapWipeRefusedError extends Data.TaggedError("ScrapWipeRefusedError") {
|
|
192
|
+
}
|
|
185
193
|
const successExitCode$1 = Number(ExitCode(0));
|
|
186
194
|
const readCloneRequest = Effect.sync(() => resolveCloneRequest(process.argv.slice(2), process.env["npm_lifecycle_event"]));
|
|
187
195
|
const runDockerGitClone = (args) => Effect.gen(function* (_) {
|
|
@@ -606,38 +614,24 @@ Effect.gen(function* (_) {
|
|
|
606
614
|
}).pipe(Effect.asVoid);
|
|
607
615
|
const isParseError = (error) => error._tag === "UnknownCommand" || error._tag === "UnknownOption" || error._tag === "MissingOptionValue" || error._tag === "MissingRequiredOption" || error._tag === "InvalidOption" || error._tag === "UnexpectedArgument";
|
|
608
616
|
const renderDockerAccessHeadline = (issue) => issue === "PermissionDenied" ? "Cannot access Docker daemon socket: permission denied." : "Cannot connect to Docker daemon.";
|
|
609
|
-
const renderPrimaryError = (error) => {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
if (error._tag === "CloneFailedError") {
|
|
628
|
-
return `Clone failed for ${error.repoUrl} (${error.repoRef}) into ${error.targetDir}`;
|
|
629
|
-
}
|
|
630
|
-
if (error._tag === "PortProbeError") {
|
|
631
|
-
return `SSH port check failed for ${error.port}: ${error.message}`;
|
|
632
|
-
}
|
|
633
|
-
if (error._tag === "CommandFailedError") {
|
|
634
|
-
return `${error.command} failed with exit code ${error.exitCode}`;
|
|
635
|
-
}
|
|
636
|
-
if (error._tag === "AuthError") {
|
|
637
|
-
return error.message;
|
|
638
|
-
}
|
|
639
|
-
return null;
|
|
640
|
-
};
|
|
617
|
+
const renderPrimaryError = (error) => Match.value(error).pipe(Match.when({ _tag: "FileExistsError" }, ({ path }) => `File already exists: ${path} (use --force to overwrite)`), Match.when({ _tag: "DockerCommandError" }, ({ exitCode }) => [
|
|
618
|
+
`docker compose failed with exit code ${exitCode}`,
|
|
619
|
+
"Hint: ensure Docker daemon is running and current user can access /var/run/docker.sock (for example via the docker group)."
|
|
620
|
+
].join("\n")), Match.when({ _tag: "DockerAccessError" }, ({ details, issue }) => [
|
|
621
|
+
renderDockerAccessHeadline(issue),
|
|
622
|
+
"Hint: ensure Docker daemon is running and current user can access the docker socket.",
|
|
623
|
+
"Hint: if you use rootless Docker, set DOCKER_HOST to your user socket (for example unix:///run/user/$UID/docker.sock).",
|
|
624
|
+
`Details: ${details}`
|
|
625
|
+
].join("\n")), Match.when({ _tag: "CloneFailedError" }, ({ repoRef, repoUrl, targetDir }) => `Clone failed for ${repoUrl} (${repoRef}) into ${targetDir}`), Match.when({ _tag: "PortProbeError" }, ({ message, port }) => `SSH port check failed for ${port}: ${message}`), Match.when({ _tag: "CommandFailedError" }, ({ command, exitCode }) => `${command} failed with exit code ${exitCode}`), Match.when({ _tag: "ScrapArchiveNotFoundError" }, ({ path }) => `Scrap archive not found: ${path} (run docker-git scrap export first)`), Match.when({ _tag: "ScrapArchiveInvalidError" }, ({ message, path }) => `Invalid scrap archive: ${path}
|
|
626
|
+
Details: ${message}`), Match.when({ _tag: "ScrapTargetDirUnsupportedError" }, ({ reason, sshUser, targetDir }) => [
|
|
627
|
+
`Cannot use scrap with targetDir ${targetDir}.`,
|
|
628
|
+
`Reason: ${reason}`,
|
|
629
|
+
`Hint: scrap currently supports workspaces under /home/${sshUser}/... only.`
|
|
630
|
+
].join("\n")), Match.when({ _tag: "ScrapWipeRefusedError" }, ({ reason, targetDir }) => [
|
|
631
|
+
`Refusing to wipe workspace for scrap import (targetDir ${targetDir}).`,
|
|
632
|
+
`Reason: ${reason}`,
|
|
633
|
+
"Hint: re-run with --no-wipe, or set a narrower --target-dir when creating the project."
|
|
634
|
+
].join("\n")), Match.when({ _tag: "AuthError" }, ({ message }) => message), Match.orElse(() => null));
|
|
641
635
|
const renderConfigError = (error) => {
|
|
642
636
|
if (error._tag === "ConfigNotFoundError") {
|
|
643
637
|
return `docker-git.json not found: ${error.path} (run docker-git create in that directory)`;
|
|
@@ -824,6 +818,37 @@ Effect.asVoid(withProjectIndexAndSsh((index, sshKey) => forEachProjectStatus(ind
|
|
|
824
818
|
onSuccess: () => Effect.void
|
|
825
819
|
})))))));
|
|
826
820
|
Duration.seconds(1);
|
|
821
|
+
const ChunkManifestSchema = Schema.Struct({
|
|
822
|
+
original: Schema.String,
|
|
823
|
+
originalSize: Schema.Number,
|
|
824
|
+
parts: Schema.Array(Schema.String),
|
|
825
|
+
splitAt: Schema.Number,
|
|
826
|
+
partsCount: Schema.Number,
|
|
827
|
+
createdAt: Schema.String
|
|
828
|
+
});
|
|
829
|
+
Schema.parseJson(ChunkManifestSchema);
|
|
830
|
+
const SessionManifestSchema = Schema.Struct({
|
|
831
|
+
schemaVersion: Schema.Literal(1),
|
|
832
|
+
mode: Schema.Literal("session"),
|
|
833
|
+
snapshotId: Schema.String,
|
|
834
|
+
createdAtUtc: Schema.String,
|
|
835
|
+
repo: Schema.Struct({
|
|
836
|
+
originUrl: Schema.String,
|
|
837
|
+
head: Schema.String,
|
|
838
|
+
branch: Schema.String
|
|
839
|
+
}),
|
|
840
|
+
artifacts: Schema.Struct({
|
|
841
|
+
worktreePatchChunks: Schema.String,
|
|
842
|
+
codexChunks: Schema.String,
|
|
843
|
+
codexSharedChunks: Schema.String,
|
|
844
|
+
envGlobalFile: Schema.optionalWith(Schema.Union(Schema.String, Schema.Null), { default: () => null }),
|
|
845
|
+
envProjectFile: Schema.optionalWith(Schema.Union(Schema.String, Schema.Null), { default: () => null })
|
|
846
|
+
}),
|
|
847
|
+
rebuild: Schema.optionalWith(Schema.Struct({
|
|
848
|
+
commands: Schema.Array(Schema.String)
|
|
849
|
+
}), { default: () => ({ commands: [] }) })
|
|
850
|
+
});
|
|
851
|
+
Schema.parseJson(SessionManifestSchema);
|
|
827
852
|
const usageText = [
|
|
828
853
|
"Usage:",
|
|
829
854
|
" pnpm docker-git",
|