@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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prover-coder-ai/docker-git",
3
- "version": "1.0.8",
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": "npx @ton-ai-core/vibecode-linter src/",
19
- "lint:tests": "npx @ton-ai-core/vibecode-linter tests/",
20
- "lint:effect": "npx eslint --config eslint.effect-ts-check.config.mjs .",
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
@@ -1,5 +1,17 @@
1
1
  # @prover-coder-ai/docker-git
2
2
 
3
+ ## 1.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: automated version bump
8
+
9
+ ## 1.0.9
10
+
11
+ ### Patch Changes
12
+
13
+ - chore: automated version bump
14
+
3
15
  ## 1.0.8
4
16
 
5
17
  ### Patch Changes
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
- if (error._tag === "FileExistsError") {
607
- return `File already exists: ${error.path} (use --force to overwrite)`;
608
- }
609
- if (error._tag === "DockerCommandError") {
610
- return [
611
- `docker compose failed with exit code ${error.exitCode}`,
612
- "Hint: ensure Docker daemon is running and current user can access /var/run/docker.sock (for example via the docker group)."
613
- ].join("\n");
614
- }
615
- if (error._tag === "DockerAccessError") {
616
- return [
617
- renderDockerAccessHeadline(error.issue),
618
- "Hint: ensure Docker daemon is running and current user can access the docker socket.",
619
- "Hint: if you use rootless Docker, set DOCKER_HOST to your user socket (for example unix:///run/user/$UID/docker.sock).",
620
- `Details: ${error.details}`
621
- ].join("\n");
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",