@vm0/cli 9.95.1 → 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.
- package/{chunk-WN2AD3KW.js → chunk-T53WM66Z.js} +202 -97
- package/chunk-T53WM66Z.js.map +1 -0
- package/index.js +12 -79
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +328 -4
- package/zero.js.map +1 -1
- package/chunk-WN2AD3KW.js.map +0 -1
|
@@ -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.
|
|
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.
|
|
71
|
+
version: "9.96.0",
|
|
72
72
|
command: process.argv.slice(2).join(" ")
|
|
73
73
|
});
|
|
74
74
|
Sentry.setContext("runtime", {
|
|
@@ -29822,11 +29822,42 @@ async function deleteZeroComputerConnector() {
|
|
|
29822
29822
|
handleError(result, "Computer connector not found");
|
|
29823
29823
|
}
|
|
29824
29824
|
|
|
29825
|
-
// src/lib/api/domains/
|
|
29825
|
+
// src/lib/api/domains/zero-runs.ts
|
|
29826
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";
|
|
29827
29858
|
async function getSystemLog(runId, options) {
|
|
29828
29859
|
const config = await getClientConfig();
|
|
29829
|
-
const client =
|
|
29860
|
+
const client = initClient8(runSystemLogContract, config);
|
|
29830
29861
|
const result = await client.getSystemLog({
|
|
29831
29862
|
params: { id: runId },
|
|
29832
29863
|
query: {
|
|
@@ -29842,7 +29873,7 @@ async function getSystemLog(runId, options) {
|
|
|
29842
29873
|
}
|
|
29843
29874
|
async function getMetrics(runId, options) {
|
|
29844
29875
|
const config = await getClientConfig();
|
|
29845
|
-
const client =
|
|
29876
|
+
const client = initClient8(runMetricsContract, config);
|
|
29846
29877
|
const result = await client.getMetrics({
|
|
29847
29878
|
params: { id: runId },
|
|
29848
29879
|
query: {
|
|
@@ -29858,7 +29889,7 @@ async function getMetrics(runId, options) {
|
|
|
29858
29889
|
}
|
|
29859
29890
|
async function getAgentEvents(runId, options) {
|
|
29860
29891
|
const config = await getClientConfig();
|
|
29861
|
-
const client =
|
|
29892
|
+
const client = initClient8(runAgentEventsContract, config);
|
|
29862
29893
|
const result = await client.getAgentEvents({
|
|
29863
29894
|
params: { id: runId },
|
|
29864
29895
|
query: {
|
|
@@ -29874,7 +29905,7 @@ async function getAgentEvents(runId, options) {
|
|
|
29874
29905
|
}
|
|
29875
29906
|
async function getNetworkLogs(runId, options) {
|
|
29876
29907
|
const config = await getClientConfig();
|
|
29877
|
-
const client =
|
|
29908
|
+
const client = initClient8(runNetworkLogsContract, config);
|
|
29878
29909
|
const result = await client.getNetworkLogs({
|
|
29879
29910
|
params: { id: runId },
|
|
29880
29911
|
query: {
|
|
@@ -29890,7 +29921,7 @@ async function getNetworkLogs(runId, options) {
|
|
|
29890
29921
|
}
|
|
29891
29922
|
async function searchLogs(options) {
|
|
29892
29923
|
const config = await getClientConfig();
|
|
29893
|
-
const client =
|
|
29924
|
+
const client = initClient8(logsSearchContract, config);
|
|
29894
29925
|
const result = await client.searchLogs({
|
|
29895
29926
|
query: {
|
|
29896
29927
|
keyword: options.keyword,
|
|
@@ -29909,10 +29940,10 @@ async function searchLogs(options) {
|
|
|
29909
29940
|
}
|
|
29910
29941
|
|
|
29911
29942
|
// src/lib/api/domains/runs.ts
|
|
29912
|
-
import { initClient as
|
|
29943
|
+
import { initClient as initClient9 } from "@ts-rest/core";
|
|
29913
29944
|
async function createRun(body) {
|
|
29914
29945
|
const config = await getClientConfig();
|
|
29915
|
-
const client =
|
|
29946
|
+
const client = initClient9(runsMainContract, config);
|
|
29916
29947
|
const result = await client.create({ body });
|
|
29917
29948
|
if (result.status === 201) {
|
|
29918
29949
|
return result.body;
|
|
@@ -29921,7 +29952,7 @@ async function createRun(body) {
|
|
|
29921
29952
|
}
|
|
29922
29953
|
async function getEvents(runId, options) {
|
|
29923
29954
|
const config = await getClientConfig();
|
|
29924
|
-
const client =
|
|
29955
|
+
const client = initClient9(runEventsContract, config);
|
|
29925
29956
|
const result = await client.getEvents({
|
|
29926
29957
|
params: { id: runId },
|
|
29927
29958
|
query: {
|
|
@@ -29936,7 +29967,7 @@ async function getEvents(runId, options) {
|
|
|
29936
29967
|
}
|
|
29937
29968
|
async function listRuns(params) {
|
|
29938
29969
|
const config = await getClientConfig();
|
|
29939
|
-
const client =
|
|
29970
|
+
const client = initClient9(runsMainContract, config);
|
|
29940
29971
|
const result = await client.list({
|
|
29941
29972
|
query: {
|
|
29942
29973
|
status: params?.status,
|
|
@@ -29953,7 +29984,7 @@ async function listRuns(params) {
|
|
|
29953
29984
|
}
|
|
29954
29985
|
async function getRunQueue() {
|
|
29955
29986
|
const config = await getClientConfig();
|
|
29956
|
-
const client =
|
|
29987
|
+
const client = initClient9(runsQueueContract, config);
|
|
29957
29988
|
const result = await client.getQueue({ headers: {} });
|
|
29958
29989
|
if (result.status === 200) {
|
|
29959
29990
|
return result.body;
|
|
@@ -29962,7 +29993,7 @@ async function getRunQueue() {
|
|
|
29962
29993
|
}
|
|
29963
29994
|
async function cancelRun(runId) {
|
|
29964
29995
|
const config = await getClientConfig();
|
|
29965
|
-
const client =
|
|
29996
|
+
const client = initClient9(runsCancelContract, config);
|
|
29966
29997
|
const result = await client.cancel({
|
|
29967
29998
|
params: { id: runId }
|
|
29968
29999
|
});
|
|
@@ -29973,10 +30004,10 @@ async function cancelRun(runId) {
|
|
|
29973
30004
|
}
|
|
29974
30005
|
|
|
29975
30006
|
// src/lib/api/domains/sessions.ts
|
|
29976
|
-
import { initClient as
|
|
30007
|
+
import { initClient as initClient10 } from "@ts-rest/core";
|
|
29977
30008
|
async function getSession(sessionId) {
|
|
29978
30009
|
const config = await getClientConfig();
|
|
29979
|
-
const client =
|
|
30010
|
+
const client = initClient10(sessionsByIdContract, config);
|
|
29980
30011
|
const result = await client.getById({
|
|
29981
30012
|
params: { id: sessionId }
|
|
29982
30013
|
});
|
|
@@ -29989,7 +30020,7 @@ async function getSession(sessionId) {
|
|
|
29989
30020
|
}
|
|
29990
30021
|
async function getCheckpoint(checkpointId) {
|
|
29991
30022
|
const config = await getClientConfig();
|
|
29992
|
-
const client =
|
|
30023
|
+
const client = initClient10(checkpointsByIdContract, config);
|
|
29993
30024
|
const result = await client.getById({
|
|
29994
30025
|
params: { id: checkpointId }
|
|
29995
30026
|
});
|
|
@@ -30000,10 +30031,10 @@ async function getCheckpoint(checkpointId) {
|
|
|
30000
30031
|
}
|
|
30001
30032
|
|
|
30002
30033
|
// src/lib/api/domains/storages.ts
|
|
30003
|
-
import { initClient as
|
|
30034
|
+
import { initClient as initClient11 } from "@ts-rest/core";
|
|
30004
30035
|
async function prepareStorage(body) {
|
|
30005
30036
|
const config = await getClientConfig();
|
|
30006
|
-
const client =
|
|
30037
|
+
const client = initClient11(storagesPrepareContract, config);
|
|
30007
30038
|
const result = await client.prepare({ body });
|
|
30008
30039
|
if (result.status === 200) {
|
|
30009
30040
|
return result.body;
|
|
@@ -30012,7 +30043,7 @@ async function prepareStorage(body) {
|
|
|
30012
30043
|
}
|
|
30013
30044
|
async function commitStorage(body) {
|
|
30014
30045
|
const config = await getClientConfig();
|
|
30015
|
-
const client =
|
|
30046
|
+
const client = initClient11(storagesCommitContract, config);
|
|
30016
30047
|
const result = await client.commit({ body });
|
|
30017
30048
|
if (result.status === 200) {
|
|
30018
30049
|
return result.body;
|
|
@@ -30021,7 +30052,7 @@ async function commitStorage(body) {
|
|
|
30021
30052
|
}
|
|
30022
30053
|
async function getStorageDownload(query) {
|
|
30023
30054
|
const config = await getClientConfig();
|
|
30024
|
-
const client =
|
|
30055
|
+
const client = initClient11(storagesDownloadContract, config);
|
|
30025
30056
|
const result = await client.download({
|
|
30026
30057
|
query: {
|
|
30027
30058
|
name: query.name,
|
|
@@ -30036,7 +30067,7 @@ async function getStorageDownload(query) {
|
|
|
30036
30067
|
}
|
|
30037
30068
|
async function listStorages(query) {
|
|
30038
30069
|
const config = await getClientConfig();
|
|
30039
|
-
const client =
|
|
30070
|
+
const client = initClient11(storagesListContract, config);
|
|
30040
30071
|
const result = await client.list({ query });
|
|
30041
30072
|
if (result.status === 200) {
|
|
30042
30073
|
return result.body;
|
|
@@ -30045,7 +30076,7 @@ async function listStorages(query) {
|
|
|
30045
30076
|
}
|
|
30046
30077
|
|
|
30047
30078
|
// src/lib/api/domains/zero-orgs.ts
|
|
30048
|
-
import { initClient as
|
|
30079
|
+
import { initClient as initClient12 } from "@ts-rest/core";
|
|
30049
30080
|
async function getUserTokenClientConfig() {
|
|
30050
30081
|
const baseUrl = await getBaseUrl();
|
|
30051
30082
|
const token = await getToken();
|
|
@@ -30063,7 +30094,7 @@ async function getUserTokenClientConfig() {
|
|
|
30063
30094
|
}
|
|
30064
30095
|
async function getZeroOrg() {
|
|
30065
30096
|
const config = await getClientConfig();
|
|
30066
|
-
const client =
|
|
30097
|
+
const client = initClient12(zeroOrgContract, config);
|
|
30067
30098
|
const result = await client.get({ headers: {} });
|
|
30068
30099
|
if (result.status === 200) {
|
|
30069
30100
|
return result.body;
|
|
@@ -30072,7 +30103,7 @@ async function getZeroOrg() {
|
|
|
30072
30103
|
}
|
|
30073
30104
|
async function updateZeroOrg(body) {
|
|
30074
30105
|
const config = await getClientConfig();
|
|
30075
|
-
const client =
|
|
30106
|
+
const client = initClient12(zeroOrgContract, config);
|
|
30076
30107
|
const result = await client.update({ body });
|
|
30077
30108
|
if (result.status === 200) {
|
|
30078
30109
|
return result.body;
|
|
@@ -30081,7 +30112,7 @@ async function updateZeroOrg(body) {
|
|
|
30081
30112
|
}
|
|
30082
30113
|
async function listZeroOrgs() {
|
|
30083
30114
|
const config = await getUserTokenClientConfig();
|
|
30084
|
-
const client =
|
|
30115
|
+
const client = initClient12(zeroOrgListContract, config);
|
|
30085
30116
|
const result = await client.list({ headers: {} });
|
|
30086
30117
|
if (result.status === 200) {
|
|
30087
30118
|
return result.body;
|
|
@@ -30090,7 +30121,7 @@ async function listZeroOrgs() {
|
|
|
30090
30121
|
}
|
|
30091
30122
|
async function getZeroOrgMembers() {
|
|
30092
30123
|
const config = await getClientConfig();
|
|
30093
|
-
const client =
|
|
30124
|
+
const client = initClient12(zeroOrgMembersContract, config);
|
|
30094
30125
|
const result = await client.members({ headers: {} });
|
|
30095
30126
|
if (result.status === 200) {
|
|
30096
30127
|
return result.body;
|
|
@@ -30099,7 +30130,7 @@ async function getZeroOrgMembers() {
|
|
|
30099
30130
|
}
|
|
30100
30131
|
async function inviteZeroOrgMember(email, role = "member") {
|
|
30101
30132
|
const config = await getClientConfig();
|
|
30102
|
-
const client =
|
|
30133
|
+
const client = initClient12(zeroOrgInviteContract, config);
|
|
30103
30134
|
const result = await client.invite({
|
|
30104
30135
|
body: { email, role }
|
|
30105
30136
|
});
|
|
@@ -30110,7 +30141,7 @@ async function inviteZeroOrgMember(email, role = "member") {
|
|
|
30110
30141
|
}
|
|
30111
30142
|
async function removeZeroOrgMember(email) {
|
|
30112
30143
|
const config = await getClientConfig();
|
|
30113
|
-
const client =
|
|
30144
|
+
const client = initClient12(zeroOrgMembersContract, config);
|
|
30114
30145
|
const result = await client.removeMember({
|
|
30115
30146
|
body: { email }
|
|
30116
30147
|
});
|
|
@@ -30121,7 +30152,7 @@ async function removeZeroOrgMember(email) {
|
|
|
30121
30152
|
}
|
|
30122
30153
|
async function leaveZeroOrg() {
|
|
30123
30154
|
const config = await getClientConfig();
|
|
30124
|
-
const client =
|
|
30155
|
+
const client = initClient12(zeroOrgLeaveContract, config);
|
|
30125
30156
|
const result = await client.leave({
|
|
30126
30157
|
body: {}
|
|
30127
30158
|
});
|
|
@@ -30132,7 +30163,7 @@ async function leaveZeroOrg() {
|
|
|
30132
30163
|
}
|
|
30133
30164
|
async function deleteZeroOrg(slug) {
|
|
30134
30165
|
const config = await getClientConfig();
|
|
30135
|
-
const client =
|
|
30166
|
+
const client = initClient12(zeroOrgDeleteContract, config);
|
|
30136
30167
|
const result = await client.delete({
|
|
30137
30168
|
body: { slug }
|
|
30138
30169
|
});
|
|
@@ -30143,7 +30174,7 @@ async function deleteZeroOrg(slug) {
|
|
|
30143
30174
|
}
|
|
30144
30175
|
async function switchZeroOrg(slug) {
|
|
30145
30176
|
const config = await getUserTokenClientConfig();
|
|
30146
|
-
const client =
|
|
30177
|
+
const client = initClient12(cliAuthOrgContract, config);
|
|
30147
30178
|
const result = await client.switchOrg({
|
|
30148
30179
|
headers: {},
|
|
30149
30180
|
body: { slug }
|
|
@@ -30155,10 +30186,10 @@ async function switchZeroOrg(slug) {
|
|
|
30155
30186
|
}
|
|
30156
30187
|
|
|
30157
30188
|
// src/lib/api/domains/zero-org-secrets.ts
|
|
30158
|
-
import { initClient as
|
|
30189
|
+
import { initClient as initClient13 } from "@ts-rest/core";
|
|
30159
30190
|
async function listZeroOrgSecrets() {
|
|
30160
30191
|
const config = await getClientConfig();
|
|
30161
|
-
const client =
|
|
30192
|
+
const client = initClient13(zeroSecretsContract, config);
|
|
30162
30193
|
const result = await client.list({ headers: {} });
|
|
30163
30194
|
if (result.status === 200) {
|
|
30164
30195
|
return result.body;
|
|
@@ -30167,7 +30198,7 @@ async function listZeroOrgSecrets() {
|
|
|
30167
30198
|
}
|
|
30168
30199
|
async function setZeroOrgSecret(body) {
|
|
30169
30200
|
const config = await getClientConfig();
|
|
30170
|
-
const client =
|
|
30201
|
+
const client = initClient13(zeroSecretsContract, config);
|
|
30171
30202
|
const result = await client.set({ body });
|
|
30172
30203
|
if (result.status === 200 || result.status === 201) {
|
|
30173
30204
|
return result.body;
|
|
@@ -30176,7 +30207,7 @@ async function setZeroOrgSecret(body) {
|
|
|
30176
30207
|
}
|
|
30177
30208
|
async function deleteZeroOrgSecret(name) {
|
|
30178
30209
|
const config = await getClientConfig();
|
|
30179
|
-
const client =
|
|
30210
|
+
const client = initClient13(zeroSecretsByNameContract, config);
|
|
30180
30211
|
const result = await client.delete({
|
|
30181
30212
|
params: { name }
|
|
30182
30213
|
});
|
|
@@ -30187,10 +30218,10 @@ async function deleteZeroOrgSecret(name) {
|
|
|
30187
30218
|
}
|
|
30188
30219
|
|
|
30189
30220
|
// src/lib/api/domains/zero-org-variables.ts
|
|
30190
|
-
import { initClient as
|
|
30221
|
+
import { initClient as initClient14 } from "@ts-rest/core";
|
|
30191
30222
|
async function listZeroOrgVariables() {
|
|
30192
30223
|
const config = await getClientConfig();
|
|
30193
|
-
const client =
|
|
30224
|
+
const client = initClient14(zeroVariablesContract, config);
|
|
30194
30225
|
const result = await client.list({ headers: {} });
|
|
30195
30226
|
if (result.status === 200) {
|
|
30196
30227
|
return result.body;
|
|
@@ -30199,7 +30230,7 @@ async function listZeroOrgVariables() {
|
|
|
30199
30230
|
}
|
|
30200
30231
|
async function setZeroOrgVariable(body) {
|
|
30201
30232
|
const config = await getClientConfig();
|
|
30202
|
-
const client =
|
|
30233
|
+
const client = initClient14(zeroVariablesContract, config);
|
|
30203
30234
|
const result = await client.set({ body });
|
|
30204
30235
|
if (result.status === 200 || result.status === 201) {
|
|
30205
30236
|
return result.body;
|
|
@@ -30208,7 +30239,7 @@ async function setZeroOrgVariable(body) {
|
|
|
30208
30239
|
}
|
|
30209
30240
|
async function deleteZeroOrgVariable(name) {
|
|
30210
30241
|
const config = await getClientConfig();
|
|
30211
|
-
const client =
|
|
30242
|
+
const client = initClient14(zeroVariablesByNameContract, config);
|
|
30212
30243
|
const result = await client.delete({
|
|
30213
30244
|
params: { name }
|
|
30214
30245
|
});
|
|
@@ -30219,10 +30250,10 @@ async function deleteZeroOrgVariable(name) {
|
|
|
30219
30250
|
}
|
|
30220
30251
|
|
|
30221
30252
|
// src/lib/api/domains/zero-org-model-providers.ts
|
|
30222
|
-
import { initClient as
|
|
30253
|
+
import { initClient as initClient15 } from "@ts-rest/core";
|
|
30223
30254
|
async function listZeroOrgModelProviders() {
|
|
30224
30255
|
const config = await getClientConfig();
|
|
30225
|
-
const client =
|
|
30256
|
+
const client = initClient15(zeroModelProvidersMainContract, config);
|
|
30226
30257
|
const result = await client.list({ headers: {} });
|
|
30227
30258
|
if (result.status === 200) {
|
|
30228
30259
|
return result.body;
|
|
@@ -30231,7 +30262,7 @@ async function listZeroOrgModelProviders() {
|
|
|
30231
30262
|
}
|
|
30232
30263
|
async function upsertZeroOrgModelProvider(body) {
|
|
30233
30264
|
const config = await getClientConfig();
|
|
30234
|
-
const client =
|
|
30265
|
+
const client = initClient15(zeroModelProvidersMainContract, config);
|
|
30235
30266
|
const result = await client.upsert({ body });
|
|
30236
30267
|
if (result.status === 200 || result.status === 201) {
|
|
30237
30268
|
return result.body;
|
|
@@ -30240,7 +30271,7 @@ async function upsertZeroOrgModelProvider(body) {
|
|
|
30240
30271
|
}
|
|
30241
30272
|
async function deleteZeroOrgModelProvider(type) {
|
|
30242
30273
|
const config = await getClientConfig();
|
|
30243
|
-
const client =
|
|
30274
|
+
const client = initClient15(zeroModelProvidersByTypeContract, config);
|
|
30244
30275
|
const result = await client.delete({
|
|
30245
30276
|
params: { type }
|
|
30246
30277
|
});
|
|
@@ -30251,7 +30282,7 @@ async function deleteZeroOrgModelProvider(type) {
|
|
|
30251
30282
|
}
|
|
30252
30283
|
async function setZeroOrgModelProviderDefault(type) {
|
|
30253
30284
|
const config = await getClientConfig();
|
|
30254
|
-
const client =
|
|
30285
|
+
const client = initClient15(zeroModelProvidersDefaultContract, config);
|
|
30255
30286
|
const result = await client.setDefault({
|
|
30256
30287
|
params: { type }
|
|
30257
30288
|
});
|
|
@@ -30262,7 +30293,7 @@ async function setZeroOrgModelProviderDefault(type) {
|
|
|
30262
30293
|
}
|
|
30263
30294
|
async function updateZeroOrgModelProviderModel(type, selectedModel) {
|
|
30264
30295
|
const config = await getClientConfig();
|
|
30265
|
-
const client =
|
|
30296
|
+
const client = initClient15(zeroModelProvidersUpdateModelContract, config);
|
|
30266
30297
|
const result = await client.updateModel({
|
|
30267
30298
|
params: { type },
|
|
30268
30299
|
body: { selectedModel }
|
|
@@ -30274,52 +30305,52 @@ async function updateZeroOrgModelProviderModel(type, selectedModel) {
|
|
|
30274
30305
|
}
|
|
30275
30306
|
|
|
30276
30307
|
// src/lib/api/domains/zero-agents.ts
|
|
30277
|
-
import { initClient as
|
|
30308
|
+
import { initClient as initClient16 } from "@ts-rest/core";
|
|
30278
30309
|
async function createZeroAgent(body) {
|
|
30279
30310
|
const config = await getClientConfig();
|
|
30280
|
-
const client =
|
|
30311
|
+
const client = initClient16(zeroAgentsMainContract, config);
|
|
30281
30312
|
const result = await client.create({ body });
|
|
30282
30313
|
if (result.status === 201) return result.body;
|
|
30283
30314
|
handleError(result, "Failed to create zero agent");
|
|
30284
30315
|
}
|
|
30285
30316
|
async function listZeroAgents() {
|
|
30286
30317
|
const config = await getClientConfig();
|
|
30287
|
-
const client =
|
|
30318
|
+
const client = initClient16(zeroAgentsMainContract, config);
|
|
30288
30319
|
const result = await client.list({ headers: {} });
|
|
30289
30320
|
if (result.status === 200) return result.body;
|
|
30290
30321
|
handleError(result, "Failed to list zero agents");
|
|
30291
30322
|
}
|
|
30292
30323
|
async function getZeroAgent(id) {
|
|
30293
30324
|
const config = await getClientConfig();
|
|
30294
|
-
const client =
|
|
30325
|
+
const client = initClient16(zeroAgentsByIdContract, config);
|
|
30295
30326
|
const result = await client.get({ params: { id } });
|
|
30296
30327
|
if (result.status === 200) return result.body;
|
|
30297
30328
|
handleError(result, `Zero agent "${id}" not found`);
|
|
30298
30329
|
}
|
|
30299
30330
|
async function updateZeroAgent(id, body) {
|
|
30300
30331
|
const config = await getClientConfig();
|
|
30301
|
-
const client =
|
|
30332
|
+
const client = initClient16(zeroAgentsByIdContract, config);
|
|
30302
30333
|
const result = await client.update({ params: { id }, body });
|
|
30303
30334
|
if (result.status === 200) return result.body;
|
|
30304
30335
|
handleError(result, `Failed to update zero agent "${id}"`);
|
|
30305
30336
|
}
|
|
30306
30337
|
async function deleteZeroAgent(id) {
|
|
30307
30338
|
const config = await getClientConfig();
|
|
30308
|
-
const client =
|
|
30339
|
+
const client = initClient16(zeroAgentsByIdContract, config);
|
|
30309
30340
|
const result = await client.delete({ params: { id } });
|
|
30310
30341
|
if (result.status === 204) return;
|
|
30311
30342
|
handleError(result, `Zero agent "${id}" not found`);
|
|
30312
30343
|
}
|
|
30313
30344
|
async function getZeroAgentInstructions(id) {
|
|
30314
30345
|
const config = await getClientConfig();
|
|
30315
|
-
const client =
|
|
30346
|
+
const client = initClient16(zeroAgentInstructionsContract, config);
|
|
30316
30347
|
const result = await client.get({ params: { id } });
|
|
30317
30348
|
if (result.status === 200) return result.body;
|
|
30318
30349
|
handleError(result, `Failed to get instructions for zero agent "${id}"`);
|
|
30319
30350
|
}
|
|
30320
30351
|
async function getZeroAgentUserConnectors(id) {
|
|
30321
30352
|
const config = await getClientConfig();
|
|
30322
|
-
const client =
|
|
30353
|
+
const client = initClient16(zeroUserConnectorsContract, config);
|
|
30323
30354
|
const result = await client.get({ params: { id } });
|
|
30324
30355
|
if (result.status === 200) return result.body.enabledTypes;
|
|
30325
30356
|
handleError(
|
|
@@ -30329,7 +30360,7 @@ async function getZeroAgentUserConnectors(id) {
|
|
|
30329
30360
|
}
|
|
30330
30361
|
async function updateZeroAgentInstructions(id, content) {
|
|
30331
30362
|
const config = await getClientConfig();
|
|
30332
|
-
const client =
|
|
30363
|
+
const client = initClient16(zeroAgentInstructionsContract, config);
|
|
30333
30364
|
const result = await client.update({
|
|
30334
30365
|
params: { id },
|
|
30335
30366
|
body: { content }
|
|
@@ -30339,48 +30370,48 @@ async function updateZeroAgentInstructions(id, content) {
|
|
|
30339
30370
|
}
|
|
30340
30371
|
|
|
30341
30372
|
// src/lib/api/domains/zero-skills.ts
|
|
30342
|
-
import { initClient as
|
|
30373
|
+
import { initClient as initClient17 } from "@ts-rest/core";
|
|
30343
30374
|
async function listSkills() {
|
|
30344
30375
|
const config = await getClientConfig();
|
|
30345
|
-
const client =
|
|
30376
|
+
const client = initClient17(zeroSkillsCollectionContract, config);
|
|
30346
30377
|
const result = await client.list();
|
|
30347
30378
|
if (result.status === 200) return result.body;
|
|
30348
30379
|
handleError(result, "Failed to list skills");
|
|
30349
30380
|
}
|
|
30350
30381
|
async function createSkill(body) {
|
|
30351
30382
|
const config = await getClientConfig();
|
|
30352
|
-
const client =
|
|
30383
|
+
const client = initClient17(zeroSkillsCollectionContract, config);
|
|
30353
30384
|
const result = await client.create({ body });
|
|
30354
30385
|
if (result.status === 201) return result.body;
|
|
30355
30386
|
handleError(result, `Failed to create skill "${body.name}"`);
|
|
30356
30387
|
}
|
|
30357
30388
|
async function getSkill(name) {
|
|
30358
30389
|
const config = await getClientConfig();
|
|
30359
|
-
const client =
|
|
30390
|
+
const client = initClient17(zeroSkillsDetailContract, config);
|
|
30360
30391
|
const result = await client.get({ params: { name } });
|
|
30361
30392
|
if (result.status === 200) return result.body;
|
|
30362
30393
|
handleError(result, `Skill "${name}" not found`);
|
|
30363
30394
|
}
|
|
30364
30395
|
async function updateSkill(name, body) {
|
|
30365
30396
|
const config = await getClientConfig();
|
|
30366
|
-
const client =
|
|
30397
|
+
const client = initClient17(zeroSkillsDetailContract, config);
|
|
30367
30398
|
const result = await client.update({ params: { name }, body });
|
|
30368
30399
|
if (result.status === 200) return result.body;
|
|
30369
30400
|
handleError(result, `Failed to update skill "${name}"`);
|
|
30370
30401
|
}
|
|
30371
30402
|
async function deleteSkill(name) {
|
|
30372
30403
|
const config = await getClientConfig();
|
|
30373
|
-
const client =
|
|
30404
|
+
const client = initClient17(zeroSkillsDetailContract, config);
|
|
30374
30405
|
const result = await client.delete({ params: { name } });
|
|
30375
30406
|
if (result.status === 204) return;
|
|
30376
30407
|
handleError(result, `Skill "${name}" not found`);
|
|
30377
30408
|
}
|
|
30378
30409
|
|
|
30379
30410
|
// src/lib/api/domains/integrations-slack.ts
|
|
30380
|
-
import { initClient as
|
|
30411
|
+
import { initClient as initClient18 } from "@ts-rest/core";
|
|
30381
30412
|
async function sendSlackMessage(body) {
|
|
30382
30413
|
const config = await getClientConfig();
|
|
30383
|
-
const client =
|
|
30414
|
+
const client = initClient18(integrationsSlackMessageContract, config);
|
|
30384
30415
|
const result = await client.sendMessage({ body, headers: {} });
|
|
30385
30416
|
if (result.status === 200) {
|
|
30386
30417
|
return result.body;
|
|
@@ -30389,7 +30420,7 @@ async function sendSlackMessage(body) {
|
|
|
30389
30420
|
}
|
|
30390
30421
|
async function initSlackFileUpload(body) {
|
|
30391
30422
|
const config = await getClientConfig();
|
|
30392
|
-
const client =
|
|
30423
|
+
const client = initClient18(integrationsSlackUploadInitContract, config);
|
|
30393
30424
|
const result = await client.init({ body, headers: {} });
|
|
30394
30425
|
if (result.status === 200) {
|
|
30395
30426
|
return result.body;
|
|
@@ -30398,7 +30429,7 @@ async function initSlackFileUpload(body) {
|
|
|
30398
30429
|
}
|
|
30399
30430
|
async function completeSlackFileUpload(body) {
|
|
30400
30431
|
const config = await getClientConfig();
|
|
30401
|
-
const client =
|
|
30432
|
+
const client = initClient18(integrationsSlackUploadCompleteContract, config);
|
|
30402
30433
|
const result = await client.complete({ body, headers: {} });
|
|
30403
30434
|
if (result.status === 200) {
|
|
30404
30435
|
return result.body;
|
|
@@ -30407,10 +30438,10 @@ async function completeSlackFileUpload(body) {
|
|
|
30407
30438
|
}
|
|
30408
30439
|
|
|
30409
30440
|
// src/lib/api/domains/zero-schedules.ts
|
|
30410
|
-
import { initClient as
|
|
30441
|
+
import { initClient as initClient19 } from "@ts-rest/core";
|
|
30411
30442
|
async function deployZeroSchedule(body) {
|
|
30412
30443
|
const config = await getClientConfig();
|
|
30413
|
-
const client =
|
|
30444
|
+
const client = initClient19(zeroSchedulesMainContract, config);
|
|
30414
30445
|
const result = await client.deploy({ body });
|
|
30415
30446
|
if (result.status === 200 || result.status === 201) {
|
|
30416
30447
|
return result.body;
|
|
@@ -30419,7 +30450,7 @@ async function deployZeroSchedule(body) {
|
|
|
30419
30450
|
}
|
|
30420
30451
|
async function listZeroSchedules() {
|
|
30421
30452
|
const config = await getClientConfig();
|
|
30422
|
-
const client =
|
|
30453
|
+
const client = initClient19(zeroSchedulesMainContract, config);
|
|
30423
30454
|
const result = await client.list({ headers: {} });
|
|
30424
30455
|
if (result.status === 200) {
|
|
30425
30456
|
return result.body;
|
|
@@ -30428,7 +30459,7 @@ async function listZeroSchedules() {
|
|
|
30428
30459
|
}
|
|
30429
30460
|
async function deleteZeroSchedule(params) {
|
|
30430
30461
|
const config = await getClientConfig();
|
|
30431
|
-
const client =
|
|
30462
|
+
const client = initClient19(zeroSchedulesByNameContract, config);
|
|
30432
30463
|
const result = await client.delete({
|
|
30433
30464
|
params: { name: params.name },
|
|
30434
30465
|
query: { agentId: params.agentId }
|
|
@@ -30440,7 +30471,7 @@ async function deleteZeroSchedule(params) {
|
|
|
30440
30471
|
}
|
|
30441
30472
|
async function enableZeroSchedule(params) {
|
|
30442
30473
|
const config = await getClientConfig();
|
|
30443
|
-
const client =
|
|
30474
|
+
const client = initClient19(zeroSchedulesEnableContract, config);
|
|
30444
30475
|
const result = await client.enable({
|
|
30445
30476
|
params: { name: params.name },
|
|
30446
30477
|
body: { agentId: params.agentId }
|
|
@@ -30452,7 +30483,7 @@ async function enableZeroSchedule(params) {
|
|
|
30452
30483
|
}
|
|
30453
30484
|
async function disableZeroSchedule(params) {
|
|
30454
30485
|
const config = await getClientConfig();
|
|
30455
|
-
const client =
|
|
30486
|
+
const client = initClient19(zeroSchedulesEnableContract, config);
|
|
30456
30487
|
const result = await client.disable({
|
|
30457
30488
|
params: { name: params.name },
|
|
30458
30489
|
body: { agentId: params.agentId }
|
|
@@ -30499,49 +30530,52 @@ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
|
|
|
30499
30530
|
);
|
|
30500
30531
|
}
|
|
30501
30532
|
|
|
30502
|
-
// src/lib/api/domains/zero-
|
|
30503
|
-
import { initClient as
|
|
30504
|
-
async function
|
|
30505
|
-
const config = await getClientConfig();
|
|
30506
|
-
const client = initClient19(zeroRunsMainContract, config);
|
|
30507
|
-
const result = await client.create({ body });
|
|
30508
|
-
if (result.status === 201) return result.body;
|
|
30509
|
-
handleError(result, "Failed to create zero run");
|
|
30510
|
-
}
|
|
30511
|
-
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) {
|
|
30512
30536
|
const config = await getClientConfig();
|
|
30513
|
-
const client =
|
|
30514
|
-
const result = await client.
|
|
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
|
+
});
|
|
30515
30546
|
if (result.status === 200) return result.body;
|
|
30516
|
-
handleError(result,
|
|
30547
|
+
handleError(result, "Failed to list zero logs");
|
|
30517
30548
|
}
|
|
30518
|
-
async function
|
|
30549
|
+
async function searchZeroLogs(options) {
|
|
30519
30550
|
const config = await getClientConfig();
|
|
30520
|
-
const client =
|
|
30521
|
-
const result = await client.
|
|
30522
|
-
params: { id },
|
|
30551
|
+
const client = initClient20(zeroLogsSearchContract, config);
|
|
30552
|
+
const result = await client.searchLogs({
|
|
30523
30553
|
query: {
|
|
30524
|
-
|
|
30525
|
-
|
|
30526
|
-
|
|
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
|
|
30527
30561
|
}
|
|
30528
30562
|
});
|
|
30529
30563
|
if (result.status === 200) return result.body;
|
|
30530
|
-
handleError(result,
|
|
30564
|
+
handleError(result, "Failed to search zero logs");
|
|
30531
30565
|
}
|
|
30532
30566
|
|
|
30533
30567
|
// src/lib/api/domains/zero-ask-user.ts
|
|
30534
|
-
import { initClient as
|
|
30568
|
+
import { initClient as initClient21 } from "@ts-rest/core";
|
|
30535
30569
|
async function postAskUserQuestion(body) {
|
|
30536
30570
|
const config = await getClientConfig();
|
|
30537
|
-
const client =
|
|
30571
|
+
const client = initClient21(zeroAskUserQuestionContract, config);
|
|
30538
30572
|
const result = await client.postQuestion({ body, headers: {} });
|
|
30539
30573
|
if (result.status === 200) return result.body;
|
|
30540
30574
|
handleError(result, "Failed to post question");
|
|
30541
30575
|
}
|
|
30542
30576
|
async function getAskUserAnswer(pendingId) {
|
|
30543
30577
|
const config = await getClientConfig();
|
|
30544
|
-
const client =
|
|
30578
|
+
const client = initClient21(zeroAskUserAnswerContract, config);
|
|
30545
30579
|
const result = await client.getAnswer({
|
|
30546
30580
|
query: { pendingId },
|
|
30547
30581
|
headers: {}
|
|
@@ -31226,6 +31260,73 @@ var EventRenderer = class _EventRenderer {
|
|
|
31226
31260
|
}
|
|
31227
31261
|
};
|
|
31228
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
|
+
|
|
31229
31330
|
// src/commands/run/shared.ts
|
|
31230
31331
|
import chalk5 from "chalk";
|
|
31231
31332
|
import * as fs from "fs";
|
|
@@ -31544,6 +31645,8 @@ export {
|
|
|
31544
31645
|
createZeroRun,
|
|
31545
31646
|
getZeroRun,
|
|
31546
31647
|
getZeroRunAgentEvents,
|
|
31648
|
+
listZeroLogs,
|
|
31649
|
+
searchZeroLogs,
|
|
31547
31650
|
getSystemLog,
|
|
31548
31651
|
getMetrics,
|
|
31549
31652
|
getAgentEvents,
|
|
@@ -31569,6 +31672,8 @@ export {
|
|
|
31569
31672
|
parseIdentifier,
|
|
31570
31673
|
renderRunCreated,
|
|
31571
31674
|
pollEvents,
|
|
31572
|
-
showNextSteps
|
|
31675
|
+
showNextSteps,
|
|
31676
|
+
parseTime,
|
|
31677
|
+
paginate
|
|
31573
31678
|
};
|
|
31574
|
-
//# sourceMappingURL=chunk-
|
|
31679
|
+
//# sourceMappingURL=chunk-T53WM66Z.js.map
|