@shardflux/cli 0.13.0 → 0.13.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.1
4
+
5
+ - `npx @shardflux/cli` runs `shard` again: the package exposes one command. The Git remote helper that `shard` uses for agent branches runs from a private shim on the PATH of the git commands `shard` starts.
6
+
3
7
  ## 0.13.0 (not yet published)
4
8
 
5
9
  - Start the native agent while supervised repository setup runs in the background; show per-step setup progress and one failed-step retry in the command center. Changed runtime, CI, workspace and dependency inputs queue the next template preparation.
package/dist/agent-git.js CHANGED
@@ -4,12 +4,13 @@ import { existsSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSyn
4
4
  import { dirname, join, resolve } from 'node:path';
5
5
  import { UsageError } from "./errors.js";
6
6
  import { AgentStateStore } from "./agent-state.js";
7
+ import { gitPath } from "./git-remote-helper.js";
7
8
  const execute = promisify(execFile);
8
9
  const DAY = 86_400_000;
9
10
  export function gitRunner(root, env = process.env, signal) {
10
11
  return async (args) => {
11
12
  const result = await execute('git', ['--no-pager', '-C', root, ...args], {
12
- env: { ...env, GIT_TERMINAL_PROMPT: '0', GIT_MERGE_AUTOEDIT: 'no' },
13
+ env: { ...env, PATH: gitPath(env), GIT_TERMINAL_PROMPT: '0', GIT_MERGE_AUTOEDIT: 'no' },
13
14
  timeout: 120_000, maxBuffer: 4 * 1024 * 1024, signal,
14
15
  });
15
16
  return result.stdout.trim();
package/dist/args.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const CLI_VERSION = "0.13.0";
1
+ export declare const CLI_VERSION = "0.13.1";
2
2
  export interface OptionSpec {
3
3
  type: 'string' | 'boolean';
4
4
  short?: string;
package/dist/args.js CHANGED
@@ -12,7 +12,7 @@
12
12
  import { parseArgs } from 'node:util';
13
13
  import { ACCOUNT_COMMANDS } from "./account-args.js";
14
14
  import { UsageError } from "./errors.js";
15
- export const CLI_VERSION = '0.13.0';
15
+ export const CLI_VERSION = '0.13.1';
16
16
  export const GLOBAL_OPTIONS = {
17
17
  'api-url': { type: 'string', value: '<url>', description: 'API base URL (default $SHARDFLUX_API_URL, else https://api.shardflux.dev).' },
18
18
  json: { type: 'boolean', description: 'Print machine-readable JSON on stdout (errors as JSON on stderr).' },
File without changes
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Git finds a remote helper as `git-remote-<transport>` on PATH. The package exposes only `shard` (a single bin keeps
3
+ * `npx @shardflux/cli` working), so the git commands shard runs get a private directory on PATH holding a
4
+ * `git-remote-shard` shim that runs this installation's helper with the same Node.
5
+ */
6
+ export declare function gitRemoteHelperDir(env?: NodeJS.ProcessEnv): string;
7
+ /** PATH for git commands shard runs: the helper directory first, then the caller's PATH. */
8
+ export declare function gitPath(env?: NodeJS.ProcessEnv): string;
@@ -0,0 +1,31 @@
1
+ import { chmodSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
3
+ import { delimiter, extname, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ /**
6
+ * Git finds a remote helper as `git-remote-<transport>` on PATH. The package exposes only `shard` (a single bin keeps
7
+ * `npx @shardflux/cli` working), so the git commands shard runs get a private directory on PATH holding a
8
+ * `git-remote-shard` shim that runs this installation's helper with the same Node.
9
+ */
10
+ export function gitRemoteHelperDir(env = process.env) {
11
+ const dir = join(env.XDG_CACHE_HOME || join(homedir(), '.cache'), 'shardflux', 'git-remote');
12
+ const script = fileURLToPath(new URL(`./git-remote-bin${extname(fileURLToPath(import.meta.url))}`, import.meta.url));
13
+ const quote = (s) => `'${s.replaceAll("'", `'\\''`)}'`;
14
+ const shim = `#!/bin/sh\nexec ${quote(process.execPath)} ${quote(script)} "$@"\n`;
15
+ const target = join(dir, 'git-remote-shard');
16
+ let current = '';
17
+ try {
18
+ current = readFileSync(target, 'utf8');
19
+ }
20
+ catch { /* first use */ }
21
+ if (current !== shim) {
22
+ mkdirSync(dir, { recursive: true, mode: 0o700 });
23
+ writeFileSync(target, shim, { mode: 0o755 });
24
+ chmodSync(target, 0o755);
25
+ }
26
+ return dir;
27
+ }
28
+ /** PATH for git commands shard runs: the helper directory first, then the caller's PATH. */
29
+ export function gitPath(env = process.env) {
30
+ return [gitRemoteHelperDir(env), env.PATH].filter(Boolean).join(delimiter);
31
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shardflux/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "description": "shard: the Shardflux command line. Create an account, sign in, set up keys and billing, then open, run commands in, move files to, suspend, resume and fork serverless agent workspaces.",
6
6
  "license": "Apache-2.0",
@@ -23,8 +23,7 @@
23
23
  "node": ">=24"
24
24
  },
25
25
  "bin": {
26
- "shard": "./dist/bin.js",
27
- "git-remote-shard": "./dist/git-remote-bin.js"
26
+ "shard": "./dist/bin.js"
28
27
  },
29
28
  "exports": {
30
29
  ".": {