@scarn/sdk 0.8.12 → 0.8.15
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/dist/{chunk-p01z6gt9.js → chunk-7bpy3w3z.js} +23 -4
- package/dist/{chunk-r01zh5mv.js → chunk-b8hxjwag.js} +1 -1
- package/dist/{chunk-cezmxzhe.js → chunk-efs789y2.js} +1 -1
- package/dist/{chunk-z9f92ayv.js → chunk-z25n32z0.js} +22 -3
- package/dist/{chunk-p6dt8nej.js → chunk-zf4gwg0p.js} +1 -1
- package/dist/client.js +2 -2
- package/dist/contracts/pipeline-document/schema.d.ts +10 -10
- package/dist/defaults/index.d.ts +1 -1
- package/dist/defaults/index.js +3 -2
- package/dist/definitions/automations/index.js +2 -2
- package/dist/definitions/pipelines/index.js +2 -2
- package/dist/definitions/steps/index.js +2 -2
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/sdk.gen.d.ts +21 -2
- package/dist/generated/types.gen.d.ts +935 -163
- package/dist/index.js +4 -4
- package/dist/push/index.js +4 -4
- package/dist/task-plane-client.d.ts +240 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
WORK_ITEM_TOP_LEVEL_FIELDS,
|
|
10
10
|
createPipelineDefinitionsClient,
|
|
11
11
|
resolveWorkItemFieldPath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-efs789y2.js";
|
|
13
13
|
import {
|
|
14
14
|
after,
|
|
15
15
|
all,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
import {
|
|
63
63
|
createScarnClient,
|
|
64
64
|
createTaskPlaneClient
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-7bpy3w3z.js";
|
|
66
66
|
import"./chunk-61jf8b6s.js";
|
|
67
67
|
import"./chunk-cnxaagfj.js";
|
|
68
68
|
import {
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
resolveMcpChecks,
|
|
100
100
|
toStepHandle,
|
|
101
101
|
toStepSpec
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-zf4gwg0p.js";
|
|
103
103
|
import {
|
|
104
104
|
collectEnvPlaceholderNames,
|
|
105
105
|
isEnvPlaceholderValue,
|
|
@@ -149,7 +149,7 @@ import {
|
|
|
149
149
|
WorkItemCommentDrafts,
|
|
150
150
|
WorkItemComments,
|
|
151
151
|
WorkItems
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-z25n32z0.js";
|
|
153
153
|
import {
|
|
154
154
|
ARTIFACT_MARKER_SCHEME,
|
|
155
155
|
buildArtifactMarker,
|
package/dist/push/index.js
CHANGED
|
@@ -6,18 +6,18 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
AutomationsApiError,
|
|
8
8
|
createAutomationsClient
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-b8hxjwag.js";
|
|
10
10
|
import {
|
|
11
11
|
assertValidDefinitionSpecs
|
|
12
12
|
} from "../chunk-1yb2h6t9.js";
|
|
13
13
|
import {
|
|
14
14
|
PipelineDefinitionsApiError,
|
|
15
15
|
createPipelineDefinitionsClient
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-efs789y2.js";
|
|
17
17
|
import {
|
|
18
18
|
createStepDefinitionsClient,
|
|
19
19
|
toStepSpec
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-zf4gwg0p.js";
|
|
21
21
|
import"../chunk-e1h021kq.js";
|
|
22
22
|
import"../chunk-63f90zky.js";
|
|
23
23
|
import"../chunk-jj9pezwb.js";
|
|
@@ -26,7 +26,7 @@ import"../chunk-5zsavw98.js";
|
|
|
26
26
|
import"../chunk-4ggr8af6.js";
|
|
27
27
|
import"../chunk-k4y5qt4y.js";
|
|
28
28
|
import"../chunk-xzx08r6y.js";
|
|
29
|
-
import"../chunk-
|
|
29
|
+
import"../chunk-z25n32z0.js";
|
|
30
30
|
import"../chunk-ngy1fdcx.js";
|
|
31
31
|
import"../chunk-y2pv8d6a.js";
|
|
32
32
|
import"../chunk-01nfqm18.js";
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { TaskRuns } from "./generated/sdk.gen";
|
|
2
|
-
import type { GetApiTaskRunsByTaskRunIdLogsData, PostApiTaskRunsByTaskRunIdArtifactFailuresData, PostApiTaskRunsByTaskRunIdArtifactUploadUrlData, PostApiTaskRunsByTaskRunIdArtifactsData, PostApiTaskRunsByTaskRunIdBaseCommitData, PostApiTaskRunsByTaskRunIdCompletionsData, PostApiTaskRunsByTaskRunIdLogsData, PostApiTaskRunsByTaskRunIdSessionUploadUrlData, PostApiTaskRunsByTaskRunIdYieldsData, PostApiTaskRunsClaimsData } from "./generated/types.gen";
|
|
2
|
+
import type { GetApiTaskRunsByTaskRunIdLogsData, PostApiTaskRunsByTaskRunIdArtifactFailuresData, PostApiTaskRunsByTaskRunIdArtifactUploadUrlData, PostApiTaskRunsByTaskRunIdArtifactsData, PostApiTaskRunsByTaskRunIdBaseCommitData, PostApiTaskRunsByTaskRunIdCompletionsData, PostApiTaskRunsByTaskRunIdLogFeedTokenData, PostApiTaskRunsByTaskRunIdLogsData, PostApiTaskRunsByTaskRunIdSessionUploadUrlData, PostApiTaskRunsByTaskRunIdYieldsData, PostApiTaskRunsClaimsData } from "./generated/types.gen";
|
|
3
3
|
type TaskRunRef = {
|
|
4
4
|
taskRunId: string;
|
|
5
5
|
};
|
|
6
6
|
type CompletionBody = PostApiTaskRunsByTaskRunIdCompletionsData["body"];
|
|
7
7
|
export type TaskPlaneClientOptions = {
|
|
8
8
|
headers?: Record<string, string> | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Headers resolved per request and set over {@link headers}, for values
|
|
11
|
+
* that can change during the client's lifetime (e.g. a rotated token).
|
|
12
|
+
*/
|
|
13
|
+
requestHeaders?: (() => Promise<Record<string, string>> | Record<string, string>) | undefined;
|
|
14
|
+
/** Sees every response before it is parsed; throwing fails the call. */
|
|
15
|
+
onResponse?: ((response: Response) => Promise<void> | void) | undefined;
|
|
9
16
|
};
|
|
10
17
|
/**
|
|
11
18
|
* Worker-facing client for the task-run plane (`/api/task-runs/...`): claiming,
|
|
@@ -49,11 +56,47 @@ declare const buildTaskPlaneClient: (taskRuns: TaskRuns) => {
|
|
|
49
56
|
updatedAt: string;
|
|
50
57
|
};
|
|
51
58
|
claimToken: string;
|
|
59
|
+
logFeed: {
|
|
60
|
+
url: string;
|
|
61
|
+
token: string;
|
|
62
|
+
expiresAt: string;
|
|
63
|
+
} | null;
|
|
52
64
|
}[]>;
|
|
53
65
|
heartbeatTaskRun: ({ taskRunId, ...body }: TaskRunRef & {
|
|
54
66
|
claimToken: string;
|
|
55
67
|
leaseDurationSeconds: number;
|
|
56
|
-
}) => Promise<
|
|
68
|
+
}) => Promise<{
|
|
69
|
+
id: string;
|
|
70
|
+
taskId: string;
|
|
71
|
+
number: number;
|
|
72
|
+
reason: "initial" | "retry" | "continuation";
|
|
73
|
+
projectId: string;
|
|
74
|
+
workItemId: string | null;
|
|
75
|
+
taskExecutionConfigId: string | null;
|
|
76
|
+
name: string | null;
|
|
77
|
+
kind: "agent" | "code";
|
|
78
|
+
previousTaskRunId: string | null;
|
|
79
|
+
baseBranch: string | null;
|
|
80
|
+
baseCommit: string | null;
|
|
81
|
+
heartbeatSeconds: number | null;
|
|
82
|
+
status: "pending" | "queued" | "running" | "succeeded" | "failed" | "timeout" | "abandoned" | "cancelled" | "skipped" | "yielded";
|
|
83
|
+
inputJson: unknown | null;
|
|
84
|
+
claimedBy: string | null;
|
|
85
|
+
claimedAt: string | null;
|
|
86
|
+
lastHeartbeatAt: string | null;
|
|
87
|
+
leaseExpiresAt: string | null;
|
|
88
|
+
executionTimeoutSeconds: number | null;
|
|
89
|
+
executionDeadlineAt: string | null;
|
|
90
|
+
startedAt: string | null;
|
|
91
|
+
completedAt: string | null;
|
|
92
|
+
resultJson: unknown | null;
|
|
93
|
+
errorJson: unknown | null;
|
|
94
|
+
workBranch: string | null;
|
|
95
|
+
createdFromBranch: string | null;
|
|
96
|
+
sessionRestored: boolean | null;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
}>;
|
|
57
100
|
getTaskRun: ({ taskRunId }: TaskRunRef) => Promise<{
|
|
58
101
|
id: string;
|
|
59
102
|
taskId: string;
|
|
@@ -667,6 +710,201 @@ declare const buildTaskPlaneClient: (taskRuns: TaskRuns) => {
|
|
|
667
710
|
request: Request;
|
|
668
711
|
response: Response;
|
|
669
712
|
}>;
|
|
713
|
+
/** Not unwrapped: callers read `response.status` (404 = live log feed unavailable). */
|
|
714
|
+
issueLogFeedWriteToken: ({ taskRunId, ...body }: TaskRunRef & PostApiTaskRunsByTaskRunIdLogFeedTokenData["body"]) => Promise<({
|
|
715
|
+
data: {
|
|
716
|
+
url: string;
|
|
717
|
+
token: string;
|
|
718
|
+
expiresAt: string;
|
|
719
|
+
};
|
|
720
|
+
error: undefined;
|
|
721
|
+
} | {
|
|
722
|
+
data: undefined;
|
|
723
|
+
error: {
|
|
724
|
+
type: string;
|
|
725
|
+
title: string;
|
|
726
|
+
status: number;
|
|
727
|
+
detail?: string;
|
|
728
|
+
instance?: string;
|
|
729
|
+
code?: string;
|
|
730
|
+
errors?: Array<{
|
|
731
|
+
path: string;
|
|
732
|
+
message: string;
|
|
733
|
+
summary?: string;
|
|
734
|
+
}>;
|
|
735
|
+
meta?: {
|
|
736
|
+
[key: string]: unknown;
|
|
737
|
+
};
|
|
738
|
+
} | {
|
|
739
|
+
type: string;
|
|
740
|
+
title: string;
|
|
741
|
+
status: number;
|
|
742
|
+
detail?: string;
|
|
743
|
+
instance?: string;
|
|
744
|
+
code?: string;
|
|
745
|
+
errors?: Array<{
|
|
746
|
+
path: string;
|
|
747
|
+
message: string;
|
|
748
|
+
summary?: string;
|
|
749
|
+
}>;
|
|
750
|
+
meta?: {
|
|
751
|
+
[key: string]: unknown;
|
|
752
|
+
};
|
|
753
|
+
} | {
|
|
754
|
+
type: string;
|
|
755
|
+
title: string;
|
|
756
|
+
status: number;
|
|
757
|
+
detail?: string;
|
|
758
|
+
instance?: string;
|
|
759
|
+
code?: string;
|
|
760
|
+
errors?: Array<{
|
|
761
|
+
path: string;
|
|
762
|
+
message: string;
|
|
763
|
+
summary?: string;
|
|
764
|
+
}>;
|
|
765
|
+
meta?: {
|
|
766
|
+
[key: string]: unknown;
|
|
767
|
+
};
|
|
768
|
+
} | {
|
|
769
|
+
type: string;
|
|
770
|
+
title: string;
|
|
771
|
+
status: number;
|
|
772
|
+
detail?: string;
|
|
773
|
+
instance?: string;
|
|
774
|
+
code?: string;
|
|
775
|
+
errors?: Array<{
|
|
776
|
+
path: string;
|
|
777
|
+
message: string;
|
|
778
|
+
summary?: string;
|
|
779
|
+
}>;
|
|
780
|
+
meta?: {
|
|
781
|
+
[key: string]: unknown;
|
|
782
|
+
};
|
|
783
|
+
} | {
|
|
784
|
+
type: string;
|
|
785
|
+
title: string;
|
|
786
|
+
status: number;
|
|
787
|
+
detail?: string;
|
|
788
|
+
instance?: string;
|
|
789
|
+
code?: string;
|
|
790
|
+
errors?: Array<{
|
|
791
|
+
path: string;
|
|
792
|
+
message: string;
|
|
793
|
+
summary?: string;
|
|
794
|
+
}>;
|
|
795
|
+
meta?: {
|
|
796
|
+
[key: string]: unknown;
|
|
797
|
+
};
|
|
798
|
+
} | {
|
|
799
|
+
type: string;
|
|
800
|
+
title: string;
|
|
801
|
+
status: number;
|
|
802
|
+
detail?: string;
|
|
803
|
+
instance?: string;
|
|
804
|
+
code?: string;
|
|
805
|
+
errors?: Array<{
|
|
806
|
+
path: string;
|
|
807
|
+
message: string;
|
|
808
|
+
summary?: string;
|
|
809
|
+
}>;
|
|
810
|
+
meta?: {
|
|
811
|
+
[key: string]: unknown;
|
|
812
|
+
};
|
|
813
|
+
};
|
|
814
|
+
}) & {
|
|
815
|
+
request: Request;
|
|
816
|
+
response: Response;
|
|
817
|
+
}>;
|
|
818
|
+
/** Not unwrapped: callers read `response.status` (404 = live log feed unavailable). */
|
|
819
|
+
issueLogFeedReadToken: ({ taskRunId }: TaskRunRef) => Promise<({
|
|
820
|
+
data: {
|
|
821
|
+
url: string;
|
|
822
|
+
token: string;
|
|
823
|
+
expiresAt: string;
|
|
824
|
+
};
|
|
825
|
+
error: undefined;
|
|
826
|
+
} | {
|
|
827
|
+
data: undefined;
|
|
828
|
+
error: {
|
|
829
|
+
type: string;
|
|
830
|
+
title: string;
|
|
831
|
+
status: number;
|
|
832
|
+
detail?: string;
|
|
833
|
+
instance?: string;
|
|
834
|
+
code?: string;
|
|
835
|
+
errors?: Array<{
|
|
836
|
+
path: string;
|
|
837
|
+
message: string;
|
|
838
|
+
summary?: string;
|
|
839
|
+
}>;
|
|
840
|
+
meta?: {
|
|
841
|
+
[key: string]: unknown;
|
|
842
|
+
};
|
|
843
|
+
} | {
|
|
844
|
+
type: string;
|
|
845
|
+
title: string;
|
|
846
|
+
status: number;
|
|
847
|
+
detail?: string;
|
|
848
|
+
instance?: string;
|
|
849
|
+
code?: string;
|
|
850
|
+
errors?: Array<{
|
|
851
|
+
path: string;
|
|
852
|
+
message: string;
|
|
853
|
+
summary?: string;
|
|
854
|
+
}>;
|
|
855
|
+
meta?: {
|
|
856
|
+
[key: string]: unknown;
|
|
857
|
+
};
|
|
858
|
+
} | {
|
|
859
|
+
type: string;
|
|
860
|
+
title: string;
|
|
861
|
+
status: number;
|
|
862
|
+
detail?: string;
|
|
863
|
+
instance?: string;
|
|
864
|
+
code?: string;
|
|
865
|
+
errors?: Array<{
|
|
866
|
+
path: string;
|
|
867
|
+
message: string;
|
|
868
|
+
summary?: string;
|
|
869
|
+
}>;
|
|
870
|
+
meta?: {
|
|
871
|
+
[key: string]: unknown;
|
|
872
|
+
};
|
|
873
|
+
} | {
|
|
874
|
+
type: string;
|
|
875
|
+
title: string;
|
|
876
|
+
status: number;
|
|
877
|
+
detail?: string;
|
|
878
|
+
instance?: string;
|
|
879
|
+
code?: string;
|
|
880
|
+
errors?: Array<{
|
|
881
|
+
path: string;
|
|
882
|
+
message: string;
|
|
883
|
+
summary?: string;
|
|
884
|
+
}>;
|
|
885
|
+
meta?: {
|
|
886
|
+
[key: string]: unknown;
|
|
887
|
+
};
|
|
888
|
+
} | {
|
|
889
|
+
type: string;
|
|
890
|
+
title: string;
|
|
891
|
+
status: number;
|
|
892
|
+
detail?: string;
|
|
893
|
+
instance?: string;
|
|
894
|
+
code?: string;
|
|
895
|
+
errors?: Array<{
|
|
896
|
+
path: string;
|
|
897
|
+
message: string;
|
|
898
|
+
summary?: string;
|
|
899
|
+
}>;
|
|
900
|
+
meta?: {
|
|
901
|
+
[key: string]: unknown;
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
}) & {
|
|
905
|
+
request: Request;
|
|
906
|
+
response: Response;
|
|
907
|
+
}>;
|
|
670
908
|
getArtifactDownloadUrl: ({ taskRunId, artifactId, }: TaskRunRef & {
|
|
671
909
|
artifactId: string;
|
|
672
910
|
}) => Promise<{
|