@moxt-ai/cli 0.3.3-moxt-run.0 → 0.3.3-moxt-run.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/README.md CHANGED
@@ -164,9 +164,14 @@ moxt run claude -- -p "summarize this repository"
164
164
  # Capture and upload source artifacts to the API key owner's personal space
165
165
  moxt run -w <workspace-id> codex -- exec "summarize this repository"
166
166
  moxt run -w <workspace-id> claude -- -p "summarize this repository"
167
+
168
+ # Or set a default workspace for repeated uploads
169
+ export MOXT_WORKSPACE_ID=<workspace-id>
170
+ moxt run codex -- exec "summarize this repository"
171
+ moxt run claude -- -p "summarize this repository"
167
172
  ```
168
173
 
169
- Uploaded files are stored by Moxt under `Local Agent Sessions/<run-id>/` in personal space. The command does not accept a workspace destination selector for run uploads; the server chooses the storage location. `moxt run` preserves the local agent's stdin/stdout/stderr behavior and returns the agent's exit code even when upload cleanup fails afterward.
174
+ Uploaded files are stored by Moxt under `Local Agent Sessions/<run-id>/` in personal space. For upload mode, `-w, --workspace` takes precedence over `MOXT_WORKSPACE_ID`; when neither is set, `moxt run` only writes the local capture artifact. The command does not accept a workspace destination selector for run uploads; the server chooses the storage location. `moxt run` preserves the local agent's stdin/stdout/stderr behavior and returns the agent's exit code even when upload cleanup fails afterward.
170
175
 
171
176
  Local run artifacts are written under the platform user data directory by default:
172
177
  macOS `~/Library/Application Support/moxt/runs/<run-id>/`, Linux `${XDG_DATA_HOME:-~/.local/share}/moxt/runs/<run-id>/`, and Windows `%LOCALAPPDATA%\Moxt\runs\<run-id>`. For tests or local debugging, override with `MOXT_RUN_OUTPUT_ROOT` or `MOXT_RUN_OUTPUT_DIR`.
@@ -208,6 +213,7 @@ Set the following environment variables:
208
213
  | Variable | Description |
209
214
  |----------|-------------|
210
215
  | `MOXT_API_KEY` | Your Moxt API key |
216
+ | `MOXT_WORKSPACE_ID` | Default workspace ID for `moxt run` upload mode and AI E2E verification |
211
217
  | `MOXT_HOST` | API hostname (default: `api.moxt.ai`) |
212
218
  | `MOXT_CF_ACCESS_TOKEN` / `CF_ACCESS_TOKEN` | Optional Cloudflare Access token for protected development or testing hosts |
213
219
  | `MOXT_CF_ACCESS_CLIENT_ID` / `MOXT_CF_ACCESS_CLIENT_SECRET` | Optional Cloudflare Access service-token credentials |
package/dist/index.js CHANGED
@@ -149,7 +149,7 @@ function getApiKeyOrUndefined() {
149
149
 
150
150
  // src/utils/http.ts
151
151
  function getUserAgent() {
152
- return `moxt-cli/${"0.3.3-moxt-run.0"} (${platform()}/${arch()}) node/${process.versions.node}`;
152
+ return `moxt-cli/${"0.3.3-moxt-run.1"} (${platform()}/${arch()}) node/${process.versions.node}`;
153
153
  }
154
154
  async function fetchApi(method, path2, body) {
155
155
  const apiKey = getApiKey();
@@ -2092,7 +2092,7 @@ function apiBaseUrl(env) {
2092
2092
  return `https://${env.MOXT_HOST ?? DEFAULT_HOST2}/openapi/v1`;
2093
2093
  }
2094
2094
  function userAgent() {
2095
- return `moxt-cli/${"0.3.3-moxt-run.0"} (${platform2()}/${arch2()}) node/${process.versions.node}`;
2095
+ return `moxt-cli/${"0.3.3-moxt-run.1"} (${platform2()}/${arch2()}) node/${process.versions.node}`;
2096
2096
  }
2097
2097
  function errorMessage2(error) {
2098
2098
  if (error instanceof Error && error.message !== "") {
@@ -2851,17 +2851,25 @@ function parseAgent(agent) {
2851
2851
  process.exit(1);
2852
2852
  }
2853
2853
  function resolveUploadOptions(options) {
2854
- if (!options.workspace) {
2854
+ const workspaceId = resolveWorkspaceId(options);
2855
+ if (workspaceId === void 0) {
2855
2856
  return void 0;
2856
2857
  }
2857
2858
  if (!process.env.MOXT_API_KEY) {
2858
- printError("Error: MOXT_API_KEY is required when using moxt run upload mode.");
2859
+ printError("Error: MOXT_API_KEY is required when using moxt run upload mode with -w/--workspace or MOXT_WORKSPACE_ID.");
2859
2860
  process.exit(1);
2860
2861
  }
2861
2862
  return {
2862
- workspaceId: options.workspace
2863
+ workspaceId
2863
2864
  };
2864
2865
  }
2866
+ function resolveWorkspaceId(options) {
2867
+ return normalizeWorkspaceId(options.workspace) ?? normalizeWorkspaceId(process.env.MOXT_WORKSPACE_ID);
2868
+ }
2869
+ function normalizeWorkspaceId(value) {
2870
+ const trimmed = value?.trim();
2871
+ return trimmed === void 0 || trimmed === "" ? void 0 : trimmed;
2872
+ }
2865
2873
  async function runLocalAgentOrExit(agent, agentArgs, upload) {
2866
2874
  return await runLocalAgent({
2867
2875
  agent,
@@ -3090,7 +3098,7 @@ var FLUSH_TIMEOUT_MS = 3e3;
3090
3098
  var MAX_BATCH_SIZE = 100;
3091
3099
  function commonLabels() {
3092
3100
  return {
3093
- cli_version: "0.3.3-moxt-run.0",
3101
+ cli_version: "0.3.3-moxt-run.1",
3094
3102
  node_version: process.versions.node,
3095
3103
  os: platform3(),
3096
3104
  arch: arch3(),
@@ -3136,7 +3144,7 @@ async function flush() {
3136
3144
  }
3137
3145
  const batch = buffer.splice(0, MAX_BATCH_SIZE);
3138
3146
  const payload = {
3139
- release_id: "0.3.3-moxt-run.0",
3147
+ release_id: "0.3.3-moxt-run.1",
3140
3148
  client_type: "cli",
3141
3149
  metric_data_list: batch.map((m) => ({
3142
3150
  profile: "cli",
@@ -3277,9 +3285,9 @@ function installExitHandler() {
3277
3285
 
3278
3286
  // src/index.ts
3279
3287
  updateNotifier({
3280
- pkg: { name: "@moxt-ai/cli", version: "0.3.3-moxt-run.0" }
3288
+ pkg: { name: "@moxt-ai/cli", version: "0.3.3-moxt-run.1" }
3281
3289
  }).notify();
3282
- var program = createProgram("0.3.3-moxt-run.0");
3290
+ var program = createProgram("0.3.3-moxt-run.1");
3283
3291
  instrumentProgram(program);
3284
3292
  installExitHandler();
3285
3293
  program.parseAsync(process.argv).then(async () => {