@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.
@@ -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 };
@@ -242,6 +242,33 @@ function cancelProjectJob(payload) {
242
242
  }
243
243
  return __cancelProjectJob;
244
244
  }
245
+ function stopProjectJob(payload) {
246
+ function __stopProjectJob({ host }) {
247
+ const metadata = {
248
+ entityFqdn: "wix.containers.project_jobs.v1.project_job",
249
+ method: "POST",
250
+ methodFqn: "wix.containers.project.jobs.v1.ContainersProjectJobs.StopProjectJob",
251
+ packageName: PACKAGE_NAME,
252
+ migrationOptions: {
253
+ optInTransformResponse: true
254
+ },
255
+ url: resolveWixContainersProjectJobsV1ContainersProjectJobsUrl({
256
+ protoPath: "/v1/project-jobs/{projectJobId}/stop",
257
+ data: payload,
258
+ host
259
+ }),
260
+ data: payload,
261
+ transformResponse: (payload2) => transformPaths(payload2, [
262
+ {
263
+ transformFn: transformRESTTimestampToSDKTimestamp,
264
+ paths: TRANSFORM_PATHS_0
265
+ }
266
+ ])
267
+ };
268
+ return metadata;
269
+ }
270
+ return __stopProjectJob;
271
+ }
245
272
  function getLatestProjectJob(payload) {
246
273
  function __getLatestProjectJob({ host }) {
247
274
  const metadata = {
@@ -391,6 +418,10 @@ var AttachmentType = /* @__PURE__ */ ((AttachmentType2) => {
391
418
  AttachmentType2["URL"] = "URL";
392
419
  return AttachmentType2;
393
420
  })(AttachmentType || {});
421
+ var CancelReason = /* @__PURE__ */ ((CancelReason2) => {
422
+ CancelReason2["USER_STOPPED"] = "USER_STOPPED";
423
+ return CancelReason2;
424
+ })(CancelReason || {});
394
425
  var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
395
426
  SortOrder2["ASC"] = "ASC";
396
427
  SortOrder2["DESC"] = "DESC";
@@ -514,7 +545,8 @@ async function updateProjectJobStatus2(projectJobId, jobStatus, options) {
514
545
  revision: options?.revision,
515
546
  failureReason: options?.failureReason,
516
547
  suggestions: options?.suggestions,
517
- assistantResponse: options?.assistantResponse
548
+ assistantResponse: options?.assistantResponse,
549
+ himalayaReleaseId: options?.himalayaReleaseId
518
550
  });
519
551
  const reqOpts = updateProjectJobStatus(
520
552
  payload
@@ -535,7 +567,8 @@ async function updateProjectJobStatus2(projectJobId, jobStatus, options) {
535
567
  revision: "$[2].revision",
536
568
  failureReason: "$[2].failureReason",
537
569
  suggestions: "$[2].suggestions",
538
- assistantResponse: "$[2].assistantResponse"
570
+ assistantResponse: "$[2].assistantResponse",
571
+ himalayaReleaseId: "$[2].himalayaReleaseId"
539
572
  },
540
573
  singleArgumentUnchanged: false
541
574
  },
@@ -673,6 +706,31 @@ async function cancelProjectJob2(projectJobId, revision) {
673
706
  throw transformedError;
674
707
  }
675
708
  }
709
+ async function stopProjectJob2(projectJobId) {
710
+ const { httpClient, sideEffects } = arguments[1];
711
+ const payload = renameKeysFromSDKRequestToRESTRequest({
712
+ projectJobId
713
+ });
714
+ const reqOpts = stopProjectJob(payload);
715
+ sideEffects?.onSiteCall?.();
716
+ try {
717
+ const result = await httpClient.request(reqOpts);
718
+ sideEffects?.onSuccess?.(result);
719
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
720
+ } catch (err) {
721
+ const transformedError = sdkTransformError(
722
+ err,
723
+ {
724
+ spreadPathsToArguments: {},
725
+ explicitPathsToArguments: { projectJobId: "$[0]" },
726
+ singleArgumentUnchanged: false
727
+ },
728
+ ["projectJobId"]
729
+ );
730
+ sideEffects?.onError?.(err);
731
+ throw transformedError;
732
+ }
733
+ }
676
734
  async function getLatestProjectJob2(projectId) {
677
735
  const { httpClient, sideEffects } = arguments[1];
678
736
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -827,6 +885,7 @@ export {
827
885
  ActivitySource,
828
886
  ActivityWorkflow,
829
887
  AttachmentType,
888
+ CancelReason,
830
889
  JobStatus,
831
890
  JobType,
832
891
  Platform,
@@ -843,6 +902,7 @@ export {
843
902
  queryProjectJobActivity2 as queryProjectJobActivity,
844
903
  queryProjectJobs2 as queryProjectJobs,
845
904
  reportProjectJobActivity2 as reportProjectJobActivity,
905
+ stopProjectJob2 as stopProjectJob,
846
906
  typedQueryProjectJobs,
847
907
  updateProjectJobStatus2 as updateProjectJobStatus,
848
908
  utils