@vm0/cli 9.95.0 → 9.96.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.
@@ -49,7 +49,7 @@ if (DSN) {
49
49
  Sentry.init({
50
50
  dsn: DSN,
51
51
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
52
- release: "9.95.0",
52
+ release: "9.96.0",
53
53
  sendDefaultPii: false,
54
54
  tracesSampleRate: 0,
55
55
  shutdownTimeout: 500,
@@ -68,7 +68,7 @@ if (DSN) {
68
68
  }
69
69
  });
70
70
  Sentry.setContext("cli", {
71
- version: "9.95.0",
71
+ version: "9.96.0",
72
72
  command: process.argv.slice(2).join(" ")
73
73
  });
74
74
  Sentry.setContext("runtime", {
@@ -852,6 +852,7 @@ var logsListContract = c2.router({
852
852
  list: {
853
853
  method: "GET",
854
854
  path: "/api/zero/logs",
855
+ headers: authHeadersSchema,
855
856
  query: listQuerySchema.extend({
856
857
  search: z5.string().optional(),
857
858
  agent: z5.string().optional(),
@@ -862,7 +863,8 @@ var logsListContract = c2.router({
862
863
  }),
863
864
  responses: {
864
865
  200: logsListResponseSchema,
865
- 401: apiErrorSchema
866
+ 401: apiErrorSchema,
867
+ 403: apiErrorSchema
866
868
  },
867
869
  summary: "List agent run logs with pagination"
868
870
  }
@@ -878,6 +880,7 @@ var logsByIdContract = c2.router({
878
880
  responses: {
879
881
  200: logDetailSchema,
880
882
  401: apiErrorSchema,
883
+ 403: apiErrorSchema,
881
884
  404: apiErrorSchema
882
885
  },
883
886
  summary: "Get agent run log details by ID"
@@ -28201,6 +28204,28 @@ var zeroRunNetworkLogsContract = c25.router({
28201
28204
  summary: "Get network logs for a run"
28202
28205
  }
28203
28206
  });
28207
+ var zeroLogsSearchContract = c25.router({
28208
+ searchLogs: {
28209
+ method: "GET",
28210
+ path: "/api/zero/logs/search",
28211
+ headers: authHeadersSchema,
28212
+ query: z31.object({
28213
+ keyword: z31.string().min(1),
28214
+ agent: z31.string().optional(),
28215
+ runId: z31.string().optional(),
28216
+ since: z31.coerce.number().optional(),
28217
+ limit: z31.coerce.number().min(1).max(50).default(20),
28218
+ before: z31.coerce.number().min(0).max(10).default(0),
28219
+ after: z31.coerce.number().min(0).max(10).default(0)
28220
+ }),
28221
+ responses: {
28222
+ 200: logsSearchResponseSchema,
28223
+ 401: apiErrorSchema,
28224
+ 403: apiErrorSchema
28225
+ },
28226
+ summary: "Search agent events across runs (zero proxy)"
28227
+ }
28228
+ });
28204
28229
 
28205
28230
  // ../../packages/core/src/contracts/zero-schedules.ts
28206
28231
  import { z as z32 } from "zod";
@@ -29797,11 +29822,42 @@ async function deleteZeroComputerConnector() {
29797
29822
  handleError(result, "Computer connector not found");
29798
29823
  }
29799
29824
 
29800
- // src/lib/api/domains/logs.ts
29825
+ // src/lib/api/domains/zero-runs.ts
29801
29826
  import { initClient as initClient7 } from "@ts-rest/core";
29827
+ async function createZeroRun(body) {
29828
+ const config = await getClientConfig();
29829
+ const client = initClient7(zeroRunsMainContract, config);
29830
+ const result = await client.create({ body });
29831
+ if (result.status === 201) return result.body;
29832
+ handleError(result, "Failed to create zero run");
29833
+ }
29834
+ async function getZeroRun(id) {
29835
+ const config = await getClientConfig();
29836
+ const client = initClient7(zeroRunsByIdContract, config);
29837
+ const result = await client.getById({ params: { id } });
29838
+ if (result.status === 200) return result.body;
29839
+ handleError(result, `Failed to get zero run "${id}"`);
29840
+ }
29841
+ async function getZeroRunAgentEvents(id, options) {
29842
+ const config = await getClientConfig();
29843
+ const client = initClient7(zeroRunAgentEventsContract, config);
29844
+ const result = await client.getAgentEvents({
29845
+ params: { id },
29846
+ query: {
29847
+ since: options?.since,
29848
+ limit: options?.limit ?? 100,
29849
+ order: options?.order ?? "asc"
29850
+ }
29851
+ });
29852
+ if (result.status === 200) return result.body;
29853
+ handleError(result, `Failed to get zero run events for "${id}"`);
29854
+ }
29855
+
29856
+ // src/lib/api/domains/logs.ts
29857
+ import { initClient as initClient8 } from "@ts-rest/core";
29802
29858
  async function getSystemLog(runId, options) {
29803
29859
  const config = await getClientConfig();
29804
- const client = initClient7(runSystemLogContract, config);
29860
+ const client = initClient8(runSystemLogContract, config);
29805
29861
  const result = await client.getSystemLog({
29806
29862
  params: { id: runId },
29807
29863
  query: {
@@ -29817,7 +29873,7 @@ async function getSystemLog(runId, options) {
29817
29873
  }
29818
29874
  async function getMetrics(runId, options) {
29819
29875
  const config = await getClientConfig();
29820
- const client = initClient7(runMetricsContract, config);
29876
+ const client = initClient8(runMetricsContract, config);
29821
29877
  const result = await client.getMetrics({
29822
29878
  params: { id: runId },
29823
29879
  query: {
@@ -29833,7 +29889,7 @@ async function getMetrics(runId, options) {
29833
29889
  }
29834
29890
  async function getAgentEvents(runId, options) {
29835
29891
  const config = await getClientConfig();
29836
- const client = initClient7(runAgentEventsContract, config);
29892
+ const client = initClient8(runAgentEventsContract, config);
29837
29893
  const result = await client.getAgentEvents({
29838
29894
  params: { id: runId },
29839
29895
  query: {
@@ -29849,7 +29905,7 @@ async function getAgentEvents(runId, options) {
29849
29905
  }
29850
29906
  async function getNetworkLogs(runId, options) {
29851
29907
  const config = await getClientConfig();
29852
- const client = initClient7(runNetworkLogsContract, config);
29908
+ const client = initClient8(runNetworkLogsContract, config);
29853
29909
  const result = await client.getNetworkLogs({
29854
29910
  params: { id: runId },
29855
29911
  query: {
@@ -29865,7 +29921,7 @@ async function getNetworkLogs(runId, options) {
29865
29921
  }
29866
29922
  async function searchLogs(options) {
29867
29923
  const config = await getClientConfig();
29868
- const client = initClient7(logsSearchContract, config);
29924
+ const client = initClient8(logsSearchContract, config);
29869
29925
  const result = await client.searchLogs({
29870
29926
  query: {
29871
29927
  keyword: options.keyword,
@@ -29884,10 +29940,10 @@ async function searchLogs(options) {
29884
29940
  }
29885
29941
 
29886
29942
  // src/lib/api/domains/runs.ts
29887
- import { initClient as initClient8 } from "@ts-rest/core";
29943
+ import { initClient as initClient9 } from "@ts-rest/core";
29888
29944
  async function createRun(body) {
29889
29945
  const config = await getClientConfig();
29890
- const client = initClient8(runsMainContract, config);
29946
+ const client = initClient9(runsMainContract, config);
29891
29947
  const result = await client.create({ body });
29892
29948
  if (result.status === 201) {
29893
29949
  return result.body;
@@ -29896,7 +29952,7 @@ async function createRun(body) {
29896
29952
  }
29897
29953
  async function getEvents(runId, options) {
29898
29954
  const config = await getClientConfig();
29899
- const client = initClient8(runEventsContract, config);
29955
+ const client = initClient9(runEventsContract, config);
29900
29956
  const result = await client.getEvents({
29901
29957
  params: { id: runId },
29902
29958
  query: {
@@ -29911,7 +29967,7 @@ async function getEvents(runId, options) {
29911
29967
  }
29912
29968
  async function listRuns(params) {
29913
29969
  const config = await getClientConfig();
29914
- const client = initClient8(runsMainContract, config);
29970
+ const client = initClient9(runsMainContract, config);
29915
29971
  const result = await client.list({
29916
29972
  query: {
29917
29973
  status: params?.status,
@@ -29928,7 +29984,7 @@ async function listRuns(params) {
29928
29984
  }
29929
29985
  async function getRunQueue() {
29930
29986
  const config = await getClientConfig();
29931
- const client = initClient8(runsQueueContract, config);
29987
+ const client = initClient9(runsQueueContract, config);
29932
29988
  const result = await client.getQueue({ headers: {} });
29933
29989
  if (result.status === 200) {
29934
29990
  return result.body;
@@ -29937,7 +29993,7 @@ async function getRunQueue() {
29937
29993
  }
29938
29994
  async function cancelRun(runId) {
29939
29995
  const config = await getClientConfig();
29940
- const client = initClient8(runsCancelContract, config);
29996
+ const client = initClient9(runsCancelContract, config);
29941
29997
  const result = await client.cancel({
29942
29998
  params: { id: runId }
29943
29999
  });
@@ -29948,10 +30004,10 @@ async function cancelRun(runId) {
29948
30004
  }
29949
30005
 
29950
30006
  // src/lib/api/domains/sessions.ts
29951
- import { initClient as initClient9 } from "@ts-rest/core";
30007
+ import { initClient as initClient10 } from "@ts-rest/core";
29952
30008
  async function getSession(sessionId) {
29953
30009
  const config = await getClientConfig();
29954
- const client = initClient9(sessionsByIdContract, config);
30010
+ const client = initClient10(sessionsByIdContract, config);
29955
30011
  const result = await client.getById({
29956
30012
  params: { id: sessionId }
29957
30013
  });
@@ -29964,7 +30020,7 @@ async function getSession(sessionId) {
29964
30020
  }
29965
30021
  async function getCheckpoint(checkpointId) {
29966
30022
  const config = await getClientConfig();
29967
- const client = initClient9(checkpointsByIdContract, config);
30023
+ const client = initClient10(checkpointsByIdContract, config);
29968
30024
  const result = await client.getById({
29969
30025
  params: { id: checkpointId }
29970
30026
  });
@@ -29975,10 +30031,10 @@ async function getCheckpoint(checkpointId) {
29975
30031
  }
29976
30032
 
29977
30033
  // src/lib/api/domains/storages.ts
29978
- import { initClient as initClient10 } from "@ts-rest/core";
30034
+ import { initClient as initClient11 } from "@ts-rest/core";
29979
30035
  async function prepareStorage(body) {
29980
30036
  const config = await getClientConfig();
29981
- const client = initClient10(storagesPrepareContract, config);
30037
+ const client = initClient11(storagesPrepareContract, config);
29982
30038
  const result = await client.prepare({ body });
29983
30039
  if (result.status === 200) {
29984
30040
  return result.body;
@@ -29987,7 +30043,7 @@ async function prepareStorage(body) {
29987
30043
  }
29988
30044
  async function commitStorage(body) {
29989
30045
  const config = await getClientConfig();
29990
- const client = initClient10(storagesCommitContract, config);
30046
+ const client = initClient11(storagesCommitContract, config);
29991
30047
  const result = await client.commit({ body });
29992
30048
  if (result.status === 200) {
29993
30049
  return result.body;
@@ -29996,7 +30052,7 @@ async function commitStorage(body) {
29996
30052
  }
29997
30053
  async function getStorageDownload(query) {
29998
30054
  const config = await getClientConfig();
29999
- const client = initClient10(storagesDownloadContract, config);
30055
+ const client = initClient11(storagesDownloadContract, config);
30000
30056
  const result = await client.download({
30001
30057
  query: {
30002
30058
  name: query.name,
@@ -30011,7 +30067,7 @@ async function getStorageDownload(query) {
30011
30067
  }
30012
30068
  async function listStorages(query) {
30013
30069
  const config = await getClientConfig();
30014
- const client = initClient10(storagesListContract, config);
30070
+ const client = initClient11(storagesListContract, config);
30015
30071
  const result = await client.list({ query });
30016
30072
  if (result.status === 200) {
30017
30073
  return result.body;
@@ -30020,7 +30076,7 @@ async function listStorages(query) {
30020
30076
  }
30021
30077
 
30022
30078
  // src/lib/api/domains/zero-orgs.ts
30023
- import { initClient as initClient11 } from "@ts-rest/core";
30079
+ import { initClient as initClient12 } from "@ts-rest/core";
30024
30080
  async function getUserTokenClientConfig() {
30025
30081
  const baseUrl = await getBaseUrl();
30026
30082
  const token = await getToken();
@@ -30038,7 +30094,7 @@ async function getUserTokenClientConfig() {
30038
30094
  }
30039
30095
  async function getZeroOrg() {
30040
30096
  const config = await getClientConfig();
30041
- const client = initClient11(zeroOrgContract, config);
30097
+ const client = initClient12(zeroOrgContract, config);
30042
30098
  const result = await client.get({ headers: {} });
30043
30099
  if (result.status === 200) {
30044
30100
  return result.body;
@@ -30047,7 +30103,7 @@ async function getZeroOrg() {
30047
30103
  }
30048
30104
  async function updateZeroOrg(body) {
30049
30105
  const config = await getClientConfig();
30050
- const client = initClient11(zeroOrgContract, config);
30106
+ const client = initClient12(zeroOrgContract, config);
30051
30107
  const result = await client.update({ body });
30052
30108
  if (result.status === 200) {
30053
30109
  return result.body;
@@ -30056,7 +30112,7 @@ async function updateZeroOrg(body) {
30056
30112
  }
30057
30113
  async function listZeroOrgs() {
30058
30114
  const config = await getUserTokenClientConfig();
30059
- const client = initClient11(zeroOrgListContract, config);
30115
+ const client = initClient12(zeroOrgListContract, config);
30060
30116
  const result = await client.list({ headers: {} });
30061
30117
  if (result.status === 200) {
30062
30118
  return result.body;
@@ -30065,7 +30121,7 @@ async function listZeroOrgs() {
30065
30121
  }
30066
30122
  async function getZeroOrgMembers() {
30067
30123
  const config = await getClientConfig();
30068
- const client = initClient11(zeroOrgMembersContract, config);
30124
+ const client = initClient12(zeroOrgMembersContract, config);
30069
30125
  const result = await client.members({ headers: {} });
30070
30126
  if (result.status === 200) {
30071
30127
  return result.body;
@@ -30074,7 +30130,7 @@ async function getZeroOrgMembers() {
30074
30130
  }
30075
30131
  async function inviteZeroOrgMember(email, role = "member") {
30076
30132
  const config = await getClientConfig();
30077
- const client = initClient11(zeroOrgInviteContract, config);
30133
+ const client = initClient12(zeroOrgInviteContract, config);
30078
30134
  const result = await client.invite({
30079
30135
  body: { email, role }
30080
30136
  });
@@ -30085,7 +30141,7 @@ async function inviteZeroOrgMember(email, role = "member") {
30085
30141
  }
30086
30142
  async function removeZeroOrgMember(email) {
30087
30143
  const config = await getClientConfig();
30088
- const client = initClient11(zeroOrgMembersContract, config);
30144
+ const client = initClient12(zeroOrgMembersContract, config);
30089
30145
  const result = await client.removeMember({
30090
30146
  body: { email }
30091
30147
  });
@@ -30096,7 +30152,7 @@ async function removeZeroOrgMember(email) {
30096
30152
  }
30097
30153
  async function leaveZeroOrg() {
30098
30154
  const config = await getClientConfig();
30099
- const client = initClient11(zeroOrgLeaveContract, config);
30155
+ const client = initClient12(zeroOrgLeaveContract, config);
30100
30156
  const result = await client.leave({
30101
30157
  body: {}
30102
30158
  });
@@ -30107,7 +30163,7 @@ async function leaveZeroOrg() {
30107
30163
  }
30108
30164
  async function deleteZeroOrg(slug) {
30109
30165
  const config = await getClientConfig();
30110
- const client = initClient11(zeroOrgDeleteContract, config);
30166
+ const client = initClient12(zeroOrgDeleteContract, config);
30111
30167
  const result = await client.delete({
30112
30168
  body: { slug }
30113
30169
  });
@@ -30118,7 +30174,7 @@ async function deleteZeroOrg(slug) {
30118
30174
  }
30119
30175
  async function switchZeroOrg(slug) {
30120
30176
  const config = await getUserTokenClientConfig();
30121
- const client = initClient11(cliAuthOrgContract, config);
30177
+ const client = initClient12(cliAuthOrgContract, config);
30122
30178
  const result = await client.switchOrg({
30123
30179
  headers: {},
30124
30180
  body: { slug }
@@ -30130,10 +30186,10 @@ async function switchZeroOrg(slug) {
30130
30186
  }
30131
30187
 
30132
30188
  // src/lib/api/domains/zero-org-secrets.ts
30133
- import { initClient as initClient12 } from "@ts-rest/core";
30189
+ import { initClient as initClient13 } from "@ts-rest/core";
30134
30190
  async function listZeroOrgSecrets() {
30135
30191
  const config = await getClientConfig();
30136
- const client = initClient12(zeroSecretsContract, config);
30192
+ const client = initClient13(zeroSecretsContract, config);
30137
30193
  const result = await client.list({ headers: {} });
30138
30194
  if (result.status === 200) {
30139
30195
  return result.body;
@@ -30142,7 +30198,7 @@ async function listZeroOrgSecrets() {
30142
30198
  }
30143
30199
  async function setZeroOrgSecret(body) {
30144
30200
  const config = await getClientConfig();
30145
- const client = initClient12(zeroSecretsContract, config);
30201
+ const client = initClient13(zeroSecretsContract, config);
30146
30202
  const result = await client.set({ body });
30147
30203
  if (result.status === 200 || result.status === 201) {
30148
30204
  return result.body;
@@ -30151,7 +30207,7 @@ async function setZeroOrgSecret(body) {
30151
30207
  }
30152
30208
  async function deleteZeroOrgSecret(name) {
30153
30209
  const config = await getClientConfig();
30154
- const client = initClient12(zeroSecretsByNameContract, config);
30210
+ const client = initClient13(zeroSecretsByNameContract, config);
30155
30211
  const result = await client.delete({
30156
30212
  params: { name }
30157
30213
  });
@@ -30162,10 +30218,10 @@ async function deleteZeroOrgSecret(name) {
30162
30218
  }
30163
30219
 
30164
30220
  // src/lib/api/domains/zero-org-variables.ts
30165
- import { initClient as initClient13 } from "@ts-rest/core";
30221
+ import { initClient as initClient14 } from "@ts-rest/core";
30166
30222
  async function listZeroOrgVariables() {
30167
30223
  const config = await getClientConfig();
30168
- const client = initClient13(zeroVariablesContract, config);
30224
+ const client = initClient14(zeroVariablesContract, config);
30169
30225
  const result = await client.list({ headers: {} });
30170
30226
  if (result.status === 200) {
30171
30227
  return result.body;
@@ -30174,7 +30230,7 @@ async function listZeroOrgVariables() {
30174
30230
  }
30175
30231
  async function setZeroOrgVariable(body) {
30176
30232
  const config = await getClientConfig();
30177
- const client = initClient13(zeroVariablesContract, config);
30233
+ const client = initClient14(zeroVariablesContract, config);
30178
30234
  const result = await client.set({ body });
30179
30235
  if (result.status === 200 || result.status === 201) {
30180
30236
  return result.body;
@@ -30183,7 +30239,7 @@ async function setZeroOrgVariable(body) {
30183
30239
  }
30184
30240
  async function deleteZeroOrgVariable(name) {
30185
30241
  const config = await getClientConfig();
30186
- const client = initClient13(zeroVariablesByNameContract, config);
30242
+ const client = initClient14(zeroVariablesByNameContract, config);
30187
30243
  const result = await client.delete({
30188
30244
  params: { name }
30189
30245
  });
@@ -30194,10 +30250,10 @@ async function deleteZeroOrgVariable(name) {
30194
30250
  }
30195
30251
 
30196
30252
  // src/lib/api/domains/zero-org-model-providers.ts
30197
- import { initClient as initClient14 } from "@ts-rest/core";
30253
+ import { initClient as initClient15 } from "@ts-rest/core";
30198
30254
  async function listZeroOrgModelProviders() {
30199
30255
  const config = await getClientConfig();
30200
- const client = initClient14(zeroModelProvidersMainContract, config);
30256
+ const client = initClient15(zeroModelProvidersMainContract, config);
30201
30257
  const result = await client.list({ headers: {} });
30202
30258
  if (result.status === 200) {
30203
30259
  return result.body;
@@ -30206,7 +30262,7 @@ async function listZeroOrgModelProviders() {
30206
30262
  }
30207
30263
  async function upsertZeroOrgModelProvider(body) {
30208
30264
  const config = await getClientConfig();
30209
- const client = initClient14(zeroModelProvidersMainContract, config);
30265
+ const client = initClient15(zeroModelProvidersMainContract, config);
30210
30266
  const result = await client.upsert({ body });
30211
30267
  if (result.status === 200 || result.status === 201) {
30212
30268
  return result.body;
@@ -30215,7 +30271,7 @@ async function upsertZeroOrgModelProvider(body) {
30215
30271
  }
30216
30272
  async function deleteZeroOrgModelProvider(type) {
30217
30273
  const config = await getClientConfig();
30218
- const client = initClient14(zeroModelProvidersByTypeContract, config);
30274
+ const client = initClient15(zeroModelProvidersByTypeContract, config);
30219
30275
  const result = await client.delete({
30220
30276
  params: { type }
30221
30277
  });
@@ -30226,7 +30282,7 @@ async function deleteZeroOrgModelProvider(type) {
30226
30282
  }
30227
30283
  async function setZeroOrgModelProviderDefault(type) {
30228
30284
  const config = await getClientConfig();
30229
- const client = initClient14(zeroModelProvidersDefaultContract, config);
30285
+ const client = initClient15(zeroModelProvidersDefaultContract, config);
30230
30286
  const result = await client.setDefault({
30231
30287
  params: { type }
30232
30288
  });
@@ -30237,7 +30293,7 @@ async function setZeroOrgModelProviderDefault(type) {
30237
30293
  }
30238
30294
  async function updateZeroOrgModelProviderModel(type, selectedModel) {
30239
30295
  const config = await getClientConfig();
30240
- const client = initClient14(zeroModelProvidersUpdateModelContract, config);
30296
+ const client = initClient15(zeroModelProvidersUpdateModelContract, config);
30241
30297
  const result = await client.updateModel({
30242
30298
  params: { type },
30243
30299
  body: { selectedModel }
@@ -30249,52 +30305,52 @@ async function updateZeroOrgModelProviderModel(type, selectedModel) {
30249
30305
  }
30250
30306
 
30251
30307
  // src/lib/api/domains/zero-agents.ts
30252
- import { initClient as initClient15 } from "@ts-rest/core";
30308
+ import { initClient as initClient16 } from "@ts-rest/core";
30253
30309
  async function createZeroAgent(body) {
30254
30310
  const config = await getClientConfig();
30255
- const client = initClient15(zeroAgentsMainContract, config);
30311
+ const client = initClient16(zeroAgentsMainContract, config);
30256
30312
  const result = await client.create({ body });
30257
30313
  if (result.status === 201) return result.body;
30258
30314
  handleError(result, "Failed to create zero agent");
30259
30315
  }
30260
30316
  async function listZeroAgents() {
30261
30317
  const config = await getClientConfig();
30262
- const client = initClient15(zeroAgentsMainContract, config);
30318
+ const client = initClient16(zeroAgentsMainContract, config);
30263
30319
  const result = await client.list({ headers: {} });
30264
30320
  if (result.status === 200) return result.body;
30265
30321
  handleError(result, "Failed to list zero agents");
30266
30322
  }
30267
30323
  async function getZeroAgent(id) {
30268
30324
  const config = await getClientConfig();
30269
- const client = initClient15(zeroAgentsByIdContract, config);
30325
+ const client = initClient16(zeroAgentsByIdContract, config);
30270
30326
  const result = await client.get({ params: { id } });
30271
30327
  if (result.status === 200) return result.body;
30272
30328
  handleError(result, `Zero agent "${id}" not found`);
30273
30329
  }
30274
30330
  async function updateZeroAgent(id, body) {
30275
30331
  const config = await getClientConfig();
30276
- const client = initClient15(zeroAgentsByIdContract, config);
30332
+ const client = initClient16(zeroAgentsByIdContract, config);
30277
30333
  const result = await client.update({ params: { id }, body });
30278
30334
  if (result.status === 200) return result.body;
30279
30335
  handleError(result, `Failed to update zero agent "${id}"`);
30280
30336
  }
30281
30337
  async function deleteZeroAgent(id) {
30282
30338
  const config = await getClientConfig();
30283
- const client = initClient15(zeroAgentsByIdContract, config);
30339
+ const client = initClient16(zeroAgentsByIdContract, config);
30284
30340
  const result = await client.delete({ params: { id } });
30285
30341
  if (result.status === 204) return;
30286
30342
  handleError(result, `Zero agent "${id}" not found`);
30287
30343
  }
30288
30344
  async function getZeroAgentInstructions(id) {
30289
30345
  const config = await getClientConfig();
30290
- const client = initClient15(zeroAgentInstructionsContract, config);
30346
+ const client = initClient16(zeroAgentInstructionsContract, config);
30291
30347
  const result = await client.get({ params: { id } });
30292
30348
  if (result.status === 200) return result.body;
30293
30349
  handleError(result, `Failed to get instructions for zero agent "${id}"`);
30294
30350
  }
30295
30351
  async function getZeroAgentUserConnectors(id) {
30296
30352
  const config = await getClientConfig();
30297
- const client = initClient15(zeroUserConnectorsContract, config);
30353
+ const client = initClient16(zeroUserConnectorsContract, config);
30298
30354
  const result = await client.get({ params: { id } });
30299
30355
  if (result.status === 200) return result.body.enabledTypes;
30300
30356
  handleError(
@@ -30304,7 +30360,7 @@ async function getZeroAgentUserConnectors(id) {
30304
30360
  }
30305
30361
  async function updateZeroAgentInstructions(id, content) {
30306
30362
  const config = await getClientConfig();
30307
- const client = initClient15(zeroAgentInstructionsContract, config);
30363
+ const client = initClient16(zeroAgentInstructionsContract, config);
30308
30364
  const result = await client.update({
30309
30365
  params: { id },
30310
30366
  body: { content }
@@ -30314,48 +30370,48 @@ async function updateZeroAgentInstructions(id, content) {
30314
30370
  }
30315
30371
 
30316
30372
  // src/lib/api/domains/zero-skills.ts
30317
- import { initClient as initClient16 } from "@ts-rest/core";
30373
+ import { initClient as initClient17 } from "@ts-rest/core";
30318
30374
  async function listSkills() {
30319
30375
  const config = await getClientConfig();
30320
- const client = initClient16(zeroSkillsCollectionContract, config);
30376
+ const client = initClient17(zeroSkillsCollectionContract, config);
30321
30377
  const result = await client.list();
30322
30378
  if (result.status === 200) return result.body;
30323
30379
  handleError(result, "Failed to list skills");
30324
30380
  }
30325
30381
  async function createSkill(body) {
30326
30382
  const config = await getClientConfig();
30327
- const client = initClient16(zeroSkillsCollectionContract, config);
30383
+ const client = initClient17(zeroSkillsCollectionContract, config);
30328
30384
  const result = await client.create({ body });
30329
30385
  if (result.status === 201) return result.body;
30330
30386
  handleError(result, `Failed to create skill "${body.name}"`);
30331
30387
  }
30332
30388
  async function getSkill(name) {
30333
30389
  const config = await getClientConfig();
30334
- const client = initClient16(zeroSkillsDetailContract, config);
30390
+ const client = initClient17(zeroSkillsDetailContract, config);
30335
30391
  const result = await client.get({ params: { name } });
30336
30392
  if (result.status === 200) return result.body;
30337
30393
  handleError(result, `Skill "${name}" not found`);
30338
30394
  }
30339
30395
  async function updateSkill(name, body) {
30340
30396
  const config = await getClientConfig();
30341
- const client = initClient16(zeroSkillsDetailContract, config);
30397
+ const client = initClient17(zeroSkillsDetailContract, config);
30342
30398
  const result = await client.update({ params: { name }, body });
30343
30399
  if (result.status === 200) return result.body;
30344
30400
  handleError(result, `Failed to update skill "${name}"`);
30345
30401
  }
30346
30402
  async function deleteSkill(name) {
30347
30403
  const config = await getClientConfig();
30348
- const client = initClient16(zeroSkillsDetailContract, config);
30404
+ const client = initClient17(zeroSkillsDetailContract, config);
30349
30405
  const result = await client.delete({ params: { name } });
30350
30406
  if (result.status === 204) return;
30351
30407
  handleError(result, `Skill "${name}" not found`);
30352
30408
  }
30353
30409
 
30354
30410
  // src/lib/api/domains/integrations-slack.ts
30355
- import { initClient as initClient17 } from "@ts-rest/core";
30411
+ import { initClient as initClient18 } from "@ts-rest/core";
30356
30412
  async function sendSlackMessage(body) {
30357
30413
  const config = await getClientConfig();
30358
- const client = initClient17(integrationsSlackMessageContract, config);
30414
+ const client = initClient18(integrationsSlackMessageContract, config);
30359
30415
  const result = await client.sendMessage({ body, headers: {} });
30360
30416
  if (result.status === 200) {
30361
30417
  return result.body;
@@ -30364,7 +30420,7 @@ async function sendSlackMessage(body) {
30364
30420
  }
30365
30421
  async function initSlackFileUpload(body) {
30366
30422
  const config = await getClientConfig();
30367
- const client = initClient17(integrationsSlackUploadInitContract, config);
30423
+ const client = initClient18(integrationsSlackUploadInitContract, config);
30368
30424
  const result = await client.init({ body, headers: {} });
30369
30425
  if (result.status === 200) {
30370
30426
  return result.body;
@@ -30373,7 +30429,7 @@ async function initSlackFileUpload(body) {
30373
30429
  }
30374
30430
  async function completeSlackFileUpload(body) {
30375
30431
  const config = await getClientConfig();
30376
- const client = initClient17(integrationsSlackUploadCompleteContract, config);
30432
+ const client = initClient18(integrationsSlackUploadCompleteContract, config);
30377
30433
  const result = await client.complete({ body, headers: {} });
30378
30434
  if (result.status === 200) {
30379
30435
  return result.body;
@@ -30382,10 +30438,10 @@ async function completeSlackFileUpload(body) {
30382
30438
  }
30383
30439
 
30384
30440
  // src/lib/api/domains/zero-schedules.ts
30385
- import { initClient as initClient18 } from "@ts-rest/core";
30441
+ import { initClient as initClient19 } from "@ts-rest/core";
30386
30442
  async function deployZeroSchedule(body) {
30387
30443
  const config = await getClientConfig();
30388
- const client = initClient18(zeroSchedulesMainContract, config);
30444
+ const client = initClient19(zeroSchedulesMainContract, config);
30389
30445
  const result = await client.deploy({ body });
30390
30446
  if (result.status === 200 || result.status === 201) {
30391
30447
  return result.body;
@@ -30394,7 +30450,7 @@ async function deployZeroSchedule(body) {
30394
30450
  }
30395
30451
  async function listZeroSchedules() {
30396
30452
  const config = await getClientConfig();
30397
- const client = initClient18(zeroSchedulesMainContract, config);
30453
+ const client = initClient19(zeroSchedulesMainContract, config);
30398
30454
  const result = await client.list({ headers: {} });
30399
30455
  if (result.status === 200) {
30400
30456
  return result.body;
@@ -30403,7 +30459,7 @@ async function listZeroSchedules() {
30403
30459
  }
30404
30460
  async function deleteZeroSchedule(params) {
30405
30461
  const config = await getClientConfig();
30406
- const client = initClient18(zeroSchedulesByNameContract, config);
30462
+ const client = initClient19(zeroSchedulesByNameContract, config);
30407
30463
  const result = await client.delete({
30408
30464
  params: { name: params.name },
30409
30465
  query: { agentId: params.agentId }
@@ -30415,7 +30471,7 @@ async function deleteZeroSchedule(params) {
30415
30471
  }
30416
30472
  async function enableZeroSchedule(params) {
30417
30473
  const config = await getClientConfig();
30418
- const client = initClient18(zeroSchedulesEnableContract, config);
30474
+ const client = initClient19(zeroSchedulesEnableContract, config);
30419
30475
  const result = await client.enable({
30420
30476
  params: { name: params.name },
30421
30477
  body: { agentId: params.agentId }
@@ -30427,7 +30483,7 @@ async function enableZeroSchedule(params) {
30427
30483
  }
30428
30484
  async function disableZeroSchedule(params) {
30429
30485
  const config = await getClientConfig();
30430
- const client = initClient18(zeroSchedulesEnableContract, config);
30486
+ const client = initClient19(zeroSchedulesEnableContract, config);
30431
30487
  const result = await client.disable({
30432
30488
  params: { name: params.name },
30433
30489
  body: { agentId: params.agentId }
@@ -30474,49 +30530,52 @@ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
30474
30530
  );
30475
30531
  }
30476
30532
 
30477
- // src/lib/api/domains/zero-runs.ts
30478
- import { initClient as initClient19 } from "@ts-rest/core";
30479
- async function createZeroRun(body) {
30480
- const config = await getClientConfig();
30481
- const client = initClient19(zeroRunsMainContract, config);
30482
- const result = await client.create({ body });
30483
- if (result.status === 201) return result.body;
30484
- handleError(result, "Failed to create zero run");
30485
- }
30486
- async function getZeroRun(id) {
30533
+ // src/lib/api/domains/zero-logs.ts
30534
+ import { initClient as initClient20 } from "@ts-rest/core";
30535
+ async function listZeroLogs(options) {
30487
30536
  const config = await getClientConfig();
30488
- const client = initClient19(zeroRunsByIdContract, config);
30489
- const result = await client.getById({ params: { id } });
30537
+ const client = initClient20(logsListContract, config);
30538
+ const result = await client.list({
30539
+ query: {
30540
+ agent: options?.agent,
30541
+ status: options?.status,
30542
+ limit: options?.limit,
30543
+ cursor: options?.cursor
30544
+ }
30545
+ });
30490
30546
  if (result.status === 200) return result.body;
30491
- handleError(result, `Failed to get zero run "${id}"`);
30547
+ handleError(result, "Failed to list zero logs");
30492
30548
  }
30493
- async function getZeroRunAgentEvents(id, options) {
30549
+ async function searchZeroLogs(options) {
30494
30550
  const config = await getClientConfig();
30495
- const client = initClient19(zeroRunAgentEventsContract, config);
30496
- const result = await client.getAgentEvents({
30497
- params: { id },
30551
+ const client = initClient20(zeroLogsSearchContract, config);
30552
+ const result = await client.searchLogs({
30498
30553
  query: {
30499
- since: options?.since,
30500
- limit: options?.limit ?? 100,
30501
- order: options?.order ?? "asc"
30554
+ keyword: options.keyword,
30555
+ agent: options.agent,
30556
+ runId: options.runId,
30557
+ since: options.since,
30558
+ limit: options.limit,
30559
+ before: options.before,
30560
+ after: options.after
30502
30561
  }
30503
30562
  });
30504
30563
  if (result.status === 200) return result.body;
30505
- handleError(result, `Failed to get zero run events for "${id}"`);
30564
+ handleError(result, "Failed to search zero logs");
30506
30565
  }
30507
30566
 
30508
30567
  // src/lib/api/domains/zero-ask-user.ts
30509
- import { initClient as initClient20 } from "@ts-rest/core";
30568
+ import { initClient as initClient21 } from "@ts-rest/core";
30510
30569
  async function postAskUserQuestion(body) {
30511
30570
  const config = await getClientConfig();
30512
- const client = initClient20(zeroAskUserQuestionContract, config);
30571
+ const client = initClient21(zeroAskUserQuestionContract, config);
30513
30572
  const result = await client.postQuestion({ body, headers: {} });
30514
30573
  if (result.status === 200) return result.body;
30515
30574
  handleError(result, "Failed to post question");
30516
30575
  }
30517
30576
  async function getAskUserAnswer(pendingId) {
30518
30577
  const config = await getClientConfig();
30519
- const client = initClient20(zeroAskUserAnswerContract, config);
30578
+ const client = initClient21(zeroAskUserAnswerContract, config);
30520
30579
  const result = await client.getAnswer({
30521
30580
  query: { pendingId },
30522
30581
  headers: {}
@@ -31201,6 +31260,73 @@ var EventRenderer = class _EventRenderer {
31201
31260
  }
31202
31261
  };
31203
31262
 
31263
+ // src/lib/utils/time-parser.ts
31264
+ function parseTime(timeStr) {
31265
+ const relativeMatch = timeStr.match(/^(\d+)([smhdw])$/);
31266
+ if (relativeMatch) {
31267
+ const value = parseInt(relativeMatch[1], 10);
31268
+ const unit = relativeMatch[2];
31269
+ return parseRelativeTime(value, unit);
31270
+ }
31271
+ if (/^\d+$/.test(timeStr)) {
31272
+ const timestamp = parseInt(timeStr, 10);
31273
+ if (timestamp < 1e10) {
31274
+ return timestamp * 1e3;
31275
+ }
31276
+ return timestamp;
31277
+ }
31278
+ const date = new Date(timeStr);
31279
+ if (!isNaN(date.getTime())) {
31280
+ return date.getTime();
31281
+ }
31282
+ throw new Error(
31283
+ `Invalid time format: "${timeStr}". Supported formats: relative (5m, 2h, 1d), ISO 8601 (2024-01-15T10:30:00Z), Unix timestamp`
31284
+ );
31285
+ }
31286
+ function parseRelativeTime(value, unit) {
31287
+ const now = Date.now();
31288
+ const multipliers = {
31289
+ s: 1e3,
31290
+ // seconds
31291
+ m: 60 * 1e3,
31292
+ // minutes
31293
+ h: 60 * 60 * 1e3,
31294
+ // hours
31295
+ d: 24 * 60 * 60 * 1e3,
31296
+ // days
31297
+ w: 7 * 24 * 60 * 60 * 1e3
31298
+ // weeks
31299
+ };
31300
+ const multiplier = multipliers[unit];
31301
+ if (!multiplier) {
31302
+ throw new Error(`Unknown time unit: ${unit}`);
31303
+ }
31304
+ return now - value * multiplier;
31305
+ }
31306
+
31307
+ // src/lib/utils/paginate.ts
31308
+ async function paginate(options) {
31309
+ const { fetchPage, getTimestamp, targetCount, initialSince } = options;
31310
+ const collected = [];
31311
+ let since = initialSince;
31312
+ let hasMore = true;
31313
+ while (hasMore) {
31314
+ const response = await fetchPage(since);
31315
+ collected.push(...response.items);
31316
+ hasMore = response.hasMore;
31317
+ if (targetCount !== "all" && collected.length >= targetCount) {
31318
+ return collected.slice(0, targetCount);
31319
+ }
31320
+ if (response.items.length > 0) {
31321
+ const lastItem = response.items[response.items.length - 1];
31322
+ since = getTimestamp(lastItem);
31323
+ } else {
31324
+ hasMore = false;
31325
+ }
31326
+ }
31327
+ return collected;
31328
+ }
31329
+
31204
31330
  // src/commands/run/shared.ts
31205
31331
  import chalk5 from "chalk";
31206
31332
  import * as fs from "fs";
@@ -31519,6 +31645,8 @@ export {
31519
31645
  createZeroRun,
31520
31646
  getZeroRun,
31521
31647
  getZeroRunAgentEvents,
31648
+ listZeroLogs,
31649
+ searchZeroLogs,
31522
31650
  getSystemLog,
31523
31651
  getMetrics,
31524
31652
  getAgentEvents,
@@ -31544,6 +31672,8 @@ export {
31544
31672
  parseIdentifier,
31545
31673
  renderRunCreated,
31546
31674
  pollEvents,
31547
- showNextSteps
31675
+ showNextSteps,
31676
+ parseTime,
31677
+ paginate
31548
31678
  };
31549
- //# sourceMappingURL=chunk-RLI2BL4P.js.map
31679
+ //# sourceMappingURL=chunk-T53WM66Z.js.map