datagrok-tools 6.0.6 → 6.0.7

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.
@@ -29,19 +29,18 @@ else
29
29
  else
30
30
  BRANCH=$(resolve_branch "${DG_VERSION:-latest}")
31
31
  fi
32
- # Sparse checkout: only fetch dirs needed for package context (js-api, libraries, packages)
33
- # plus root files (CLAUDE.md, .claude/, etc.). Uses --depth 1 without blob filter so all
34
- # blobs arrive in one pack avoids slow on-demand fetching during checkout.
32
+ # Sparse checkout (cone mode) with partial clone: only fetch js-api, libraries, and
33
+ # ApiSamples. Cone mode integrates with --filter=blob:none so the server only sends
34
+ # blobs for the included directories (~3 MB vs 1.67 GB for the full tree).
35
35
  sparse_clone() {
36
36
  local branch="$1"
37
37
  # Use init+fetch instead of clone to handle pre-existing directories (e.g. mount points)
38
38
  git init "$PUBLIC_DIR" \
39
39
  && git -C "$PUBLIC_DIR" remote add origin "$REPO" \
40
- && git -C "$PUBLIC_DIR" sparse-checkout set --no-cone \
41
- '/*' '!connectors/' '!docker/' '!docusaurus/' '!docusaurus-static/' \
42
- '!environments/' '!hooks/' '!misc/' 'python-api/' '!datagrok-celery-task/' \
43
- '/js-api/**' '/libraries/**' '/packages/**' \
44
- && git -C "$PUBLIC_DIR" fetch --depth 1 origin "$branch" \
40
+ && git -C "$PUBLIC_DIR" config remote.origin.promisor true \
41
+ && git -C "$PUBLIC_DIR" config remote.origin.partialclonefilter blob:none \
42
+ && git -C "$PUBLIC_DIR" sparse-checkout set --cone js-api libraries packages/ApiSamples \
43
+ && git -C "$PUBLIC_DIR" fetch --depth 1 --filter=blob:none origin "$branch" \
45
44
  && git -C "$PUBLIC_DIR" checkout -B "$branch" FETCH_HEAD
46
45
  }
47
46
  # Clear directory contents without removing the dir itself (may be a mount point)
@@ -349,12 +349,18 @@ function writeProjectFiles(taskKey, args, worktreeRoot, dgPort) {
349
349
  // Bind-mount local entrypoint so fixes take effect without rebuilding the image
350
350
  if (hasLocalEntrypoint) volumes.push(` - "${toDockerPath(entrypointPath)}:/usr/local/bin/entrypoint.sh"`);
351
351
 
352
- // Claude profile (~/.claude + ~/.claude.json)
352
+ // Claude profile: mount only credential/settings files, not the whole directory.
353
+ // Mounting ~/.claude entirely makes subdirs (session-env/, sessions/) unwritable by the
354
+ // container's node user due to host filesystem permission mapping.
353
355
  const claudeHome = findClaudeHome();
354
356
  if (claudeHome) {
355
- volumes.push(` - "${toDockerPath(claudeHome)}:/home/node/.claude"`);
357
+ const claudeFiles = ['.credentials.json', 'settings.json', 'settings.local.json'];
358
+ for (const file of claudeFiles) {
359
+ const filePath = _path.default.join(claudeHome, file);
360
+ if (_fs.default.existsSync(filePath) && _fs.default.statSync(filePath).isFile()) volumes.push(` - "${toDockerPath(filePath)}:/home/node/.claude/${file}:ro"`);
361
+ }
356
362
  const claudeState = _path.default.join(_path.default.dirname(claudeHome), '.claude.json');
357
- if (_fs.default.existsSync(claudeState) && _fs.default.statSync(claudeState).isFile()) volumes.push(` - "${toDockerPath(claudeState)}:/home/node/.claude.json"`);
363
+ if (_fs.default.existsSync(claudeState) && _fs.default.statSync(claudeState).isFile()) volumes.push(` - "${toDockerPath(claudeState)}:/home/node/.claude.json:ro"`);
358
364
  color.info(`Claude profile: ${claudeHome}`);
359
365
  } else color.warn('No Claude profile found. Set CLAUDE_HOME or run "claude" locally to log in.');
360
366
  const overridePath = _path.default.join(projectDir, 'docker-compose.override.yaml');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datagrok-tools",
3
- "version": "6.0.6",
3
+ "version": "6.0.7",
4
4
  "description": "Utility to upload and publish packages to Datagrok",
5
5
  "homepage": "https://github.com/datagrok-ai/public/tree/master/tools#readme",
6
6
  "dependencies": {