@vm0/cli 9.34.0 → 9.36.0

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.
Files changed (2) hide show
  1. package/index.js +437 -232
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -45,7 +45,7 @@ if (DSN) {
45
45
  Sentry.init({
46
46
  dsn: DSN,
47
47
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
48
- release: "9.34.0",
48
+ release: "9.36.0",
49
49
  sendDefaultPii: false,
50
50
  tracesSampleRate: 0,
51
51
  shutdownTimeout: 500,
@@ -64,7 +64,7 @@ if (DSN) {
64
64
  }
65
65
  });
66
66
  Sentry.setContext("cli", {
67
- version: "9.34.0",
67
+ version: "9.36.0",
68
68
  command: process.argv.slice(2).join(" ")
69
69
  });
70
70
  Sentry.setContext("runtime", {
@@ -75,7 +75,7 @@ if (DSN) {
75
75
  }
76
76
 
77
77
  // src/index.ts
78
- import { Command as Command77 } from "commander";
78
+ import { Command as Command78 } from "commander";
79
79
 
80
80
  // src/commands/auth/index.ts
81
81
  import { Command as Command5 } from "commander";
@@ -605,7 +605,7 @@ async function waitForSilentUpgrade(timeout = TIMEOUT_MS) {
605
605
  // src/commands/info/index.ts
606
606
  var CONFIG_PATH = join2(homedir2(), ".vm0", "config.json");
607
607
  var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
608
- console.log(chalk7.bold(`VM0 CLI v${"9.34.0"}`));
608
+ console.log(chalk7.bold(`VM0 CLI v${"9.36.0"}`));
609
609
  console.log();
610
610
  const config = await loadConfig();
611
611
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -794,7 +794,9 @@ var storedExecutionContextSchema = z3.object({
794
794
  // Debug flag to force real Claude in mock environments (internal use only)
795
795
  debugNoMockClaude: z3.boolean().optional(),
796
796
  // Dispatch timestamp for E2E timing metrics
797
- apiStartTime: z3.number().optional()
797
+ apiStartTime: z3.number().optional(),
798
+ // User's timezone preference (IANA format, e.g., "Asia/Shanghai")
799
+ userTimezone: z3.string().optional()
798
800
  });
799
801
  var executionContextSchema = z3.object({
800
802
  runId: z3.string().uuid(),
@@ -816,7 +818,9 @@ var executionContextSchema = z3.object({
816
818
  // Debug flag to force real Claude in mock environments (internal use only)
817
819
  debugNoMockClaude: z3.boolean().optional(),
818
820
  // Dispatch timestamp for E2E timing metrics
819
- apiStartTime: z3.number().optional()
821
+ apiStartTime: z3.number().optional(),
822
+ // User's timezone preference (IANA format, e.g., "Asia/Shanghai")
823
+ userTimezone: z3.string().optional()
820
824
  });
821
825
  var runnersJobClaimContract = c.router({
822
826
  claim: {
@@ -854,7 +858,9 @@ var agentNameSchema = z4.string().min(3, "Agent name must be at least 3 characte
854
858
  );
855
859
  var volumeConfigSchema = z4.object({
856
860
  name: z4.string().min(1, "Volume name is required"),
857
- version: z4.string().min(1, "Volume version is required")
861
+ version: z4.string().min(1, "Volume version is required"),
862
+ /** When true, skip mounting without error if volume doesn't exist */
863
+ optional: z4.boolean().optional()
858
864
  });
859
865
  var SUPPORTED_APPS = ["github"];
860
866
  var SUPPORTED_APP_TAGS = ["latest", "dev"];
@@ -2632,8 +2638,8 @@ var MODEL_PROVIDER_TYPES = {
2632
2638
  CLAUDE_CODE_SUBAGENT_MODEL: "$model",
2633
2639
  API_TIMEOUT_MS: "3000000"
2634
2640
  },
2635
- models: ["GLM-4.7", "GLM-4.5-Air"],
2636
- defaultModel: "GLM-4.7"
2641
+ models: ["glm-5", "glm-4.7", "glm-4.5-air"],
2642
+ defaultModel: "glm-4.7"
2637
2643
  },
2638
2644
  "azure-foundry": {
2639
2645
  framework: "claude-code",
@@ -3775,29 +3781,80 @@ var connectorSessionByIdContract = c19.router({
3775
3781
  }
3776
3782
  });
3777
3783
 
3778
- // ../../packages/core/src/contracts/public/agents.ts
3784
+ // ../../packages/core/src/contracts/user-preferences.ts
3779
3785
  import { z as z24 } from "zod";
3780
3786
  var c20 = initContract();
3781
- var publicAgentSchema = z24.object({
3782
- id: z24.string(),
3783
- name: z24.string(),
3784
- currentVersionId: z24.string().nullable(),
3787
+ var userPreferencesResponseSchema = z24.object({
3788
+ timezone: z24.string().nullable(),
3789
+ notifyEmail: z24.boolean()
3790
+ });
3791
+ var updateUserPreferencesRequestSchema = z24.object({
3792
+ timezone: z24.string().min(1).optional(),
3793
+ notifyEmail: z24.boolean().optional()
3794
+ }).refine(
3795
+ (data) => data.timezone !== void 0 || data.notifyEmail !== void 0,
3796
+ {
3797
+ message: "At least one preference must be provided"
3798
+ }
3799
+ );
3800
+ var userPreferencesContract = c20.router({
3801
+ /**
3802
+ * GET /api/user/preferences
3803
+ * Get current user's preferences
3804
+ */
3805
+ get: {
3806
+ method: "GET",
3807
+ path: "/api/user/preferences",
3808
+ headers: authHeadersSchema,
3809
+ responses: {
3810
+ 200: userPreferencesResponseSchema,
3811
+ 401: apiErrorSchema,
3812
+ 500: apiErrorSchema
3813
+ },
3814
+ summary: "Get user preferences"
3815
+ },
3816
+ /**
3817
+ * PUT /api/user/preferences
3818
+ * Update user preferences
3819
+ */
3820
+ update: {
3821
+ method: "PUT",
3822
+ path: "/api/user/preferences",
3823
+ headers: authHeadersSchema,
3824
+ body: updateUserPreferencesRequestSchema,
3825
+ responses: {
3826
+ 200: userPreferencesResponseSchema,
3827
+ 400: apiErrorSchema,
3828
+ 401: apiErrorSchema,
3829
+ 500: apiErrorSchema
3830
+ },
3831
+ summary: "Update user preferences"
3832
+ }
3833
+ });
3834
+
3835
+ // ../../packages/core/src/contracts/public/agents.ts
3836
+ import { z as z25 } from "zod";
3837
+ var c21 = initContract();
3838
+ var publicAgentSchema = z25.object({
3839
+ id: z25.string(),
3840
+ name: z25.string(),
3841
+ currentVersionId: z25.string().nullable(),
3785
3842
  createdAt: timestampSchema,
3786
3843
  updatedAt: timestampSchema
3787
3844
  });
3788
- var agentVersionSchema = z24.object({
3789
- id: z24.string(),
3790
- agentId: z24.string(),
3791
- versionNumber: z24.number(),
3845
+ var agentVersionSchema = z25.object({
3846
+ id: z25.string(),
3847
+ agentId: z25.string(),
3848
+ versionNumber: z25.number(),
3792
3849
  createdAt: timestampSchema
3793
3850
  });
3794
3851
  var publicAgentDetailSchema = publicAgentSchema;
3795
3852
  var paginatedAgentsSchema = createPaginatedResponseSchema(publicAgentSchema);
3796
3853
  var paginatedAgentVersionsSchema = createPaginatedResponseSchema(agentVersionSchema);
3797
3854
  var agentListQuerySchema = listQuerySchema.extend({
3798
- name: z24.string().optional()
3855
+ name: z25.string().optional()
3799
3856
  });
3800
- var publicAgentsListContract = c20.router({
3857
+ var publicAgentsListContract = c21.router({
3801
3858
  list: {
3802
3859
  method: "GET",
3803
3860
  path: "/v1/agents",
@@ -3812,13 +3869,13 @@ var publicAgentsListContract = c20.router({
3812
3869
  description: "List all agents in the current scope with pagination. Use the `name` query parameter to filter by agent name."
3813
3870
  }
3814
3871
  });
3815
- var publicAgentByIdContract = c20.router({
3872
+ var publicAgentByIdContract = c21.router({
3816
3873
  get: {
3817
3874
  method: "GET",
3818
3875
  path: "/v1/agents/:id",
3819
3876
  headers: authHeadersSchema,
3820
- pathParams: z24.object({
3821
- id: z24.string().min(1, "Agent ID is required")
3877
+ pathParams: z25.object({
3878
+ id: z25.string().min(1, "Agent ID is required")
3822
3879
  }),
3823
3880
  responses: {
3824
3881
  200: publicAgentDetailSchema,
@@ -3830,13 +3887,13 @@ var publicAgentByIdContract = c20.router({
3830
3887
  description: "Get agent details by ID"
3831
3888
  }
3832
3889
  });
3833
- var publicAgentVersionsContract = c20.router({
3890
+ var publicAgentVersionsContract = c21.router({
3834
3891
  list: {
3835
3892
  method: "GET",
3836
3893
  path: "/v1/agents/:id/versions",
3837
3894
  headers: authHeadersSchema,
3838
- pathParams: z24.object({
3839
- id: z24.string().min(1, "Agent ID is required")
3895
+ pathParams: z25.object({
3896
+ id: z25.string().min(1, "Agent ID is required")
3840
3897
  }),
3841
3898
  query: listQuerySchema,
3842
3899
  responses: {
@@ -3851,9 +3908,9 @@ var publicAgentVersionsContract = c20.router({
3851
3908
  });
3852
3909
 
3853
3910
  // ../../packages/core/src/contracts/public/runs.ts
3854
- import { z as z25 } from "zod";
3855
- var c21 = initContract();
3856
- var publicRunStatusSchema = z25.enum([
3911
+ import { z as z26 } from "zod";
3912
+ var c22 = initContract();
3913
+ var publicRunStatusSchema = z26.enum([
3857
3914
  "pending",
3858
3915
  "running",
3859
3916
  "completed",
@@ -3861,54 +3918,54 @@ var publicRunStatusSchema = z25.enum([
3861
3918
  "timeout",
3862
3919
  "cancelled"
3863
3920
  ]);
3864
- var publicRunSchema = z25.object({
3865
- id: z25.string(),
3866
- agentId: z25.string(),
3867
- agentName: z25.string(),
3921
+ var publicRunSchema = z26.object({
3922
+ id: z26.string(),
3923
+ agentId: z26.string(),
3924
+ agentName: z26.string(),
3868
3925
  status: publicRunStatusSchema,
3869
- prompt: z25.string(),
3926
+ prompt: z26.string(),
3870
3927
  createdAt: timestampSchema,
3871
3928
  startedAt: timestampSchema.nullable(),
3872
3929
  completedAt: timestampSchema.nullable()
3873
3930
  });
3874
3931
  var publicRunDetailSchema = publicRunSchema.extend({
3875
- error: z25.string().nullable(),
3876
- executionTimeMs: z25.number().nullable(),
3877
- checkpointId: z25.string().nullable(),
3878
- sessionId: z25.string().nullable(),
3879
- artifactName: z25.string().nullable(),
3880
- artifactVersion: z25.string().nullable(),
3881
- volumes: z25.record(z25.string(), z25.string()).optional()
3932
+ error: z26.string().nullable(),
3933
+ executionTimeMs: z26.number().nullable(),
3934
+ checkpointId: z26.string().nullable(),
3935
+ sessionId: z26.string().nullable(),
3936
+ artifactName: z26.string().nullable(),
3937
+ artifactVersion: z26.string().nullable(),
3938
+ volumes: z26.record(z26.string(), z26.string()).optional()
3882
3939
  });
3883
3940
  var paginatedRunsSchema = createPaginatedResponseSchema(publicRunSchema);
3884
- var createRunRequestSchema = z25.object({
3941
+ var createRunRequestSchema = z26.object({
3885
3942
  // Agent identification (one of: agent, agentId, sessionId, checkpointId)
3886
- agent: z25.string().optional(),
3943
+ agent: z26.string().optional(),
3887
3944
  // Agent name
3888
- agentId: z25.string().optional(),
3945
+ agentId: z26.string().optional(),
3889
3946
  // Agent ID
3890
- agentVersion: z25.string().optional(),
3947
+ agentVersion: z26.string().optional(),
3891
3948
  // Version specifier (e.g., "latest", "v1", specific ID)
3892
3949
  // Continue session
3893
- sessionId: z25.string().optional(),
3950
+ sessionId: z26.string().optional(),
3894
3951
  // Resume from checkpoint
3895
- checkpointId: z25.string().optional(),
3952
+ checkpointId: z26.string().optional(),
3896
3953
  // Required
3897
- prompt: z25.string().min(1, "Prompt is required"),
3954
+ prompt: z26.string().min(1, "Prompt is required"),
3898
3955
  // Optional configuration
3899
- variables: z25.record(z25.string(), z25.string()).optional(),
3900
- secrets: z25.record(z25.string(), z25.string()).optional(),
3901
- artifactName: z25.string().optional(),
3956
+ variables: z26.record(z26.string(), z26.string()).optional(),
3957
+ secrets: z26.record(z26.string(), z26.string()).optional(),
3958
+ artifactName: z26.string().optional(),
3902
3959
  // Artifact name to mount
3903
- artifactVersion: z25.string().optional(),
3960
+ artifactVersion: z26.string().optional(),
3904
3961
  // Artifact version (defaults to latest)
3905
- volumes: z25.record(z25.string(), z25.string()).optional()
3962
+ volumes: z26.record(z26.string(), z26.string()).optional()
3906
3963
  // volume_name -> version
3907
3964
  });
3908
3965
  var runListQuerySchema = listQuerySchema.extend({
3909
3966
  status: publicRunStatusSchema.optional()
3910
3967
  });
3911
- var publicRunsListContract = c21.router({
3968
+ var publicRunsListContract = c22.router({
3912
3969
  list: {
3913
3970
  method: "GET",
3914
3971
  path: "/v1/runs",
@@ -3940,13 +3997,13 @@ var publicRunsListContract = c21.router({
3940
3997
  description: "Create and execute a new agent run. Returns 202 Accepted as runs execute asynchronously."
3941
3998
  }
3942
3999
  });
3943
- var publicRunByIdContract = c21.router({
4000
+ var publicRunByIdContract = c22.router({
3944
4001
  get: {
3945
4002
  method: "GET",
3946
4003
  path: "/v1/runs/:id",
3947
4004
  headers: authHeadersSchema,
3948
- pathParams: z25.object({
3949
- id: z25.string().min(1, "Run ID is required")
4005
+ pathParams: z26.object({
4006
+ id: z26.string().min(1, "Run ID is required")
3950
4007
  }),
3951
4008
  responses: {
3952
4009
  200: publicRunDetailSchema,
@@ -3958,15 +4015,15 @@ var publicRunByIdContract = c21.router({
3958
4015
  description: "Get run details by ID"
3959
4016
  }
3960
4017
  });
3961
- var publicRunCancelContract = c21.router({
4018
+ var publicRunCancelContract = c22.router({
3962
4019
  cancel: {
3963
4020
  method: "POST",
3964
4021
  path: "/v1/runs/:id/cancel",
3965
4022
  headers: authHeadersSchema,
3966
- pathParams: z25.object({
3967
- id: z25.string().min(1, "Run ID is required")
4023
+ pathParams: z26.object({
4024
+ id: z26.string().min(1, "Run ID is required")
3968
4025
  }),
3969
- body: z25.undefined(),
4026
+ body: z26.undefined(),
3970
4027
  responses: {
3971
4028
  200: publicRunDetailSchema,
3972
4029
  400: publicApiErrorSchema,
@@ -3979,27 +4036,27 @@ var publicRunCancelContract = c21.router({
3979
4036
  description: "Cancel a pending or running execution"
3980
4037
  }
3981
4038
  });
3982
- var logEntrySchema = z25.object({
4039
+ var logEntrySchema = z26.object({
3983
4040
  timestamp: timestampSchema,
3984
- type: z25.enum(["agent", "system", "network"]),
3985
- level: z25.enum(["debug", "info", "warn", "error"]),
3986
- message: z25.string(),
3987
- metadata: z25.record(z25.string(), z25.unknown()).optional()
4041
+ type: z26.enum(["agent", "system", "network"]),
4042
+ level: z26.enum(["debug", "info", "warn", "error"]),
4043
+ message: z26.string(),
4044
+ metadata: z26.record(z26.string(), z26.unknown()).optional()
3988
4045
  });
3989
4046
  var paginatedLogsSchema = createPaginatedResponseSchema(logEntrySchema);
3990
4047
  var logsQuerySchema = listQuerySchema.extend({
3991
- type: z25.enum(["agent", "system", "network", "all"]).default("all"),
4048
+ type: z26.enum(["agent", "system", "network", "all"]).default("all"),
3992
4049
  since: timestampSchema.optional(),
3993
4050
  until: timestampSchema.optional(),
3994
- order: z25.enum(["asc", "desc"]).default("asc")
4051
+ order: z26.enum(["asc", "desc"]).default("asc")
3995
4052
  });
3996
- var publicRunLogsContract = c21.router({
4053
+ var publicRunLogsContract = c22.router({
3997
4054
  getLogs: {
3998
4055
  method: "GET",
3999
4056
  path: "/v1/runs/:id/logs",
4000
4057
  headers: authHeadersSchema,
4001
- pathParams: z25.object({
4002
- id: z25.string().min(1, "Run ID is required")
4058
+ pathParams: z26.object({
4059
+ id: z26.string().min(1, "Run ID is required")
4003
4060
  }),
4004
4061
  query: logsQuerySchema,
4005
4062
  responses: {
@@ -4012,30 +4069,30 @@ var publicRunLogsContract = c21.router({
4012
4069
  description: "Get unified logs for a run. Combines agent, system, and network logs."
4013
4070
  }
4014
4071
  });
4015
- var metricPointSchema = z25.object({
4072
+ var metricPointSchema = z26.object({
4016
4073
  timestamp: timestampSchema,
4017
- cpuPercent: z25.number(),
4018
- memoryUsedMb: z25.number(),
4019
- memoryTotalMb: z25.number(),
4020
- diskUsedMb: z25.number(),
4021
- diskTotalMb: z25.number()
4022
- });
4023
- var metricsSummarySchema = z25.object({
4024
- avgCpuPercent: z25.number(),
4025
- maxMemoryUsedMb: z25.number(),
4026
- totalDurationMs: z25.number().nullable()
4027
- });
4028
- var metricsResponseSchema2 = z25.object({
4029
- data: z25.array(metricPointSchema),
4074
+ cpuPercent: z26.number(),
4075
+ memoryUsedMb: z26.number(),
4076
+ memoryTotalMb: z26.number(),
4077
+ diskUsedMb: z26.number(),
4078
+ diskTotalMb: z26.number()
4079
+ });
4080
+ var metricsSummarySchema = z26.object({
4081
+ avgCpuPercent: z26.number(),
4082
+ maxMemoryUsedMb: z26.number(),
4083
+ totalDurationMs: z26.number().nullable()
4084
+ });
4085
+ var metricsResponseSchema2 = z26.object({
4086
+ data: z26.array(metricPointSchema),
4030
4087
  summary: metricsSummarySchema
4031
4088
  });
4032
- var publicRunMetricsContract = c21.router({
4089
+ var publicRunMetricsContract = c22.router({
4033
4090
  getMetrics: {
4034
4091
  method: "GET",
4035
4092
  path: "/v1/runs/:id/metrics",
4036
4093
  headers: authHeadersSchema,
4037
- pathParams: z25.object({
4038
- id: z25.string().min(1, "Run ID is required")
4094
+ pathParams: z26.object({
4095
+ id: z26.string().min(1, "Run ID is required")
4039
4096
  }),
4040
4097
  responses: {
4041
4098
  200: metricsResponseSchema2,
@@ -4047,7 +4104,7 @@ var publicRunMetricsContract = c21.router({
4047
4104
  description: "Get CPU, memory, and disk metrics for a run"
4048
4105
  }
4049
4106
  });
4050
- var sseEventTypeSchema = z25.enum([
4107
+ var sseEventTypeSchema = z26.enum([
4051
4108
  "status",
4052
4109
  // Run status change
4053
4110
  "output",
@@ -4059,26 +4116,26 @@ var sseEventTypeSchema = z25.enum([
4059
4116
  "heartbeat"
4060
4117
  // Keep-alive
4061
4118
  ]);
4062
- var sseEventSchema = z25.object({
4119
+ var sseEventSchema = z26.object({
4063
4120
  event: sseEventTypeSchema,
4064
- data: z25.unknown(),
4065
- id: z25.string().optional()
4121
+ data: z26.unknown(),
4122
+ id: z26.string().optional()
4066
4123
  // For Last-Event-ID reconnection
4067
4124
  });
4068
- var publicRunEventsContract = c21.router({
4125
+ var publicRunEventsContract = c22.router({
4069
4126
  streamEvents: {
4070
4127
  method: "GET",
4071
4128
  path: "/v1/runs/:id/events",
4072
4129
  headers: authHeadersSchema,
4073
- pathParams: z25.object({
4074
- id: z25.string().min(1, "Run ID is required")
4130
+ pathParams: z26.object({
4131
+ id: z26.string().min(1, "Run ID is required")
4075
4132
  }),
4076
- query: z25.object({
4077
- lastEventId: z25.string().optional()
4133
+ query: z26.object({
4134
+ lastEventId: z26.string().optional()
4078
4135
  // For reconnection
4079
4136
  }),
4080
4137
  responses: {
4081
- 200: z25.any(),
4138
+ 200: z26.any(),
4082
4139
  // SSE stream - actual content is text/event-stream
4083
4140
  401: publicApiErrorSchema,
4084
4141
  404: publicApiErrorSchema,
@@ -4090,28 +4147,28 @@ var publicRunEventsContract = c21.router({
4090
4147
  });
4091
4148
 
4092
4149
  // ../../packages/core/src/contracts/public/artifacts.ts
4093
- import { z as z26 } from "zod";
4094
- var c22 = initContract();
4095
- var publicArtifactSchema = z26.object({
4096
- id: z26.string(),
4097
- name: z26.string(),
4098
- currentVersionId: z26.string().nullable(),
4099
- size: z26.number(),
4150
+ import { z as z27 } from "zod";
4151
+ var c23 = initContract();
4152
+ var publicArtifactSchema = z27.object({
4153
+ id: z27.string(),
4154
+ name: z27.string(),
4155
+ currentVersionId: z27.string().nullable(),
4156
+ size: z27.number(),
4100
4157
  // Total size in bytes
4101
- fileCount: z26.number(),
4158
+ fileCount: z27.number(),
4102
4159
  createdAt: timestampSchema,
4103
4160
  updatedAt: timestampSchema
4104
4161
  });
4105
- var artifactVersionSchema = z26.object({
4106
- id: z26.string(),
4162
+ var artifactVersionSchema = z27.object({
4163
+ id: z27.string(),
4107
4164
  // SHA-256 content hash
4108
- artifactId: z26.string(),
4109
- size: z26.number(),
4165
+ artifactId: z27.string(),
4166
+ size: z27.number(),
4110
4167
  // Size in bytes
4111
- fileCount: z26.number(),
4112
- message: z26.string().nullable(),
4168
+ fileCount: z27.number(),
4169
+ message: z27.string().nullable(),
4113
4170
  // Optional commit message
4114
- createdBy: z26.string(),
4171
+ createdBy: z27.string(),
4115
4172
  createdAt: timestampSchema
4116
4173
  });
4117
4174
  var publicArtifactDetailSchema = publicArtifactSchema.extend({
@@ -4121,7 +4178,7 @@ var paginatedArtifactsSchema = createPaginatedResponseSchema(publicArtifactSchem
4121
4178
  var paginatedArtifactVersionsSchema = createPaginatedResponseSchema(
4122
4179
  artifactVersionSchema
4123
4180
  );
4124
- var publicArtifactsListContract = c22.router({
4181
+ var publicArtifactsListContract = c23.router({
4125
4182
  list: {
4126
4183
  method: "GET",
4127
4184
  path: "/v1/artifacts",
@@ -4136,13 +4193,13 @@ var publicArtifactsListContract = c22.router({
4136
4193
  description: "List all artifacts in the current scope with pagination"
4137
4194
  }
4138
4195
  });
4139
- var publicArtifactByIdContract = c22.router({
4196
+ var publicArtifactByIdContract = c23.router({
4140
4197
  get: {
4141
4198
  method: "GET",
4142
4199
  path: "/v1/artifacts/:id",
4143
4200
  headers: authHeadersSchema,
4144
- pathParams: z26.object({
4145
- id: z26.string().min(1, "Artifact ID is required")
4201
+ pathParams: z27.object({
4202
+ id: z27.string().min(1, "Artifact ID is required")
4146
4203
  }),
4147
4204
  responses: {
4148
4205
  200: publicArtifactDetailSchema,
@@ -4154,13 +4211,13 @@ var publicArtifactByIdContract = c22.router({
4154
4211
  description: "Get artifact details by ID"
4155
4212
  }
4156
4213
  });
4157
- var publicArtifactVersionsContract = c22.router({
4214
+ var publicArtifactVersionsContract = c23.router({
4158
4215
  list: {
4159
4216
  method: "GET",
4160
4217
  path: "/v1/artifacts/:id/versions",
4161
4218
  headers: authHeadersSchema,
4162
- pathParams: z26.object({
4163
- id: z26.string().min(1, "Artifact ID is required")
4219
+ pathParams: z27.object({
4220
+ id: z27.string().min(1, "Artifact ID is required")
4164
4221
  }),
4165
4222
  query: listQuerySchema,
4166
4223
  responses: {
@@ -4173,20 +4230,20 @@ var publicArtifactVersionsContract = c22.router({
4173
4230
  description: "List all versions of an artifact with pagination"
4174
4231
  }
4175
4232
  });
4176
- var publicArtifactDownloadContract = c22.router({
4233
+ var publicArtifactDownloadContract = c23.router({
4177
4234
  download: {
4178
4235
  method: "GET",
4179
4236
  path: "/v1/artifacts/:id/download",
4180
4237
  headers: authHeadersSchema,
4181
- pathParams: z26.object({
4182
- id: z26.string().min(1, "Artifact ID is required")
4238
+ pathParams: z27.object({
4239
+ id: z27.string().min(1, "Artifact ID is required")
4183
4240
  }),
4184
- query: z26.object({
4185
- versionId: z26.string().optional()
4241
+ query: z27.object({
4242
+ versionId: z27.string().optional()
4186
4243
  // Defaults to current version
4187
4244
  }),
4188
4245
  responses: {
4189
- 302: z26.undefined(),
4246
+ 302: z27.undefined(),
4190
4247
  // Redirect to presigned URL
4191
4248
  401: publicApiErrorSchema,
4192
4249
  404: publicApiErrorSchema,
@@ -4198,28 +4255,28 @@ var publicArtifactDownloadContract = c22.router({
4198
4255
  });
4199
4256
 
4200
4257
  // ../../packages/core/src/contracts/public/volumes.ts
4201
- import { z as z27 } from "zod";
4202
- var c23 = initContract();
4203
- var publicVolumeSchema = z27.object({
4204
- id: z27.string(),
4205
- name: z27.string(),
4206
- currentVersionId: z27.string().nullable(),
4207
- size: z27.number(),
4258
+ import { z as z28 } from "zod";
4259
+ var c24 = initContract();
4260
+ var publicVolumeSchema = z28.object({
4261
+ id: z28.string(),
4262
+ name: z28.string(),
4263
+ currentVersionId: z28.string().nullable(),
4264
+ size: z28.number(),
4208
4265
  // Total size in bytes
4209
- fileCount: z27.number(),
4266
+ fileCount: z28.number(),
4210
4267
  createdAt: timestampSchema,
4211
4268
  updatedAt: timestampSchema
4212
4269
  });
4213
- var volumeVersionSchema = z27.object({
4214
- id: z27.string(),
4270
+ var volumeVersionSchema = z28.object({
4271
+ id: z28.string(),
4215
4272
  // SHA-256 content hash
4216
- volumeId: z27.string(),
4217
- size: z27.number(),
4273
+ volumeId: z28.string(),
4274
+ size: z28.number(),
4218
4275
  // Size in bytes
4219
- fileCount: z27.number(),
4220
- message: z27.string().nullable(),
4276
+ fileCount: z28.number(),
4277
+ message: z28.string().nullable(),
4221
4278
  // Optional commit message
4222
- createdBy: z27.string(),
4279
+ createdBy: z28.string(),
4223
4280
  createdAt: timestampSchema
4224
4281
  });
4225
4282
  var publicVolumeDetailSchema = publicVolumeSchema.extend({
@@ -4227,7 +4284,7 @@ var publicVolumeDetailSchema = publicVolumeSchema.extend({
4227
4284
  });
4228
4285
  var paginatedVolumesSchema = createPaginatedResponseSchema(publicVolumeSchema);
4229
4286
  var paginatedVolumeVersionsSchema = createPaginatedResponseSchema(volumeVersionSchema);
4230
- var publicVolumesListContract = c23.router({
4287
+ var publicVolumesListContract = c24.router({
4231
4288
  list: {
4232
4289
  method: "GET",
4233
4290
  path: "/v1/volumes",
@@ -4242,13 +4299,13 @@ var publicVolumesListContract = c23.router({
4242
4299
  description: "List all volumes in the current scope with pagination"
4243
4300
  }
4244
4301
  });
4245
- var publicVolumeByIdContract = c23.router({
4302
+ var publicVolumeByIdContract = c24.router({
4246
4303
  get: {
4247
4304
  method: "GET",
4248
4305
  path: "/v1/volumes/:id",
4249
4306
  headers: authHeadersSchema,
4250
- pathParams: z27.object({
4251
- id: z27.string().min(1, "Volume ID is required")
4307
+ pathParams: z28.object({
4308
+ id: z28.string().min(1, "Volume ID is required")
4252
4309
  }),
4253
4310
  responses: {
4254
4311
  200: publicVolumeDetailSchema,
@@ -4260,13 +4317,13 @@ var publicVolumeByIdContract = c23.router({
4260
4317
  description: "Get volume details by ID"
4261
4318
  }
4262
4319
  });
4263
- var publicVolumeVersionsContract = c23.router({
4320
+ var publicVolumeVersionsContract = c24.router({
4264
4321
  list: {
4265
4322
  method: "GET",
4266
4323
  path: "/v1/volumes/:id/versions",
4267
4324
  headers: authHeadersSchema,
4268
- pathParams: z27.object({
4269
- id: z27.string().min(1, "Volume ID is required")
4325
+ pathParams: z28.object({
4326
+ id: z28.string().min(1, "Volume ID is required")
4270
4327
  }),
4271
4328
  query: listQuerySchema,
4272
4329
  responses: {
@@ -4279,20 +4336,20 @@ var publicVolumeVersionsContract = c23.router({
4279
4336
  description: "List all versions of a volume with pagination"
4280
4337
  }
4281
4338
  });
4282
- var publicVolumeDownloadContract = c23.router({
4339
+ var publicVolumeDownloadContract = c24.router({
4283
4340
  download: {
4284
4341
  method: "GET",
4285
4342
  path: "/v1/volumes/:id/download",
4286
4343
  headers: authHeadersSchema,
4287
- pathParams: z27.object({
4288
- id: z27.string().min(1, "Volume ID is required")
4344
+ pathParams: z28.object({
4345
+ id: z28.string().min(1, "Volume ID is required")
4289
4346
  }),
4290
- query: z27.object({
4291
- versionId: z27.string().optional()
4347
+ query: z28.object({
4348
+ versionId: z28.string().optional()
4292
4349
  // Defaults to current version
4293
4350
  }),
4294
4351
  responses: {
4295
- 302: z27.undefined(),
4352
+ 302: z28.undefined(),
4296
4353
  // Redirect to presigned URL
4297
4354
  401: publicApiErrorSchema,
4298
4355
  404: publicApiErrorSchema,
@@ -5002,9 +5059,30 @@ async function getUsage(options) {
5002
5059
  return response.json();
5003
5060
  }
5004
5061
 
5062
+ // src/lib/api/domains/user-preferences.ts
5063
+ import { initClient as initClient11 } from "@ts-rest/core";
5064
+ async function getUserPreferences() {
5065
+ const config = await getClientConfig();
5066
+ const client = initClient11(userPreferencesContract, config);
5067
+ const result = await client.get({ headers: {} });
5068
+ if (result.status === 200) {
5069
+ return result.body;
5070
+ }
5071
+ handleError(result, "Failed to get user preferences");
5072
+ }
5073
+ async function updateUserPreferences(body) {
5074
+ const config = await getClientConfig();
5075
+ const client = initClient11(userPreferencesContract, config);
5076
+ const result = await client.update({ body });
5077
+ if (result.status === 200) {
5078
+ return result.body;
5079
+ }
5080
+ handleError(result, "Failed to update user preferences");
5081
+ }
5082
+
5005
5083
  // src/lib/domain/yaml-validator.ts
5006
- import { z as z28 } from "zod";
5007
- var cliAgentNameSchema = z28.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
5084
+ import { z as z29 } from "zod";
5085
+ var cliAgentNameSchema = z29.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
5008
5086
  /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
5009
5087
  "Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
5010
5088
  );
@@ -5019,7 +5097,7 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
5019
5097
  const skillUrl = agent.skills[i];
5020
5098
  if (skillUrl && !validateGitHubTreeUrl(skillUrl)) {
5021
5099
  ctx.addIssue({
5022
- code: z28.ZodIssueCode.custom,
5100
+ code: z29.ZodIssueCode.custom,
5023
5101
  message: `Invalid skill URL: ${skillUrl}. Expected format: https://github.com/{owner}/{repo}/tree/{branch}/{path}`,
5024
5102
  path: ["skills", i]
5025
5103
  });
@@ -5028,15 +5106,15 @@ var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
5028
5106
  }
5029
5107
  }
5030
5108
  );
5031
- var cliComposeSchema = z28.object({
5032
- version: z28.string().min(1, "Missing config.version"),
5033
- agents: z28.record(cliAgentNameSchema, cliAgentDefinitionSchema),
5034
- volumes: z28.record(z28.string(), volumeConfigSchema).optional()
5109
+ var cliComposeSchema = z29.object({
5110
+ version: z29.string().min(1, "Missing config.version"),
5111
+ agents: z29.record(cliAgentNameSchema, cliAgentDefinitionSchema),
5112
+ volumes: z29.record(z29.string(), volumeConfigSchema).optional()
5035
5113
  }).superRefine((config, ctx) => {
5036
5114
  const agentKeys = Object.keys(config.agents);
5037
5115
  if (agentKeys.length === 0) {
5038
5116
  ctx.addIssue({
5039
- code: z28.ZodIssueCode.custom,
5117
+ code: z29.ZodIssueCode.custom,
5040
5118
  message: "agents must have at least one agent defined",
5041
5119
  path: ["agents"]
5042
5120
  });
@@ -5044,7 +5122,7 @@ var cliComposeSchema = z28.object({
5044
5122
  }
5045
5123
  if (agentKeys.length > 1) {
5046
5124
  ctx.addIssue({
5047
- code: z28.ZodIssueCode.custom,
5125
+ code: z29.ZodIssueCode.custom,
5048
5126
  message: "Multiple agents not supported yet. Only one agent allowed.",
5049
5127
  path: ["agents"]
5050
5128
  });
@@ -5056,7 +5134,7 @@ var cliComposeSchema = z28.object({
5056
5134
  if (agentVolumes && agentVolumes.length > 0) {
5057
5135
  if (!config.volumes) {
5058
5136
  ctx.addIssue({
5059
- code: z28.ZodIssueCode.custom,
5137
+ code: z29.ZodIssueCode.custom,
5060
5138
  message: "Agent references volumes but no volumes section defined. Each volume must have explicit name and version.",
5061
5139
  path: ["volumes"]
5062
5140
  });
@@ -5066,7 +5144,7 @@ var cliComposeSchema = z28.object({
5066
5144
  const parts = volDeclaration.split(":");
5067
5145
  if (parts.length !== 2) {
5068
5146
  ctx.addIssue({
5069
- code: z28.ZodIssueCode.custom,
5147
+ code: z29.ZodIssueCode.custom,
5070
5148
  message: `Invalid volume declaration: ${volDeclaration}. Expected format: volume-key:/mount/path`,
5071
5149
  path: ["agents", agentName, "volumes"]
5072
5150
  });
@@ -5075,7 +5153,7 @@ var cliComposeSchema = z28.object({
5075
5153
  const volumeKey = parts[0].trim();
5076
5154
  if (!config.volumes[volumeKey]) {
5077
5155
  ctx.addIssue({
5078
- code: z28.ZodIssueCode.custom,
5156
+ code: z29.ZodIssueCode.custom,
5079
5157
  message: `Volume "${volumeKey}" is not defined in volumes section. Each volume must have explicit name and version.`,
5080
5158
  path: ["volumes", volumeKey]
5081
5159
  });
@@ -6054,7 +6132,7 @@ async function checkAndPromptMissingItems(config, options) {
6054
6132
  variablesResponse.variables.map((v) => v.name)
6055
6133
  );
6056
6134
  const connectorProvided = getConnectorProvidedSecretNames(
6057
- connectorsResponse.connectors.map((c24) => c24.type)
6135
+ connectorsResponse.connectors.map((c25) => c25.type)
6058
6136
  );
6059
6137
  const missingSecrets = [...requiredSecrets].filter(
6060
6138
  (name) => !existingSecretNames.has(name) && !connectorProvided.has(name)
@@ -6265,7 +6343,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
6265
6343
  options.autoUpdate = false;
6266
6344
  }
6267
6345
  if (options.autoUpdate !== false) {
6268
- await startSilentUpgrade("9.34.0");
6346
+ await startSilentUpgrade("9.36.0");
6269
6347
  }
6270
6348
  try {
6271
6349
  let result;
@@ -7051,9 +7129,9 @@ var CodexEventParser = class {
7051
7129
  }
7052
7130
  }
7053
7131
  if (itemType === "file_change" && item.changes && item.changes.length > 0) {
7054
- const changes = item.changes.map((c24) => {
7055
- const action = c24.kind === "add" ? "Created" : c24.kind === "modify" ? "Modified" : "Deleted";
7056
- return `${action}: ${c24.path}`;
7132
+ const changes = item.changes.map((c25) => {
7133
+ const action = c25.kind === "add" ? "Created" : c25.kind === "modify" ? "Modified" : "Deleted";
7134
+ return `${action}: ${c25.path}`;
7057
7135
  }).join("\n");
7058
7136
  return {
7059
7137
  type: "text",
@@ -7207,9 +7285,9 @@ var CodexEventRenderer = class {
7207
7285
  return;
7208
7286
  }
7209
7287
  if (itemType === "file_change" && item.changes && item.changes.length > 0) {
7210
- const summary = item.changes.map((c24) => {
7211
- const icon = c24.kind === "add" ? "+" : c24.kind === "delete" ? "-" : "~";
7212
- return `${icon}${c24.path}`;
7288
+ const summary = item.changes.map((c25) => {
7289
+ const icon = c25.kind === "add" ? "+" : c25.kind === "delete" ? "-" : "~";
7290
+ return `${icon}${c25.path}`;
7213
7291
  }).join(", ");
7214
7292
  console.log(chalk11.green("[files]") + ` ${summary}`);
7215
7293
  return;
@@ -7230,7 +7308,7 @@ var CodexEventRenderer = class {
7230
7308
  };
7231
7309
 
7232
7310
  // src/lib/api/api-client.ts
7233
- import { initClient as initClient11 } from "@ts-rest/core";
7311
+ import { initClient as initClient12 } from "@ts-rest/core";
7234
7312
  var ApiClient = class {
7235
7313
  async getHeaders() {
7236
7314
  const token = await getToken();
@@ -7256,7 +7334,7 @@ var ApiClient = class {
7256
7334
  async getComposeByName(name, scope) {
7257
7335
  const baseUrl = await this.getBaseUrl();
7258
7336
  const headers = await this.getHeaders();
7259
- const client = initClient11(composesMainContract, {
7337
+ const client = initClient12(composesMainContract, {
7260
7338
  baseUrl,
7261
7339
  baseHeaders: headers,
7262
7340
  jsonQuery: false
@@ -7277,7 +7355,7 @@ var ApiClient = class {
7277
7355
  async getComposeById(id) {
7278
7356
  const baseUrl = await this.getBaseUrl();
7279
7357
  const headers = await this.getHeaders();
7280
- const client = initClient11(composesByIdContract, {
7358
+ const client = initClient12(composesByIdContract, {
7281
7359
  baseUrl,
7282
7360
  baseHeaders: headers,
7283
7361
  jsonQuery: false
@@ -7299,7 +7377,7 @@ var ApiClient = class {
7299
7377
  async getComposeVersion(composeId, version) {
7300
7378
  const baseUrl = await this.getBaseUrl();
7301
7379
  const headers = await this.getHeaders();
7302
- const client = initClient11(composesVersionsContract, {
7380
+ const client = initClient12(composesVersionsContract, {
7303
7381
  baseUrl,
7304
7382
  baseHeaders: headers,
7305
7383
  jsonQuery: false
@@ -7320,7 +7398,7 @@ var ApiClient = class {
7320
7398
  async createOrUpdateCompose(body) {
7321
7399
  const baseUrl = await this.getBaseUrl();
7322
7400
  const headers = await this.getHeaders();
7323
- const client = initClient11(composesMainContract, {
7401
+ const client = initClient12(composesMainContract, {
7324
7402
  baseUrl,
7325
7403
  baseHeaders: headers,
7326
7404
  jsonQuery: false
@@ -7343,7 +7421,7 @@ var ApiClient = class {
7343
7421
  async createRun(body) {
7344
7422
  const baseUrl = await this.getBaseUrl();
7345
7423
  const headers = await this.getHeaders();
7346
- const client = initClient11(runsMainContract, {
7424
+ const client = initClient12(runsMainContract, {
7347
7425
  baseUrl,
7348
7426
  baseHeaders: headers,
7349
7427
  jsonQuery: false
@@ -7359,7 +7437,7 @@ var ApiClient = class {
7359
7437
  async getEvents(runId, options) {
7360
7438
  const baseUrl = await this.getBaseUrl();
7361
7439
  const headers = await this.getHeaders();
7362
- const client = initClient11(runEventsContract, {
7440
+ const client = initClient12(runEventsContract, {
7363
7441
  baseUrl,
7364
7442
  baseHeaders: headers,
7365
7443
  jsonQuery: false
@@ -7381,7 +7459,7 @@ var ApiClient = class {
7381
7459
  async getSystemLog(runId, options) {
7382
7460
  const baseUrl = await this.getBaseUrl();
7383
7461
  const headers = await this.getHeaders();
7384
- const client = initClient11(runSystemLogContract, {
7462
+ const client = initClient12(runSystemLogContract, {
7385
7463
  baseUrl,
7386
7464
  baseHeaders: headers,
7387
7465
  jsonQuery: false
@@ -7404,7 +7482,7 @@ var ApiClient = class {
7404
7482
  async getMetrics(runId, options) {
7405
7483
  const baseUrl = await this.getBaseUrl();
7406
7484
  const headers = await this.getHeaders();
7407
- const client = initClient11(runMetricsContract, {
7485
+ const client = initClient12(runMetricsContract, {
7408
7486
  baseUrl,
7409
7487
  baseHeaders: headers,
7410
7488
  jsonQuery: false
@@ -7427,7 +7505,7 @@ var ApiClient = class {
7427
7505
  async getAgentEvents(runId, options) {
7428
7506
  const baseUrl = await this.getBaseUrl();
7429
7507
  const headers = await this.getHeaders();
7430
- const client = initClient11(runAgentEventsContract, {
7508
+ const client = initClient12(runAgentEventsContract, {
7431
7509
  baseUrl,
7432
7510
  baseHeaders: headers,
7433
7511
  jsonQuery: false
@@ -7450,7 +7528,7 @@ var ApiClient = class {
7450
7528
  async getNetworkLogs(runId, options) {
7451
7529
  const baseUrl = await this.getBaseUrl();
7452
7530
  const headers = await this.getHeaders();
7453
- const client = initClient11(runNetworkLogsContract, {
7531
+ const client = initClient12(runNetworkLogsContract, {
7454
7532
  baseUrl,
7455
7533
  baseHeaders: headers,
7456
7534
  jsonQuery: false
@@ -7476,7 +7554,7 @@ var ApiClient = class {
7476
7554
  async getScope() {
7477
7555
  const baseUrl = await this.getBaseUrl();
7478
7556
  const headers = await this.getHeaders();
7479
- const client = initClient11(scopeContract, {
7557
+ const client = initClient12(scopeContract, {
7480
7558
  baseUrl,
7481
7559
  baseHeaders: headers,
7482
7560
  jsonQuery: false
@@ -7495,7 +7573,7 @@ var ApiClient = class {
7495
7573
  async createScope(body) {
7496
7574
  const baseUrl = await this.getBaseUrl();
7497
7575
  const headers = await this.getHeaders();
7498
- const client = initClient11(scopeContract, {
7576
+ const client = initClient12(scopeContract, {
7499
7577
  baseUrl,
7500
7578
  baseHeaders: headers,
7501
7579
  jsonQuery: false
@@ -7514,7 +7592,7 @@ var ApiClient = class {
7514
7592
  async updateScope(body) {
7515
7593
  const baseUrl = await this.getBaseUrl();
7516
7594
  const headers = await this.getHeaders();
7517
- const client = initClient11(scopeContract, {
7595
+ const client = initClient12(scopeContract, {
7518
7596
  baseUrl,
7519
7597
  baseHeaders: headers,
7520
7598
  jsonQuery: false
@@ -7534,7 +7612,7 @@ var ApiClient = class {
7534
7612
  async getSession(sessionId) {
7535
7613
  const baseUrl = await this.getBaseUrl();
7536
7614
  const headers = await this.getHeaders();
7537
- const client = initClient11(sessionsByIdContract, {
7615
+ const client = initClient12(sessionsByIdContract, {
7538
7616
  baseUrl,
7539
7617
  baseHeaders: headers,
7540
7618
  jsonQuery: false
@@ -7556,7 +7634,7 @@ var ApiClient = class {
7556
7634
  async getCheckpoint(checkpointId) {
7557
7635
  const baseUrl = await this.getBaseUrl();
7558
7636
  const headers = await this.getHeaders();
7559
- const client = initClient11(checkpointsByIdContract, {
7637
+ const client = initClient12(checkpointsByIdContract, {
7560
7638
  baseUrl,
7561
7639
  baseHeaders: headers,
7562
7640
  jsonQuery: false
@@ -7577,7 +7655,7 @@ var ApiClient = class {
7577
7655
  async prepareStorage(body) {
7578
7656
  const baseUrl = await this.getBaseUrl();
7579
7657
  const headers = await this.getHeaders();
7580
- const client = initClient11(storagesPrepareContract, {
7658
+ const client = initClient12(storagesPrepareContract, {
7581
7659
  baseUrl,
7582
7660
  baseHeaders: headers,
7583
7661
  jsonQuery: false
@@ -7596,7 +7674,7 @@ var ApiClient = class {
7596
7674
  async commitStorage(body) {
7597
7675
  const baseUrl = await this.getBaseUrl();
7598
7676
  const headers = await this.getHeaders();
7599
- const client = initClient11(storagesCommitContract, {
7677
+ const client = initClient12(storagesCommitContract, {
7600
7678
  baseUrl,
7601
7679
  baseHeaders: headers,
7602
7680
  jsonQuery: false
@@ -7615,7 +7693,7 @@ var ApiClient = class {
7615
7693
  async getStorageDownload(query) {
7616
7694
  const baseUrl = await this.getBaseUrl();
7617
7695
  const headers = await this.getHeaders();
7618
- const client = initClient11(storagesDownloadContract, {
7696
+ const client = initClient12(storagesDownloadContract, {
7619
7697
  baseUrl,
7620
7698
  baseHeaders: headers,
7621
7699
  jsonQuery: false
@@ -7640,7 +7718,7 @@ var ApiClient = class {
7640
7718
  async listStorages(query) {
7641
7719
  const baseUrl = await this.getBaseUrl();
7642
7720
  const headers = await this.getHeaders();
7643
- const client = initClient11(storagesListContract, {
7721
+ const client = initClient12(storagesListContract, {
7644
7722
  baseUrl,
7645
7723
  baseHeaders: headers,
7646
7724
  jsonQuery: false
@@ -7660,7 +7738,7 @@ var ApiClient = class {
7660
7738
  async deploySchedule(body) {
7661
7739
  const baseUrl = await this.getBaseUrl();
7662
7740
  const headers = await this.getHeaders();
7663
- const client = initClient11(schedulesMainContract, {
7741
+ const client = initClient12(schedulesMainContract, {
7664
7742
  baseUrl,
7665
7743
  baseHeaders: headers,
7666
7744
  jsonQuery: false
@@ -7679,7 +7757,7 @@ var ApiClient = class {
7679
7757
  async listSchedules() {
7680
7758
  const baseUrl = await this.getBaseUrl();
7681
7759
  const headers = await this.getHeaders();
7682
- const client = initClient11(schedulesMainContract, {
7760
+ const client = initClient12(schedulesMainContract, {
7683
7761
  baseUrl,
7684
7762
  baseHeaders: headers,
7685
7763
  jsonQuery: false
@@ -7698,7 +7776,7 @@ var ApiClient = class {
7698
7776
  async getScheduleByName(params) {
7699
7777
  const baseUrl = await this.getBaseUrl();
7700
7778
  const headers = await this.getHeaders();
7701
- const client = initClient11(schedulesByNameContract, {
7779
+ const client = initClient12(schedulesByNameContract, {
7702
7780
  baseUrl,
7703
7781
  baseHeaders: headers,
7704
7782
  jsonQuery: false
@@ -7720,7 +7798,7 @@ var ApiClient = class {
7720
7798
  async deleteSchedule(params) {
7721
7799
  const baseUrl = await this.getBaseUrl();
7722
7800
  const headers = await this.getHeaders();
7723
- const client = initClient11(schedulesByNameContract, {
7801
+ const client = initClient12(schedulesByNameContract, {
7724
7802
  baseUrl,
7725
7803
  baseHeaders: headers,
7726
7804
  jsonQuery: false
@@ -7742,7 +7820,7 @@ var ApiClient = class {
7742
7820
  async enableSchedule(params) {
7743
7821
  const baseUrl = await this.getBaseUrl();
7744
7822
  const headers = await this.getHeaders();
7745
- const client = initClient11(schedulesEnableContract, {
7823
+ const client = initClient12(schedulesEnableContract, {
7746
7824
  baseUrl,
7747
7825
  baseHeaders: headers,
7748
7826
  jsonQuery: false
@@ -7764,7 +7842,7 @@ var ApiClient = class {
7764
7842
  async disableSchedule(params) {
7765
7843
  const baseUrl = await this.getBaseUrl();
7766
7844
  const headers = await this.getHeaders();
7767
- const client = initClient11(schedulesEnableContract, {
7845
+ const client = initClient12(schedulesEnableContract, {
7768
7846
  baseUrl,
7769
7847
  baseHeaders: headers,
7770
7848
  jsonQuery: false
@@ -7786,7 +7864,7 @@ var ApiClient = class {
7786
7864
  async listScheduleRuns(params) {
7787
7865
  const baseUrl = await this.getBaseUrl();
7788
7866
  const headers = await this.getHeaders();
7789
- const client = initClient11(scheduleRunsContract, {
7867
+ const client = initClient12(scheduleRunsContract, {
7790
7868
  baseUrl,
7791
7869
  baseHeaders: headers,
7792
7870
  jsonQuery: false
@@ -7811,7 +7889,7 @@ var ApiClient = class {
7811
7889
  async listPublicAgents(query) {
7812
7890
  const baseUrl = await this.getBaseUrl();
7813
7891
  const headers = await this.getHeaders();
7814
- const client = initClient11(publicAgentsListContract, {
7892
+ const client = initClient12(publicAgentsListContract, {
7815
7893
  baseUrl,
7816
7894
  baseHeaders: headers,
7817
7895
  jsonQuery: false
@@ -7830,7 +7908,7 @@ var ApiClient = class {
7830
7908
  async listPublicArtifacts(query) {
7831
7909
  const baseUrl = await this.getBaseUrl();
7832
7910
  const headers = await this.getHeaders();
7833
- const client = initClient11(publicArtifactsListContract, {
7911
+ const client = initClient12(publicArtifactsListContract, {
7834
7912
  baseUrl,
7835
7913
  baseHeaders: headers,
7836
7914
  jsonQuery: false
@@ -7849,7 +7927,7 @@ var ApiClient = class {
7849
7927
  async getPublicArtifact(id) {
7850
7928
  const baseUrl = await this.getBaseUrl();
7851
7929
  const headers = await this.getHeaders();
7852
- const client = initClient11(publicArtifactByIdContract, {
7930
+ const client = initClient12(publicArtifactByIdContract, {
7853
7931
  baseUrl,
7854
7932
  baseHeaders: headers,
7855
7933
  jsonQuery: false
@@ -7868,7 +7946,7 @@ var ApiClient = class {
7868
7946
  async listPublicVolumes(query) {
7869
7947
  const baseUrl = await this.getBaseUrl();
7870
7948
  const headers = await this.getHeaders();
7871
- const client = initClient11(publicVolumesListContract, {
7949
+ const client = initClient12(publicVolumesListContract, {
7872
7950
  baseUrl,
7873
7951
  baseHeaders: headers,
7874
7952
  jsonQuery: false
@@ -7887,7 +7965,7 @@ var ApiClient = class {
7887
7965
  async getPublicVolume(id) {
7888
7966
  const baseUrl = await this.getBaseUrl();
7889
7967
  const headers = await this.getHeaders();
7890
- const client = initClient11(publicVolumeByIdContract, {
7968
+ const client = initClient12(publicVolumeByIdContract, {
7891
7969
  baseUrl,
7892
7970
  baseHeaders: headers,
7893
7971
  jsonQuery: false
@@ -7926,7 +8004,7 @@ var ApiClient = class {
7926
8004
  async listCredentials() {
7927
8005
  const baseUrl = await this.getBaseUrl();
7928
8006
  const headers = await this.getHeaders();
7929
- const client = initClient11(credentialsMainContract, {
8007
+ const client = initClient12(credentialsMainContract, {
7930
8008
  baseUrl,
7931
8009
  baseHeaders: headers,
7932
8010
  jsonQuery: false
@@ -7945,7 +8023,7 @@ var ApiClient = class {
7945
8023
  async getCredential(name) {
7946
8024
  const baseUrl = await this.getBaseUrl();
7947
8025
  const headers = await this.getHeaders();
7948
- const client = initClient11(credentialsByNameContract, {
8026
+ const client = initClient12(credentialsByNameContract, {
7949
8027
  baseUrl,
7950
8028
  baseHeaders: headers,
7951
8029
  jsonQuery: false
@@ -7966,7 +8044,7 @@ var ApiClient = class {
7966
8044
  async setCredential(body) {
7967
8045
  const baseUrl = await this.getBaseUrl();
7968
8046
  const headers = await this.getHeaders();
7969
- const client = initClient11(credentialsMainContract, {
8047
+ const client = initClient12(credentialsMainContract, {
7970
8048
  baseUrl,
7971
8049
  baseHeaders: headers,
7972
8050
  jsonQuery: false
@@ -7985,7 +8063,7 @@ var ApiClient = class {
7985
8063
  async deleteCredential(name) {
7986
8064
  const baseUrl = await this.getBaseUrl();
7987
8065
  const headers = await this.getHeaders();
7988
- const client = initClient11(credentialsByNameContract, {
8066
+ const client = initClient12(credentialsByNameContract, {
7989
8067
  baseUrl,
7990
8068
  baseHeaders: headers,
7991
8069
  jsonQuery: false
@@ -8006,7 +8084,7 @@ var ApiClient = class {
8006
8084
  async getRealtimeToken(runId) {
8007
8085
  const baseUrl = await this.getBaseUrl();
8008
8086
  const headers = await this.getHeaders();
8009
- const client = initClient11(realtimeTokenContract, {
8087
+ const client = initClient12(realtimeTokenContract, {
8010
8088
  baseUrl,
8011
8089
  baseHeaders: headers,
8012
8090
  jsonQuery: false
@@ -8462,7 +8540,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
8462
8540
  async (identifier, prompt, options) => {
8463
8541
  try {
8464
8542
  if (options.autoUpdate !== false) {
8465
- await startSilentUpgrade("9.34.0");
8543
+ await startSilentUpgrade("9.36.0");
8466
8544
  }
8467
8545
  const { scope, name, version } = parseIdentifier(identifier);
8468
8546
  if (scope && !options.experimentalSharedAgent) {
@@ -10038,7 +10116,7 @@ var cookAction = new Command27().name("cook").description("Quick start: prepare,
10038
10116
  ).option("-y, --yes", "Skip confirmation prompts").option("-v, --verbose", "Show full tool inputs and outputs").addOption(new Option5("--debug-no-mock-claude").hideHelp()).addOption(new Option5("--no-auto-update").hideHelp()).action(
10039
10117
  async (prompt, options) => {
10040
10118
  if (options.autoUpdate !== false) {
10041
- const shouldExit = await checkAndUpgrade("9.34.0", prompt);
10119
+ const shouldExit = await checkAndUpgrade("9.36.0", prompt);
10042
10120
  if (shouldExit) {
10043
10121
  process.exit(0);
10044
10122
  }
@@ -10895,7 +10973,7 @@ var listCommand4 = new Command37().name("list").alias("ls").description("List al
10895
10973
  );
10896
10974
  return;
10897
10975
  }
10898
- const nameWidth = Math.max(4, ...data.composes.map((c24) => c24.name.length));
10976
+ const nameWidth = Math.max(4, ...data.composes.map((c25) => c25.name.length));
10899
10977
  const header = ["NAME".padEnd(nameWidth), "VERSION", "UPDATED"].join(
10900
10978
  " "
10901
10979
  );
@@ -11805,7 +11883,7 @@ async function gatherFrequency(optionFrequency, existingFrequency) {
11805
11883
  );
11806
11884
  process.exit(1);
11807
11885
  }
11808
- const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((c24) => c24.value === existingFrequency) : 0;
11886
+ const defaultIndex = existingFrequency ? FREQUENCY_CHOICES.findIndex((c25) => c25.value === existingFrequency) : 0;
11809
11887
  frequency = await promptSelect(
11810
11888
  "Schedule frequency",
11811
11889
  FREQUENCY_CHOICES,
@@ -11834,7 +11912,7 @@ async function gatherDay(frequency, optionDay, existingDay) {
11834
11912
  process.exit(1);
11835
11913
  }
11836
11914
  if (frequency === "weekly") {
11837
- const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((c24) => c24.value === existingDay) : 0;
11915
+ const defaultDayIndex = existingDay !== void 0 ? DAY_OF_WEEK_CHOICES.findIndex((c25) => c25.value === existingDay) : 0;
11838
11916
  const day2 = await promptSelect(
11839
11917
  "Day of week",
11840
11918
  DAY_OF_WEEK_CHOICES,
@@ -11916,11 +11994,17 @@ async function gatherOneTimeSchedule(optionDay, optionTime, existingTime) {
11916
11994
  }
11917
11995
  async function gatherTimezone(optionTimezone, existingTimezone) {
11918
11996
  if (optionTimezone) return optionTimezone;
11919
- const detectedTimezone = detectTimezone();
11997
+ let userTimezone = null;
11998
+ try {
11999
+ const prefs = await getUserPreferences();
12000
+ userTimezone = prefs.timezone;
12001
+ } catch {
12002
+ }
12003
+ const defaultTimezone = userTimezone || detectTimezone();
11920
12004
  if (!isInteractive()) {
11921
- return detectedTimezone;
12005
+ return defaultTimezone;
11922
12006
  }
11923
- return await promptText("Timezone", existingTimezone || detectedTimezone);
12007
+ return await promptText("Timezone", existingTimezone || defaultTimezone);
11924
12008
  }
11925
12009
  async function gatherPromptText(optionPrompt, existingPrompt) {
11926
12010
  if (optionPrompt) return optionPrompt;
@@ -13531,7 +13615,7 @@ import { Command as Command71 } from "commander";
13531
13615
  // src/commands/connector/connect.ts
13532
13616
  import { Command as Command67 } from "commander";
13533
13617
  import chalk67 from "chalk";
13534
- import { initClient as initClient12 } from "@ts-rest/core";
13618
+ import { initClient as initClient13 } from "@ts-rest/core";
13535
13619
  function delay2(ms) {
13536
13620
  return new Promise((resolve) => setTimeout(resolve, ms));
13537
13621
  }
@@ -13561,7 +13645,7 @@ var connectCommand = new Command67().name("connect").description("Connect a thir
13561
13645
  const apiUrl = await getApiUrl();
13562
13646
  const headers = await getHeaders2();
13563
13647
  console.log(`Connecting ${chalk67.cyan(type2)}...`);
13564
- const sessionsClient = initClient12(connectorSessionsContract, {
13648
+ const sessionsClient = initClient13(connectorSessionsContract, {
13565
13649
  baseUrl: apiUrl,
13566
13650
  baseHeaders: headers,
13567
13651
  jsonQuery: false
@@ -13587,7 +13671,7 @@ To connect, visit: ${verificationUrl}`));
13587
13671
  The session expires in ${Math.floor(session.expiresIn / 60)} minutes.`
13588
13672
  );
13589
13673
  console.log("\nWaiting for authorization...");
13590
- const sessionClient = initClient12(connectorSessionByIdContract, {
13674
+ const sessionClient = initClient13(connectorSessionByIdContract, {
13591
13675
  baseUrl: apiUrl,
13592
13676
  baseHeaders: headers,
13593
13677
  jsonQuery: false
@@ -13660,7 +13744,7 @@ import chalk68 from "chalk";
13660
13744
  var listCommand9 = new Command68().name("list").alias("ls").description("List all connectors and their status").action(
13661
13745
  withErrorHandler(async () => {
13662
13746
  const result = await listConnectors();
13663
- const connectedMap = new Map(result.connectors.map((c24) => [c24.type, c24]));
13747
+ const connectedMap = new Map(result.connectors.map((c25) => [c25.type, c25]));
13664
13748
  const allTypes = Object.keys(CONNECTOR_TYPES);
13665
13749
  const typeWidth = Math.max(4, ...allTypes.map((t) => t.length));
13666
13750
  const statusText = "STATUS";
@@ -14209,16 +14293,16 @@ async function handleModelProvider(ctx) {
14209
14293
  const providerType = await step.prompt(
14210
14294
  () => promptSelect(
14211
14295
  "Select provider type:",
14212
- choices.map((c24) => ({
14213
- title: c24.label,
14214
- value: c24.type
14296
+ choices.map((c25) => ({
14297
+ title: c25.label,
14298
+ value: c25.type
14215
14299
  }))
14216
14300
  )
14217
14301
  );
14218
14302
  if (!providerType) {
14219
14303
  process.exit(0);
14220
14304
  }
14221
- const selectedChoice = choices.find((c24) => c24.type === providerType);
14305
+ const selectedChoice = choices.find((c25) => c25.type === providerType);
14222
14306
  if (selectedChoice?.helpText) {
14223
14307
  for (const line of selectedChoice.helpText.split("\n")) {
14224
14308
  step.detail(chalk74.dim(line));
@@ -14448,7 +14532,7 @@ import { Command as Command76 } from "commander";
14448
14532
  // src/commands/dev-tool/compose.ts
14449
14533
  import { Command as Command75 } from "commander";
14450
14534
  import chalk77 from "chalk";
14451
- import { initClient as initClient13 } from "@ts-rest/core";
14535
+ import { initClient as initClient14 } from "@ts-rest/core";
14452
14536
  function sleep2(ms) {
14453
14537
  return new Promise((resolve) => setTimeout(resolve, ms));
14454
14538
  }
@@ -14457,7 +14541,7 @@ function timestamp() {
14457
14541
  }
14458
14542
  async function createComposeJob(githubUrl, overwrite) {
14459
14543
  const config = await getClientConfig();
14460
- const client = initClient13(composeJobsMainContract, config);
14544
+ const client = initClient14(composeJobsMainContract, config);
14461
14545
  const result = await client.create({
14462
14546
  body: { githubUrl, overwrite }
14463
14547
  });
@@ -14474,7 +14558,7 @@ async function createComposeJob(githubUrl, overwrite) {
14474
14558
  }
14475
14559
  async function getComposeJobStatus(jobId) {
14476
14560
  const config = await getClientConfig();
14477
- const client = initClient13(composeJobsByIdContract, config);
14561
+ const client = initClient14(composeJobsByIdContract, config);
14478
14562
  const result = await client.getById({
14479
14563
  params: { jobId }
14480
14564
  });
@@ -14603,9 +14687,129 @@ function displayResult(job) {
14603
14687
  // src/commands/dev-tool/index.ts
14604
14688
  var devToolCommand = new Command76().name("dev-tool").description("Developer tools for testing and debugging").addCommand(composeCommand2);
14605
14689
 
14690
+ // src/commands/preference/index.ts
14691
+ import { Command as Command77 } from "commander";
14692
+ import chalk78 from "chalk";
14693
+ function detectTimezone2() {
14694
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
14695
+ }
14696
+ function isValidTimezone(timezone) {
14697
+ try {
14698
+ Intl.DateTimeFormat(void 0, { timeZone: timezone });
14699
+ return true;
14700
+ } catch {
14701
+ return false;
14702
+ }
14703
+ }
14704
+ function parseNotifyEmail(value) {
14705
+ const lower = value.toLowerCase();
14706
+ if (lower === "on" || lower === "true" || lower === "1") return true;
14707
+ if (lower === "off" || lower === "false" || lower === "0") return false;
14708
+ throw new Error(
14709
+ `Invalid value for --notify-email: "${value}". Use "on" or "off".`
14710
+ );
14711
+ }
14712
+ function displayPreferences(prefs) {
14713
+ console.log(chalk78.bold("Current preferences:"));
14714
+ console.log(
14715
+ ` Timezone: ${prefs.timezone ? chalk78.cyan(prefs.timezone) : chalk78.dim("not set")}`
14716
+ );
14717
+ console.log(
14718
+ ` Email notify: ${prefs.notifyEmail ? chalk78.green("on") : chalk78.dim("off")}`
14719
+ );
14720
+ }
14721
+ var preferenceCommand = new Command77().name("preference").description("View or update your preferences").option("--timezone <timezone>", "IANA timezone (e.g., America/New_York)").option("--notify-email <on|off>", "Enable or disable email notifications").action(
14722
+ withErrorHandler(
14723
+ async (opts) => {
14724
+ const hasTimezone = opts.timezone !== void 0;
14725
+ const hasNotifyEmail = opts.notifyEmail !== void 0;
14726
+ if (hasTimezone || hasNotifyEmail) {
14727
+ const updates = {};
14728
+ if (hasTimezone) {
14729
+ if (!isValidTimezone(opts.timezone)) {
14730
+ console.error(chalk78.red(`Invalid timezone: ${opts.timezone}`));
14731
+ console.error(
14732
+ chalk78.dim(
14733
+ " Use an IANA timezone identifier (e.g., America/New_York, Asia/Shanghai)"
14734
+ )
14735
+ );
14736
+ process.exit(1);
14737
+ }
14738
+ updates.timezone = opts.timezone;
14739
+ }
14740
+ if (hasNotifyEmail) {
14741
+ try {
14742
+ updates.notifyEmail = parseNotifyEmail(opts.notifyEmail);
14743
+ } catch (err) {
14744
+ console.error(chalk78.red(err.message));
14745
+ process.exit(1);
14746
+ }
14747
+ }
14748
+ const result = await updateUserPreferences(updates);
14749
+ if (updates.timezone !== void 0) {
14750
+ console.log(
14751
+ chalk78.green(
14752
+ `Timezone set to ${chalk78.cyan(result.timezone ?? updates.timezone)}`
14753
+ )
14754
+ );
14755
+ }
14756
+ if (updates.notifyEmail !== void 0) {
14757
+ console.log(
14758
+ chalk78.green(
14759
+ `Email notifications ${result.notifyEmail ? "enabled" : "disabled"}`
14760
+ )
14761
+ );
14762
+ }
14763
+ return;
14764
+ }
14765
+ const prefs = await getUserPreferences();
14766
+ displayPreferences(prefs);
14767
+ if (isInteractive()) {
14768
+ if (!prefs.timezone) {
14769
+ const detectedTz = detectTimezone2();
14770
+ console.log(chalk78.dim(`
14771
+ System timezone detected: ${detectedTz}`));
14772
+ const tz = await promptText(
14773
+ "Set timezone? (enter timezone or leave empty to skip)",
14774
+ detectedTz
14775
+ );
14776
+ if (tz?.trim()) {
14777
+ if (!isValidTimezone(tz.trim())) {
14778
+ console.error(chalk78.red(`Invalid timezone: ${tz.trim()}`));
14779
+ process.exit(1);
14780
+ }
14781
+ await updateUserPreferences({ timezone: tz.trim() });
14782
+ console.log(
14783
+ chalk78.green(`Timezone set to ${chalk78.cyan(tz.trim())}`)
14784
+ );
14785
+ }
14786
+ }
14787
+ if (!prefs.notifyEmail) {
14788
+ const enable = await promptConfirm(
14789
+ "\nEnable email notifications for scheduled runs?",
14790
+ false
14791
+ );
14792
+ if (enable) {
14793
+ await updateUserPreferences({ notifyEmail: true });
14794
+ console.log(chalk78.green("Email notifications enabled"));
14795
+ }
14796
+ }
14797
+ } else if (!prefs.timezone) {
14798
+ console.log();
14799
+ console.log(
14800
+ `To set timezone: ${chalk78.cyan("vm0 preference --timezone <timezone>")}`
14801
+ );
14802
+ console.log(
14803
+ chalk78.dim("Example: vm0 preference --timezone America/New_York")
14804
+ );
14805
+ }
14806
+ }
14807
+ )
14808
+ );
14809
+
14606
14810
  // src/index.ts
14607
- var program = new Command77();
14608
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.34.0");
14811
+ var program = new Command78();
14812
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.36.0");
14609
14813
  program.addCommand(authCommand);
14610
14814
  program.addCommand(infoCommand);
14611
14815
  program.addCommand(composeCommand);
@@ -14626,6 +14830,7 @@ program.addCommand(connectorCommand);
14626
14830
  program.addCommand(onboardCommand);
14627
14831
  program.addCommand(setupClaudeCommand);
14628
14832
  program.addCommand(dashboardCommand);
14833
+ program.addCommand(preferenceCommand);
14629
14834
  program.addCommand(devToolCommand, { hidden: true });
14630
14835
  if (process.argv[1]?.endsWith("index.js") || process.argv[1]?.endsWith("index.ts") || process.argv[1]?.endsWith("vm0")) {
14631
14836
  program.parse();