@prover-coder-ai/docker-git 1.0.8 → 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 +12 -0
- package/dist/main.js +61 -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
|
@@ -131,6 +131,7 @@ const deriveRepoPathParts = (repoUrl) => {
|
|
|
131
131
|
return { ownerParts, repo, pathParts };
|
|
132
132
|
};
|
|
133
133
|
const defaultTemplateConfig = {
|
|
134
|
+
dockerGitPath: "./.docker-git",
|
|
134
135
|
envGlobalPath: "./.docker-git/.orch/env/global.env",
|
|
135
136
|
envProjectPath: "./.orch/env/project.env",
|
|
136
137
|
codexSharedAuthPath: "./.docker-git/.orch/auth/codex",
|
|
@@ -181,6 +182,14 @@ class CommandFailedError extends Data.TaggedError("CommandFailedError") {
|
|
|
181
182
|
}
|
|
182
183
|
class AuthError extends Data.TaggedError("AuthError") {
|
|
183
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
|
+
}
|
|
184
193
|
const successExitCode$1 = Number(ExitCode(0));
|
|
185
194
|
const readCloneRequest = Effect.sync(() => resolveCloneRequest(process.argv.slice(2), process.env["npm_lifecycle_event"]));
|
|
186
195
|
const runDockerGitClone = (args) => Effect.gen(function* (_) {
|
|
@@ -208,6 +217,9 @@ const TemplateConfigSchema = Schema.Struct({
|
|
|
208
217
|
repoRef: Schema.String,
|
|
209
218
|
targetDir: Schema.String,
|
|
210
219
|
volumeName: Schema.String,
|
|
220
|
+
dockerGitPath: Schema.optionalWith(Schema.String, {
|
|
221
|
+
default: () => defaultTemplateConfig.dockerGitPath
|
|
222
|
+
}),
|
|
211
223
|
authorizedKeysPath: Schema.String,
|
|
212
224
|
envGlobalPath: Schema.optionalWith(Schema.String, {
|
|
213
225
|
default: () => defaultTemplateConfig.envGlobalPath
|
|
@@ -602,38 +614,24 @@ Effect.gen(function* (_) {
|
|
|
602
614
|
}).pipe(Effect.asVoid);
|
|
603
615
|
const isParseError = (error) => error._tag === "UnknownCommand" || error._tag === "UnknownOption" || error._tag === "MissingOptionValue" || error._tag === "MissingRequiredOption" || error._tag === "InvalidOption" || error._tag === "UnexpectedArgument";
|
|
604
616
|
const renderDockerAccessHeadline = (issue) => issue === "PermissionDenied" ? "Cannot access Docker daemon socket: permission denied." : "Cannot connect to Docker daemon.";
|
|
605
|
-
const renderPrimaryError = (error) => {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
if (error._tag === "CloneFailedError") {
|
|
624
|
-
return `Clone failed for ${error.repoUrl} (${error.repoRef}) into ${error.targetDir}`;
|
|
625
|
-
}
|
|
626
|
-
if (error._tag === "PortProbeError") {
|
|
627
|
-
return `SSH port check failed for ${error.port}: ${error.message}`;
|
|
628
|
-
}
|
|
629
|
-
if (error._tag === "CommandFailedError") {
|
|
630
|
-
return `${error.command} failed with exit code ${error.exitCode}`;
|
|
631
|
-
}
|
|
632
|
-
if (error._tag === "AuthError") {
|
|
633
|
-
return error.message;
|
|
634
|
-
}
|
|
635
|
-
return null;
|
|
636
|
-
};
|
|
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));
|
|
637
635
|
const renderConfigError = (error) => {
|
|
638
636
|
if (error._tag === "ConfigNotFoundError") {
|
|
639
637
|
return `docker-git.json not found: ${error.path} (run docker-git create in that directory)`;
|
|
@@ -820,6 +818,37 @@ Effect.asVoid(withProjectIndexAndSsh((index, sshKey) => forEachProjectStatus(ind
|
|
|
820
818
|
onSuccess: () => Effect.void
|
|
821
819
|
})))))));
|
|
822
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);
|
|
823
852
|
const usageText = [
|
|
824
853
|
"Usage:",
|
|
825
854
|
" pnpm docker-git",
|