@wix/auto_sdk_containers_project-jobs 1.0.2 → 1.0.4
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/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js +72 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +58 -2
- package/build/cjs/index.typings.js +64 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +55 -2
- package/build/cjs/meta.js +53 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs +70 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +58 -2
- package/build/es/index.typings.mjs +62 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +55 -2
- package/build/es/meta.mjs +51 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +29 -11
- package/build/internal/cjs/index.typings.d.ts +83 -10
- package/build/internal/cjs/meta.d.ts +55 -2
- package/build/internal/es/index.d.mts +29 -11
- package/build/internal/es/index.typings.d.mts +83 -10
- package/build/internal/es/meta.d.mts +55 -2
- package/package.json +2 -2
|
@@ -76,6 +76,13 @@ interface ProjectJob {
|
|
|
76
76
|
* @maxLength 100000
|
|
77
77
|
*/
|
|
78
78
|
assistantResponse?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* Himalaya release this edit published, persisted when the agent reports AGENT_DONE. Read by
|
|
81
|
+
* containers-projects to post the edit's chat checkpoint. Empty for jobs that publish no release.
|
|
82
|
+
* @readonly
|
|
83
|
+
* @maxLength 100
|
|
84
|
+
*/
|
|
85
|
+
himalayaReleaseId?: string | null;
|
|
79
86
|
/**
|
|
80
87
|
* Whether this job's owner is exempt from AI credits, decided once at creation time.
|
|
81
88
|
* @readonly
|
|
@@ -88,6 +95,14 @@ interface ProjectJob {
|
|
|
88
95
|
* @maxLength 20
|
|
89
96
|
*/
|
|
90
97
|
creditsCostUsd?: string;
|
|
98
|
+
/**
|
|
99
|
+
* The AI-credits cost (in USD) of this edit if the user stops it after the agent started work,
|
|
100
|
+
* resolved at creation time with credits_cost_usd. Set only for USER_REQUEST jobs. Empty for other
|
|
101
|
+
* job types and for jobs created before this field existed, which are not charged when stopped.
|
|
102
|
+
* @readonly
|
|
103
|
+
* @maxLength 20
|
|
104
|
+
*/
|
|
105
|
+
creditsStoppedCostUsd?: string | null;
|
|
91
106
|
/**
|
|
92
107
|
* Chat suggestion chips proposed by a GENERATE_SUGGESTIONS job. Empty for every other job type.
|
|
93
108
|
* Set only via UpdateProjectJobStatus, alongside AGENT_DONE — never at creation time.
|
|
@@ -109,6 +124,13 @@ interface ProjectJob {
|
|
|
109
124
|
* @format GUID
|
|
110
125
|
*/
|
|
111
126
|
initiatingMetaSiteId?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Why a CANCELLED job was cancelled. Set only by StopProjectJob (USER_STOPPED); every other
|
|
129
|
+
* cancellation leaves it unset. containers-projects reads it to cancel the stopped chat turn
|
|
130
|
+
* instead of closing it as an error.
|
|
131
|
+
* @readonly
|
|
132
|
+
*/
|
|
133
|
+
cancelReason?: CancelReasonWithLiterals;
|
|
112
134
|
}
|
|
113
135
|
declare enum JobType {
|
|
114
136
|
INITIAL_GENERATION = "INITIAL_GENERATION",
|
|
@@ -177,6 +199,12 @@ interface Suggestion {
|
|
|
177
199
|
*/
|
|
178
200
|
prompt?: string;
|
|
179
201
|
}
|
|
202
|
+
declare enum CancelReason {
|
|
203
|
+
/** The user stopped the edit from the chat. The worker discards the run; its chat turn is cancelled. */
|
|
204
|
+
USER_STOPPED = "USER_STOPPED"
|
|
205
|
+
}
|
|
206
|
+
/** @enumType */
|
|
207
|
+
type CancelReasonWithLiterals = CancelReason | 'USER_STOPPED';
|
|
180
208
|
interface CreateProjectJobRequest {
|
|
181
209
|
/** ProjectJob to be created. */
|
|
182
210
|
projectJob: ProjectJob;
|
|
@@ -232,6 +260,12 @@ interface UpdateProjectJobStatusRequest {
|
|
|
232
260
|
* @maxLength 100000
|
|
233
261
|
*/
|
|
234
262
|
assistantResponse?: string | null;
|
|
263
|
+
/**
|
|
264
|
+
* Himalaya release the edit published. Only supplied with AGENT_DONE; preserved on later
|
|
265
|
+
* transitions. containers-projects reads it off the job to post the edit's chat checkpoint.
|
|
266
|
+
* @maxLength 100
|
|
267
|
+
*/
|
|
268
|
+
himalayaReleaseId?: string | null;
|
|
235
269
|
}
|
|
236
270
|
interface UpdateProjectJobStatusResponse {
|
|
237
271
|
/** The updated job. */
|
|
@@ -361,6 +395,17 @@ interface CancelProjectJobResponse {
|
|
|
361
395
|
/** The cancelled job. */
|
|
362
396
|
projectJob?: ProjectJob;
|
|
363
397
|
}
|
|
398
|
+
interface StopProjectJobRequest {
|
|
399
|
+
/**
|
|
400
|
+
* ID of the job to stop.
|
|
401
|
+
* @format GUID
|
|
402
|
+
*/
|
|
403
|
+
projectJobId: string;
|
|
404
|
+
}
|
|
405
|
+
interface StopProjectJobResponse {
|
|
406
|
+
/** The stopped job. */
|
|
407
|
+
projectJob?: ProjectJob;
|
|
408
|
+
}
|
|
364
409
|
interface GetLatestProjectJobRequest {
|
|
365
410
|
/**
|
|
366
411
|
* ID of the project to get the latest job for.
|
|
@@ -374,6 +419,11 @@ interface GetLatestProjectJobResponse {
|
|
|
374
419
|
* if the project has no jobs yet.
|
|
375
420
|
*/
|
|
376
421
|
projectJob?: ProjectJob;
|
|
422
|
+
/**
|
|
423
|
+
* Whether Stop Project Job can stop `projectJob` now. Clients show a stop control only when
|
|
424
|
+
* this is true; false when there is no job.
|
|
425
|
+
*/
|
|
426
|
+
stopAvailable?: boolean;
|
|
377
427
|
}
|
|
378
428
|
interface CreateSuggestionsJobRequest {
|
|
379
429
|
/**
|
|
@@ -759,6 +809,12 @@ interface UpdateProjectJobStatusOptions {
|
|
|
759
809
|
* @maxLength 100000
|
|
760
810
|
*/
|
|
761
811
|
assistantResponse?: string | null;
|
|
812
|
+
/**
|
|
813
|
+
* Himalaya release the edit published. Only supplied with AGENT_DONE; preserved on later
|
|
814
|
+
* transitions. containers-projects reads it off the job to post the edit's chat checkpoint.
|
|
815
|
+
* @maxLength 100
|
|
816
|
+
*/
|
|
817
|
+
himalayaReleaseId?: string | null;
|
|
762
818
|
}
|
|
763
819
|
interface QueryProjectJobsOptions {
|
|
764
820
|
/**
|
|
@@ -845,7 +901,7 @@ interface ProjectJobsQueryBuilder {
|
|
|
845
901
|
* @requiredField query
|
|
846
902
|
* @requiredField options
|
|
847
903
|
*/
|
|
848
|
-
declare function typedQueryProjectJobs(query: ProjectJobQuery, options: QueryProjectJobsOptions): Promise<NonNullablePaths<QueryProjectJobsResponse, `projectJobs` | `projectJobs.${number}.projectId` | `projectJobs.${number}.jobType` | `projectJobs.${number}.platform` | `projectJobs.${number}.jobStatus` | `projectJobs.${number}.prompt` | `projectJobs.${number}.codingAgentSessionId` | `projectJobs.${number}.failureReason` | `projectJobs.${number}.creditsExempt` | `projectJobs.${number}.creditsCostUsd` | `projectJobs.${number}.initiatingUserId` | `projectJobs.${number}.initiatingMetaSiteId`, 2>>;
|
|
904
|
+
declare function typedQueryProjectJobs(query: ProjectJobQuery, options: QueryProjectJobsOptions): Promise<NonNullablePaths<QueryProjectJobsResponse, `projectJobs` | `projectJobs.${number}.projectId` | `projectJobs.${number}.jobType` | `projectJobs.${number}.platform` | `projectJobs.${number}.jobStatus` | `projectJobs.${number}.prompt` | `projectJobs.${number}.codingAgentSessionId` | `projectJobs.${number}.failureReason` | `projectJobs.${number}.creditsExempt` | `projectJobs.${number}.creditsCostUsd` | `projectJobs.${number}.initiatingUserId` | `projectJobs.${number}.initiatingMetaSiteId` | `projectJobs.${number}.cancelReason`, 2>>;
|
|
849
905
|
interface ProjectJobQuerySpec extends QuerySpec {
|
|
850
906
|
paging: 'cursor';
|
|
851
907
|
wql: [
|
|
@@ -935,4 +991,4 @@ interface QueryProjectJobActivityOptions {
|
|
|
935
991
|
limit?: number;
|
|
936
992
|
}
|
|
937
993
|
|
|
938
|
-
export { type AccountInfo, type ActionEvent, type ActivityBatch, type ActivityEvent, ActivityEventType, type ActivityEventTypeWithLiterals, ActivitySource, type ActivitySourceWithLiterals, ActivityWorkflow, type ActivityWorkflowWithLiterals, type Attachment, AttachmentType, type AttachmentTypeWithLiterals, type CancelProjectJobRequest, type CancelProjectJobResponse, type ClearProjectJobAssistantResponseRequest, type ClearProjectJobAssistantResponseResponse, type CommonQueryWithEntityContext, type CreateProjectJobRequest, type CreateProjectJobResponse, type CreateSuggestionsJobOptions, type CreateSuggestionsJobRequest, type CreateSuggestionsJobResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetCurrentProjectJobRequest, type GetCurrentProjectJobResponse, type GetLatestProjectJobRequest, type GetLatestProjectJobResponse, type GetProjectJobRequest, type GetProjectJobResponse, type IdentificationData, type IdentificationDataIdOneOf, JobStatus, type JobStatusWithLiterals, JobType, type JobTypeWithLiterals, type MessageEnvelope, type OpenProjectJobActivityRequest, type OpenProjectJobActivityResponse, Platform, type PlatformWithLiterals, type ProjectJob, type ProjectJobQuery, type ProjectJobQuerySpec, type ProjectJobsQueryBuilder, type ProjectJobsQueryResult, type QueryProjectJobActivityOptions, type QueryProjectJobActivityRequest, type QueryProjectJobActivityResponse, type QueryProjectJobsOptions, type QueryProjectJobsRequest, type QueryProjectJobsResponse, type ReportProjectJobActivityRequest, type ReportProjectJobActivityResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Suggestion, type UpdateProjectJobStatusOptions, type UpdateProjectJobStatusRequest, type UpdateProjectJobStatusResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, typedQueryProjectJobs, utils };
|
|
994
|
+
export { type AccountInfo, type ActionEvent, type ActivityBatch, type ActivityEvent, ActivityEventType, type ActivityEventTypeWithLiterals, ActivitySource, type ActivitySourceWithLiterals, ActivityWorkflow, type ActivityWorkflowWithLiterals, type Attachment, AttachmentType, type AttachmentTypeWithLiterals, type CancelProjectJobRequest, type CancelProjectJobResponse, CancelReason, type CancelReasonWithLiterals, type ClearProjectJobAssistantResponseRequest, type ClearProjectJobAssistantResponseResponse, type CommonQueryWithEntityContext, type CreateProjectJobRequest, type CreateProjectJobResponse, type CreateSuggestionsJobOptions, type CreateSuggestionsJobRequest, type CreateSuggestionsJobResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetCurrentProjectJobRequest, type GetCurrentProjectJobResponse, type GetLatestProjectJobRequest, type GetLatestProjectJobResponse, type GetProjectJobRequest, type GetProjectJobResponse, type IdentificationData, type IdentificationDataIdOneOf, JobStatus, type JobStatusWithLiterals, JobType, type JobTypeWithLiterals, type MessageEnvelope, type OpenProjectJobActivityRequest, type OpenProjectJobActivityResponse, Platform, type PlatformWithLiterals, type ProjectJob, type ProjectJobQuery, type ProjectJobQuerySpec, type ProjectJobsQueryBuilder, type ProjectJobsQueryResult, type QueryProjectJobActivityOptions, type QueryProjectJobActivityRequest, type QueryProjectJobActivityResponse, type QueryProjectJobsOptions, type QueryProjectJobsRequest, type QueryProjectJobsResponse, type ReportProjectJobActivityRequest, type ReportProjectJobActivityResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type StopProjectJobRequest, type StopProjectJobResponse, type Suggestion, type UpdateProjectJobStatusOptions, type UpdateProjectJobStatusRequest, type UpdateProjectJobStatusResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, typedQueryProjectJobs, utils };
|
|
@@ -24,6 +24,7 @@ __export(index_typings_exports, {
|
|
|
24
24
|
ActivitySource: () => ActivitySource,
|
|
25
25
|
ActivityWorkflow: () => ActivityWorkflow,
|
|
26
26
|
AttachmentType: () => AttachmentType,
|
|
27
|
+
CancelReason: () => CancelReason,
|
|
27
28
|
JobStatus: () => JobStatus,
|
|
28
29
|
JobType: () => JobType,
|
|
29
30
|
Platform: () => Platform,
|
|
@@ -40,6 +41,7 @@ __export(index_typings_exports, {
|
|
|
40
41
|
queryProjectJobActivity: () => queryProjectJobActivity2,
|
|
41
42
|
queryProjectJobs: () => queryProjectJobs2,
|
|
42
43
|
reportProjectJobActivity: () => reportProjectJobActivity2,
|
|
44
|
+
stopProjectJob: () => stopProjectJob2,
|
|
43
45
|
typedQueryProjectJobs: () => typedQueryProjectJobs,
|
|
44
46
|
updateProjectJobStatus: () => updateProjectJobStatus2,
|
|
45
47
|
utils: () => utils
|
|
@@ -287,6 +289,33 @@ function cancelProjectJob(payload) {
|
|
|
287
289
|
}
|
|
288
290
|
return __cancelProjectJob;
|
|
289
291
|
}
|
|
292
|
+
function stopProjectJob(payload) {
|
|
293
|
+
function __stopProjectJob({ host }) {
|
|
294
|
+
const metadata = {
|
|
295
|
+
entityFqdn: "wix.containers.project_jobs.v1.project_job",
|
|
296
|
+
method: "POST",
|
|
297
|
+
methodFqn: "wix.containers.project.jobs.v1.ContainersProjectJobs.StopProjectJob",
|
|
298
|
+
packageName: PACKAGE_NAME,
|
|
299
|
+
migrationOptions: {
|
|
300
|
+
optInTransformResponse: true
|
|
301
|
+
},
|
|
302
|
+
url: resolveWixContainersProjectJobsV1ContainersProjectJobsUrl({
|
|
303
|
+
protoPath: "/v1/project-jobs/{projectJobId}/stop",
|
|
304
|
+
data: payload,
|
|
305
|
+
host
|
|
306
|
+
}),
|
|
307
|
+
data: payload,
|
|
308
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
309
|
+
{
|
|
310
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
311
|
+
paths: TRANSFORM_PATHS_0
|
|
312
|
+
}
|
|
313
|
+
])
|
|
314
|
+
};
|
|
315
|
+
return metadata;
|
|
316
|
+
}
|
|
317
|
+
return __stopProjectJob;
|
|
318
|
+
}
|
|
290
319
|
function getLatestProjectJob(payload) {
|
|
291
320
|
function __getLatestProjectJob({ host }) {
|
|
292
321
|
const metadata = {
|
|
@@ -436,6 +465,10 @@ var AttachmentType = /* @__PURE__ */ ((AttachmentType2) => {
|
|
|
436
465
|
AttachmentType2["URL"] = "URL";
|
|
437
466
|
return AttachmentType2;
|
|
438
467
|
})(AttachmentType || {});
|
|
468
|
+
var CancelReason = /* @__PURE__ */ ((CancelReason2) => {
|
|
469
|
+
CancelReason2["USER_STOPPED"] = "USER_STOPPED";
|
|
470
|
+
return CancelReason2;
|
|
471
|
+
})(CancelReason || {});
|
|
439
472
|
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
440
473
|
SortOrder2["ASC"] = "ASC";
|
|
441
474
|
SortOrder2["DESC"] = "DESC";
|
|
@@ -559,7 +592,8 @@ async function updateProjectJobStatus2(projectJobId, jobStatus, options) {
|
|
|
559
592
|
revision: options?.revision,
|
|
560
593
|
failureReason: options?.failureReason,
|
|
561
594
|
suggestions: options?.suggestions,
|
|
562
|
-
assistantResponse: options?.assistantResponse
|
|
595
|
+
assistantResponse: options?.assistantResponse,
|
|
596
|
+
himalayaReleaseId: options?.himalayaReleaseId
|
|
563
597
|
});
|
|
564
598
|
const reqOpts = updateProjectJobStatus(
|
|
565
599
|
payload
|
|
@@ -580,7 +614,8 @@ async function updateProjectJobStatus2(projectJobId, jobStatus, options) {
|
|
|
580
614
|
revision: "$[2].revision",
|
|
581
615
|
failureReason: "$[2].failureReason",
|
|
582
616
|
suggestions: "$[2].suggestions",
|
|
583
|
-
assistantResponse: "$[2].assistantResponse"
|
|
617
|
+
assistantResponse: "$[2].assistantResponse",
|
|
618
|
+
himalayaReleaseId: "$[2].himalayaReleaseId"
|
|
584
619
|
},
|
|
585
620
|
singleArgumentUnchanged: false
|
|
586
621
|
},
|
|
@@ -718,6 +753,31 @@ async function cancelProjectJob2(projectJobId, revision) {
|
|
|
718
753
|
throw transformedError;
|
|
719
754
|
}
|
|
720
755
|
}
|
|
756
|
+
async function stopProjectJob2(projectJobId) {
|
|
757
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
758
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
759
|
+
projectJobId
|
|
760
|
+
});
|
|
761
|
+
const reqOpts = stopProjectJob(payload);
|
|
762
|
+
sideEffects?.onSiteCall?.();
|
|
763
|
+
try {
|
|
764
|
+
const result = await httpClient.request(reqOpts);
|
|
765
|
+
sideEffects?.onSuccess?.(result);
|
|
766
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
767
|
+
} catch (err) {
|
|
768
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
769
|
+
err,
|
|
770
|
+
{
|
|
771
|
+
spreadPathsToArguments: {},
|
|
772
|
+
explicitPathsToArguments: { projectJobId: "$[0]" },
|
|
773
|
+
singleArgumentUnchanged: false
|
|
774
|
+
},
|
|
775
|
+
["projectJobId"]
|
|
776
|
+
);
|
|
777
|
+
sideEffects?.onError?.(err);
|
|
778
|
+
throw transformedError;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
721
781
|
async function getLatestProjectJob2(projectId) {
|
|
722
782
|
const { httpClient, sideEffects } = arguments[1];
|
|
723
783
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -873,6 +933,7 @@ async function queryProjectJobActivity2(projectJobId, options) {
|
|
|
873
933
|
ActivitySource,
|
|
874
934
|
ActivityWorkflow,
|
|
875
935
|
AttachmentType,
|
|
936
|
+
CancelReason,
|
|
876
937
|
JobStatus,
|
|
877
938
|
JobType,
|
|
878
939
|
Platform,
|
|
@@ -889,6 +950,7 @@ async function queryProjectJobActivity2(projectJobId, options) {
|
|
|
889
950
|
queryProjectJobActivity,
|
|
890
951
|
queryProjectJobs,
|
|
891
952
|
reportProjectJobActivity,
|
|
953
|
+
stopProjectJob,
|
|
892
954
|
typedQueryProjectJobs,
|
|
893
955
|
updateProjectJobStatus,
|
|
894
956
|
utils
|