@scarn/sdk 0.8.7 → 0.8.9
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-r01fsz58.js → chunk-1yb2h6t9.js} +1 -1
- package/dist/{chunk-jjpc2chg.js → chunk-hpn4q02f.js} +23 -10
- package/dist/{chunk-ejzfdm1z.js → chunk-xzx08r6y.js} +20 -7
- package/dist/contracts/automation-document/schema.d.ts +1 -1
- package/dist/definitions/steps/index.js +2 -2
- package/dist/definitions/steps/repo.d.ts +15 -4
- package/dist/definitions/steps/step-definitions-client.d.ts +9 -3
- package/dist/definitions/steps/step-features.d.ts +25 -13
- package/dist/definitions/validation/index.js +2 -2
- package/dist/generated/types.gen.d.ts +26 -10
- package/dist/index.js +2 -2
- package/dist/push/index.js +3 -3
- package/dist/repo-config.d.ts +37 -2
- package/dist/repo-config.js +3 -1
- package/dist/task-plane-client.d.ts +3 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
repoConfigInputSchema,
|
|
32
32
|
repoRuntimeMismatch
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-xzx08r6y.js";
|
|
34
34
|
import {
|
|
35
35
|
StepDefinitions,
|
|
36
36
|
createClient
|
|
@@ -721,8 +721,8 @@ var Repo = {
|
|
|
721
721
|
none() {
|
|
722
722
|
return { mode: "none" };
|
|
723
723
|
},
|
|
724
|
-
readOnly() {
|
|
725
|
-
return { mode: "readOnly" };
|
|
724
|
+
readOnly(opts) {
|
|
725
|
+
return { mode: "readOnly", ...opts };
|
|
726
726
|
},
|
|
727
727
|
readWrite(opts) {
|
|
728
728
|
return { mode: "readWrite", ...opts };
|
|
@@ -745,16 +745,27 @@ function compileRepo(repo, runtime, ctx = {}) {
|
|
|
745
745
|
if (mismatch !== null) {
|
|
746
746
|
throw new Error(`${where} "${spec.mode}" cannot be used with executionMode "${executionMode}": ${mismatch}.`);
|
|
747
747
|
}
|
|
748
|
-
const config2 =
|
|
748
|
+
const config2 = toRepoConfigInput(spec);
|
|
749
749
|
const parsed = repoConfigInputSchema.safeParse(config2);
|
|
750
750
|
if (!parsed.success) {
|
|
751
751
|
throw new Error(`${where}: ${parsed.error.issues.map((issue) => `${issue.path.join(".") || "mode"} ${issue.message}`).join("; ")}`);
|
|
752
752
|
}
|
|
753
753
|
return config2;
|
|
754
754
|
}
|
|
755
|
+
function toRepoConfigInput(spec) {
|
|
756
|
+
if (spec.mode === "readWrite")
|
|
757
|
+
return toReadWriteConfig(spec);
|
|
758
|
+
if (spec.mode === "readOnly")
|
|
759
|
+
return { mode: "readOnly", ...gitCredentialsOf(spec) };
|
|
760
|
+
return { mode: "none" };
|
|
761
|
+
}
|
|
762
|
+
function gitCredentialsOf(spec) {
|
|
763
|
+
return spec.gitCredentials !== undefined ? { gitCredentials: spec.gitCredentials } : {};
|
|
764
|
+
}
|
|
755
765
|
function toReadWriteConfig(spec) {
|
|
756
766
|
return {
|
|
757
767
|
mode: "readWrite",
|
|
768
|
+
...gitCredentialsOf(spec),
|
|
758
769
|
...spec.message !== undefined ? {
|
|
759
770
|
message: `${spec.message}`
|
|
760
771
|
} : {},
|
|
@@ -1414,7 +1425,7 @@ var grantActionValues = [
|
|
|
1414
1425
|
"close",
|
|
1415
1426
|
"create"
|
|
1416
1427
|
];
|
|
1417
|
-
var grantScopeValues = ["self", "children"];
|
|
1428
|
+
var grantScopeValues = ["self", "children", "project"];
|
|
1418
1429
|
var notificationKindSchema = exports_external.enum([
|
|
1419
1430
|
"feedback_request",
|
|
1420
1431
|
"status_update",
|
|
@@ -1502,14 +1513,16 @@ var WORK_ITEM_ACTION_TEXT = {
|
|
|
1502
1513
|
close: "close",
|
|
1503
1514
|
create: "create"
|
|
1504
1515
|
};
|
|
1505
|
-
var
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1516
|
+
var SCOPE_TEXT = {
|
|
1517
|
+
self: "your work item",
|
|
1518
|
+
children: "its child work items",
|
|
1519
|
+
project: "any work item in this project (pass its `workItemId`)"
|
|
1509
1520
|
};
|
|
1521
|
+
var scopeText = (action, scope) => action === "create" ? "child work items of your work item" : SCOPE_TEXT[scope];
|
|
1510
1522
|
var scopeHeading = {
|
|
1511
1523
|
self: "Your Work Item",
|
|
1512
|
-
children: "Child Work Items"
|
|
1524
|
+
children: "Child Work Items",
|
|
1525
|
+
project: "Any Work Item in the Project"
|
|
1513
1526
|
};
|
|
1514
1527
|
var actionHeading = {
|
|
1515
1528
|
read: "Read",
|
|
@@ -41,22 +41,31 @@ var repoCommitMessageSchema = exports_external.string().max(MAX_REPO_COMMIT_MESS
|
|
|
41
41
|
message: `may only use {{input.\u2026}}, {{result.\u2026}}, {{${REPO_COMMIT_MESSAGE_WORK_ITEM_KEYS.map((key) => `workItem.${key}`).join("}} and {{")}}} tokens`
|
|
42
42
|
});
|
|
43
43
|
var onPushFailureSchema = exports_external.enum(["fail", "warn"]);
|
|
44
|
+
var repoGitCredentialsSchema = exports_external.enum(["auto", "none"]);
|
|
44
45
|
var repoConfigInputSchema = exports_external.discriminatedUnion("mode", [
|
|
45
46
|
exports_external.object({ mode: exports_external.literal("none") }).strict(),
|
|
46
|
-
exports_external.object({
|
|
47
|
+
exports_external.object({
|
|
48
|
+
mode: exports_external.literal("readOnly"),
|
|
49
|
+
gitCredentials: repoGitCredentialsSchema.optional()
|
|
50
|
+
}).strict(),
|
|
47
51
|
exports_external.object({
|
|
48
52
|
mode: exports_external.literal("readWrite"),
|
|
49
53
|
message: repoCommitMessageSchema.nullish(),
|
|
50
|
-
onPushFailure: onPushFailureSchema.optional()
|
|
54
|
+
onPushFailure: onPushFailureSchema.optional(),
|
|
55
|
+
gitCredentials: repoGitCredentialsSchema.optional()
|
|
51
56
|
}).strict()
|
|
52
57
|
]);
|
|
53
58
|
var repoConfigSchema = exports_external.discriminatedUnion("mode", [
|
|
54
59
|
exports_external.object({ mode: exports_external.literal("none") }).strict(),
|
|
55
|
-
exports_external.object({
|
|
60
|
+
exports_external.object({
|
|
61
|
+
mode: exports_external.literal("readOnly"),
|
|
62
|
+
gitCredentials: repoGitCredentialsSchema
|
|
63
|
+
}).strict(),
|
|
56
64
|
exports_external.object({
|
|
57
65
|
mode: exports_external.literal("readWrite"),
|
|
58
66
|
message: repoCommitMessageSchema.nullable(),
|
|
59
|
-
onPushFailure: onPushFailureSchema
|
|
67
|
+
onPushFailure: onPushFailureSchema,
|
|
68
|
+
gitCredentials: repoGitCredentialsSchema
|
|
60
69
|
}).strict()
|
|
61
70
|
]);
|
|
62
71
|
var REPO_RUNTIME_SUPPORT = {
|
|
@@ -77,14 +86,18 @@ function repoRuntimeMismatch(executionMode, mode) {
|
|
|
77
86
|
}
|
|
78
87
|
function resolveRepoConfig(executionMode, input) {
|
|
79
88
|
const mode = input?.mode ?? REPO_RUNTIME_SUPPORT[executionMode].default;
|
|
80
|
-
if (mode
|
|
89
|
+
if (mode === "none")
|
|
81
90
|
return { mode };
|
|
91
|
+
const gitCredentials = (input && "gitCredentials" in input ? input.gitCredentials : undefined) ?? "auto";
|
|
92
|
+
if (mode === "readOnly")
|
|
93
|
+
return { mode, gitCredentials };
|
|
82
94
|
const readWrite = input?.mode === "readWrite" ? input : undefined;
|
|
83
95
|
return {
|
|
84
96
|
mode,
|
|
85
97
|
message: readWrite?.message ?? null,
|
|
86
|
-
onPushFailure: readWrite?.onPushFailure ?? "fail"
|
|
98
|
+
onPushFailure: readWrite?.onPushFailure ?? "fail",
|
|
99
|
+
gitCredentials
|
|
87
100
|
};
|
|
88
101
|
}
|
|
89
102
|
|
|
90
|
-
export { MAX_REPO_COMMIT_MESSAGE_LENGTH, REPO_COMMIT_MESSAGE_TOKEN_ROOTS, REPO_COMMIT_MESSAGE_WORK_ITEM_KEYS, commitMessageUsesWorkItem, findDisallowedCommitMessageTokenRoots, repoCommitMessageSchema, repoConfigInputSchema, repoConfigSchema, REPO_RUNTIME_SUPPORT, repoRuntimeMismatch, resolveRepoConfig };
|
|
103
|
+
export { MAX_REPO_COMMIT_MESSAGE_LENGTH, REPO_COMMIT_MESSAGE_TOKEN_ROOTS, REPO_COMMIT_MESSAGE_WORK_ITEM_KEYS, commitMessageUsesWorkItem, findDisallowedCommitMessageTokenRoots, repoCommitMessageSchema, repoGitCredentialsSchema, repoConfigInputSchema, repoConfigSchema, REPO_RUNTIME_SUPPORT, repoRuntimeMismatch, resolveRepoConfig };
|
|
@@ -274,8 +274,8 @@ export declare const automationDocumentSchema: z.ZodObject<{
|
|
|
274
274
|
key: z.ZodString;
|
|
275
275
|
title: z.ZodOptional<z.ZodString>;
|
|
276
276
|
scope: z.ZodEnum<{
|
|
277
|
-
workItem: "workItem";
|
|
278
277
|
project: "project";
|
|
278
|
+
workItem: "workItem";
|
|
279
279
|
}>;
|
|
280
280
|
rules: z.ZodArray<z.ZodObject<{
|
|
281
281
|
event: z.ZodEnum<{
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
resolveMcpChecks,
|
|
34
34
|
toStepHandle,
|
|
35
35
|
toStepSpec
|
|
36
|
-
} from "../../chunk-
|
|
36
|
+
} from "../../chunk-hpn4q02f.js";
|
|
37
37
|
import"../../chunk-e1h021kq.js";
|
|
38
38
|
import"../../chunk-63f90zky.js";
|
|
39
39
|
import"../../chunk-jj9pezwb.js";
|
|
@@ -41,7 +41,7 @@ import"../../chunk-y11p1q7r.js";
|
|
|
41
41
|
import"../../chunk-5zsavw98.js";
|
|
42
42
|
import"../../chunk-4ggr8af6.js";
|
|
43
43
|
import"../../chunk-k4y5qt4y.js";
|
|
44
|
-
import"../../chunk-
|
|
44
|
+
import"../../chunk-xzx08r6y.js";
|
|
45
45
|
import"../../chunk-vmdn05vj.js";
|
|
46
46
|
import"../../chunk-ngy1fdcx.js";
|
|
47
47
|
import"../../chunk-y2pv8d6a.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RepoConfigInput } from "../../repo-config";
|
|
1
|
+
import { type RepoConfigInput, type RepoGitCredentials } from "../../repo-config";
|
|
2
2
|
import { type PromptInputProxy } from "./prompt-template";
|
|
3
3
|
import type { RuntimeSpec } from "./runtime";
|
|
4
4
|
/**
|
|
@@ -10,10 +10,19 @@ import type { RuntimeSpec } from "./runtime";
|
|
|
10
10
|
export type NoneRepoSpec = {
|
|
11
11
|
readonly mode: "none";
|
|
12
12
|
};
|
|
13
|
+
type GitCredentialsOpt = {
|
|
14
|
+
/**
|
|
15
|
+
* Defaults to `"auto"`: git inside the container gets credentials (for
|
|
16
|
+
* private submodules or dependencies) through the worker's per-run
|
|
17
|
+
* credential relay, when the worker has it enabled. The credential may be
|
|
18
|
+
* able to push. `"none"` opts the step out.
|
|
19
|
+
*/
|
|
20
|
+
readonly gitCredentials?: RepoGitCredentials;
|
|
21
|
+
};
|
|
13
22
|
/** Clones and checks out the base branch; creates no branch, commits and pushes nothing. */
|
|
14
23
|
export type ReadOnlyRepoSpec = {
|
|
15
24
|
readonly mode: "readOnly";
|
|
16
|
-
};
|
|
25
|
+
} & GitCredentialsOpt;
|
|
17
26
|
export type ReadWriteRepoSpec = {
|
|
18
27
|
readonly mode: "readWrite";
|
|
19
28
|
/**
|
|
@@ -24,7 +33,7 @@ export type ReadWriteRepoSpec = {
|
|
|
24
33
|
readonly message?: string;
|
|
25
34
|
/** Defaults to `"fail"`: a failed push fails the step. */
|
|
26
35
|
readonly onPushFailure?: "fail" | "warn";
|
|
27
|
-
};
|
|
36
|
+
} & GitCredentialsOpt;
|
|
28
37
|
export type RepoSpec = NoneRepoSpec | ReadOnlyRepoSpec | ReadWriteRepoSpec;
|
|
29
38
|
/** What `Runtime.devcontainer()` and `Runtime.managed.<id>()` accept. */
|
|
30
39
|
export type DevcontainerRepoSpec = ReadOnlyRepoSpec | ReadWriteRepoSpec;
|
|
@@ -43,6 +52,7 @@ export type RepoFn<TInput, TResult, TSpec extends RepoSpec> = (context: {
|
|
|
43
52
|
workItem: PromptInputProxy<CommitMessageWorkItem>;
|
|
44
53
|
}) => TSpec;
|
|
45
54
|
export type RepoField<TInput, TResult, TSpec extends RepoSpec> = TSpec | RepoFn<TInput, TResult, TSpec>;
|
|
55
|
+
export type ReadOnlyRepoOpts = Omit<ReadOnlyRepoSpec, "mode">;
|
|
46
56
|
export type ReadWriteRepoOpts = Omit<ReadWriteRepoSpec, "mode">;
|
|
47
57
|
export declare const Repo: {
|
|
48
58
|
/**
|
|
@@ -55,7 +65,7 @@ export declare const Repo: {
|
|
|
55
65
|
* nothing, pushes nothing and reports no `workBranch`. A policy, not a
|
|
56
66
|
* sandbox: edits the agent makes stay in the workspace and are discarded.
|
|
57
67
|
*/
|
|
58
|
-
readonly readOnly: () => ReadOnlyRepoSpec;
|
|
68
|
+
readonly readOnly: (opts?: ReadOnlyRepoOpts) => ReadOnlyRepoSpec;
|
|
59
69
|
/**
|
|
60
70
|
* Creates a work branch, then commits and pushes it when the step succeeds.
|
|
61
71
|
* This is the default for a devcontainer step.
|
|
@@ -73,3 +83,4 @@ export type CompileRepoContext = {
|
|
|
73
83
|
* the `repoConfigInputSchema` rules.
|
|
74
84
|
*/
|
|
75
85
|
export declare function compileRepo<TInput, TResult>(repo: RepoField<TInput, TResult, RepoSpec> | undefined, runtime: RuntimeSpec | undefined, ctx?: CompileRepoContext): RepoConfigInput | undefined;
|
|
86
|
+
export {};
|
|
@@ -35,7 +35,7 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
35
35
|
grants: Array<{
|
|
36
36
|
resource: string;
|
|
37
37
|
action: string;
|
|
38
|
-
scope: "self" | "children";
|
|
38
|
+
scope: "self" | "children" | "project";
|
|
39
39
|
} | {
|
|
40
40
|
resource: string;
|
|
41
41
|
action: string;
|
|
@@ -161,10 +161,12 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
161
161
|
mode: string;
|
|
162
162
|
} | {
|
|
163
163
|
mode: string;
|
|
164
|
+
gitCredentials: "auto" | "none";
|
|
164
165
|
} | {
|
|
165
166
|
mode: string;
|
|
166
167
|
message: string | unknown;
|
|
167
168
|
onPushFailure: "fail" | "warn";
|
|
169
|
+
gitCredentials: "auto" | "none";
|
|
168
170
|
};
|
|
169
171
|
status: "draft" | "active" | "archived";
|
|
170
172
|
createdAt: string;
|
|
@@ -197,7 +199,7 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
197
199
|
grants: Array<{
|
|
198
200
|
resource: string;
|
|
199
201
|
action: string;
|
|
200
|
-
scope: "self" | "children";
|
|
202
|
+
scope: "self" | "children" | "project";
|
|
201
203
|
} | {
|
|
202
204
|
resource: string;
|
|
203
205
|
action: string;
|
|
@@ -323,10 +325,12 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
323
325
|
mode: string;
|
|
324
326
|
} | {
|
|
325
327
|
mode: string;
|
|
328
|
+
gitCredentials: "auto" | "none";
|
|
326
329
|
} | {
|
|
327
330
|
mode: string;
|
|
328
331
|
message: string | unknown;
|
|
329
332
|
onPushFailure: "fail" | "warn";
|
|
333
|
+
gitCredentials: "auto" | "none";
|
|
330
334
|
};
|
|
331
335
|
status: "draft" | "active" | "archived";
|
|
332
336
|
createdAt: string;
|
|
@@ -369,7 +373,7 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
369
373
|
grants: Array<{
|
|
370
374
|
resource: string;
|
|
371
375
|
action: string;
|
|
372
|
-
scope: "self" | "children";
|
|
376
|
+
scope: "self" | "children" | "project";
|
|
373
377
|
} | {
|
|
374
378
|
resource: string;
|
|
375
379
|
action: string;
|
|
@@ -495,10 +499,12 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
495
499
|
mode: string;
|
|
496
500
|
} | {
|
|
497
501
|
mode: string;
|
|
502
|
+
gitCredentials: "auto" | "none";
|
|
498
503
|
} | {
|
|
499
504
|
mode: string;
|
|
500
505
|
message: string | unknown;
|
|
501
506
|
onPushFailure: "fail" | "warn";
|
|
507
|
+
gitCredentials: "auto" | "none";
|
|
502
508
|
};
|
|
503
509
|
status: "draft" | "active" | "archived";
|
|
504
510
|
createdAt: string;
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { ZodObject, ZodRawShape } from "zod";
|
|
3
3
|
export declare const grantActionValues: readonly ["read", "update", "comment", "label", "block", "close", "create"];
|
|
4
|
-
export declare const grantScopeValues: readonly ["self", "children"];
|
|
4
|
+
export declare const grantScopeValues: readonly ["self", "children", "project"];
|
|
5
5
|
/** What a grant lets the agent do to a work item. */
|
|
6
6
|
export type GrantAction = (typeof grantActionValues)[number];
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* `self`: the Task's own work item. `children`: its child work items.
|
|
9
|
+
* `project`: any work item in the project (`read` only).
|
|
10
|
+
*/
|
|
8
11
|
export type GrantScope = (typeof grantScopeValues)[number];
|
|
12
|
+
/** The scopes a grant that changes work items may cover. */
|
|
13
|
+
export type ChangeGrantScope = Exclude<GrantScope, "project">;
|
|
9
14
|
/**
|
|
10
15
|
* One thing a step's Tasks may do to a work item. `label` and `create` name
|
|
11
|
-
* the labels they may set; `create` only covers `children
|
|
16
|
+
* the labels they may set; `create` only covers `children`; only `read` may
|
|
17
|
+
* cover `project`.
|
|
12
18
|
*/
|
|
13
19
|
export type Grant = {
|
|
14
20
|
resource: "workItem";
|
|
15
|
-
action: "read"
|
|
21
|
+
action: "read";
|
|
16
22
|
scope: GrantScope;
|
|
23
|
+
} | {
|
|
24
|
+
resource: "workItem";
|
|
25
|
+
action: "update" | "comment" | "block" | "close";
|
|
26
|
+
scope: ChangeGrantScope;
|
|
17
27
|
} | {
|
|
18
28
|
resource: "workItem";
|
|
19
29
|
action: "label";
|
|
20
|
-
scope:
|
|
30
|
+
scope: ChangeGrantScope;
|
|
21
31
|
labels: string[];
|
|
22
32
|
} | {
|
|
23
33
|
resource: "workItem";
|
|
@@ -113,10 +123,10 @@ export type FeedbackRequestItem = {
|
|
|
113
123
|
urgency: FeedbackRequestUrgency;
|
|
114
124
|
};
|
|
115
125
|
type ScopeOptions = {
|
|
116
|
-
scope:
|
|
126
|
+
scope: ChangeGrantScope;
|
|
117
127
|
};
|
|
118
128
|
type LabelsOptions<TLabels extends readonly string[]> = {
|
|
119
|
-
scope:
|
|
129
|
+
scope: ChangeGrantScope;
|
|
120
130
|
labels: TLabels;
|
|
121
131
|
};
|
|
122
132
|
export declare const Features: {
|
|
@@ -129,30 +139,32 @@ export declare const Features: {
|
|
|
129
139
|
*/
|
|
130
140
|
readonly feedbackRequests: () => NotificationsFeature;
|
|
131
141
|
readonly workItems: {
|
|
132
|
-
readonly read: ({ scope }:
|
|
142
|
+
readonly read: ({ scope }: {
|
|
143
|
+
scope: GrantScope;
|
|
144
|
+
}) => WorkItemFeature<{
|
|
133
145
|
readonly resource: "workItem";
|
|
134
146
|
readonly action: "read";
|
|
135
|
-
readonly scope: "self" | "children";
|
|
147
|
+
readonly scope: "self" | "children" | "project";
|
|
136
148
|
}>;
|
|
137
149
|
readonly update: ({ scope }: ScopeOptions) => WorkItemFeature<{
|
|
138
150
|
readonly resource: "workItem";
|
|
139
151
|
readonly action: "update";
|
|
140
|
-
readonly scope:
|
|
152
|
+
readonly scope: ChangeGrantScope;
|
|
141
153
|
}>;
|
|
142
154
|
readonly comment: ({ scope }: ScopeOptions) => WorkItemFeature<{
|
|
143
155
|
readonly resource: "workItem";
|
|
144
156
|
readonly action: "comment";
|
|
145
|
-
readonly scope:
|
|
157
|
+
readonly scope: ChangeGrantScope;
|
|
146
158
|
}>;
|
|
147
159
|
readonly block: ({ scope }: ScopeOptions) => WorkItemFeature<{
|
|
148
160
|
readonly resource: "workItem";
|
|
149
161
|
readonly action: "block";
|
|
150
|
-
readonly scope:
|
|
162
|
+
readonly scope: ChangeGrantScope;
|
|
151
163
|
}>;
|
|
152
164
|
readonly close: ({ scope }: ScopeOptions) => WorkItemFeature<{
|
|
153
165
|
readonly resource: "workItem";
|
|
154
166
|
readonly action: "close";
|
|
155
|
-
readonly scope:
|
|
167
|
+
readonly scope: ChangeGrantScope;
|
|
156
168
|
}>;
|
|
157
169
|
/** Add or remove the given labels; the agent may not touch any other. */
|
|
158
170
|
readonly label: <const TLabels extends readonly [string, ...string[]]>({ scope, labels, }: LabelsOptions<TLabels>) => WorkItemFeature<Extract<Grant, {
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
assertValidDefinitionSpecs,
|
|
4
4
|
listPaths,
|
|
5
5
|
validateDefinitionSpecs
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-1yb2h6t9.js";
|
|
7
7
|
import"../../chunk-5zsavw98.js";
|
|
8
8
|
import"../../chunk-4ggr8af6.js";
|
|
9
9
|
import"../../chunk-k4y5qt4y.js";
|
|
10
|
-
import"../../chunk-
|
|
10
|
+
import"../../chunk-xzx08r6y.js";
|
|
11
11
|
import"../../chunk-ngy1fdcx.js";
|
|
12
12
|
import"../../chunk-y2pv8d6a.js";
|
|
13
13
|
import"../../chunk-skzxcba3.js";
|
|
@@ -1503,7 +1503,7 @@ export type GetApiStepDefinitionsResponses = {
|
|
|
1503
1503
|
grants: Array<{
|
|
1504
1504
|
resource: string;
|
|
1505
1505
|
action: string;
|
|
1506
|
-
scope: 'self' | 'children';
|
|
1506
|
+
scope: 'self' | 'children' | 'project';
|
|
1507
1507
|
} | {
|
|
1508
1508
|
resource: string;
|
|
1509
1509
|
action: string;
|
|
@@ -1629,10 +1629,12 @@ export type GetApiStepDefinitionsResponses = {
|
|
|
1629
1629
|
mode: string;
|
|
1630
1630
|
} | {
|
|
1631
1631
|
mode: string;
|
|
1632
|
+
gitCredentials: 'auto' | 'none';
|
|
1632
1633
|
} | {
|
|
1633
1634
|
mode: string;
|
|
1634
1635
|
message: string | unknown;
|
|
1635
1636
|
onPushFailure: 'fail' | 'warn';
|
|
1637
|
+
gitCredentials: 'auto' | 'none';
|
|
1636
1638
|
};
|
|
1637
1639
|
status: 'draft' | 'active' | 'archived';
|
|
1638
1640
|
createdAt: string;
|
|
@@ -1667,7 +1669,7 @@ export type PostApiStepDefinitionsData = {
|
|
|
1667
1669
|
grants?: Array<{
|
|
1668
1670
|
resource: string;
|
|
1669
1671
|
action: string;
|
|
1670
|
-
scope: 'self' | 'children';
|
|
1672
|
+
scope: 'self' | 'children' | 'project';
|
|
1671
1673
|
} | {
|
|
1672
1674
|
resource: string;
|
|
1673
1675
|
action: string;
|
|
@@ -1793,10 +1795,12 @@ export type PostApiStepDefinitionsData = {
|
|
|
1793
1795
|
mode: string;
|
|
1794
1796
|
} | {
|
|
1795
1797
|
mode: string;
|
|
1798
|
+
gitCredentials?: 'auto' | 'none';
|
|
1796
1799
|
} | {
|
|
1797
1800
|
mode: string;
|
|
1798
1801
|
message?: string | unknown;
|
|
1799
1802
|
onPushFailure?: 'fail' | 'warn';
|
|
1803
|
+
gitCredentials?: 'auto' | 'none';
|
|
1800
1804
|
};
|
|
1801
1805
|
status: 'draft' | 'active' | 'archived';
|
|
1802
1806
|
};
|
|
@@ -1971,7 +1975,7 @@ export type PostApiStepDefinitionsResponses = {
|
|
|
1971
1975
|
grants: Array<{
|
|
1972
1976
|
resource: string;
|
|
1973
1977
|
action: string;
|
|
1974
|
-
scope: 'self' | 'children';
|
|
1978
|
+
scope: 'self' | 'children' | 'project';
|
|
1975
1979
|
} | {
|
|
1976
1980
|
resource: string;
|
|
1977
1981
|
action: string;
|
|
@@ -2097,10 +2101,12 @@ export type PostApiStepDefinitionsResponses = {
|
|
|
2097
2101
|
mode: string;
|
|
2098
2102
|
} | {
|
|
2099
2103
|
mode: string;
|
|
2104
|
+
gitCredentials: 'auto' | 'none';
|
|
2100
2105
|
} | {
|
|
2101
2106
|
mode: string;
|
|
2102
2107
|
message: string | unknown;
|
|
2103
2108
|
onPushFailure: 'fail' | 'warn';
|
|
2109
|
+
gitCredentials: 'auto' | 'none';
|
|
2104
2110
|
};
|
|
2105
2111
|
status: 'draft' | 'active' | 'archived';
|
|
2106
2112
|
createdAt: string;
|
|
@@ -2135,7 +2141,7 @@ export type PutApiStepDefinitionsData = {
|
|
|
2135
2141
|
grants?: Array<{
|
|
2136
2142
|
resource: string;
|
|
2137
2143
|
action: string;
|
|
2138
|
-
scope: 'self' | 'children';
|
|
2144
|
+
scope: 'self' | 'children' | 'project';
|
|
2139
2145
|
} | {
|
|
2140
2146
|
resource: string;
|
|
2141
2147
|
action: string;
|
|
@@ -2261,10 +2267,12 @@ export type PutApiStepDefinitionsData = {
|
|
|
2261
2267
|
mode: string;
|
|
2262
2268
|
} | {
|
|
2263
2269
|
mode: string;
|
|
2270
|
+
gitCredentials?: 'auto' | 'none';
|
|
2264
2271
|
} | {
|
|
2265
2272
|
mode: string;
|
|
2266
2273
|
message?: string | unknown;
|
|
2267
2274
|
onPushFailure?: 'fail' | 'warn';
|
|
2275
|
+
gitCredentials?: 'auto' | 'none';
|
|
2268
2276
|
};
|
|
2269
2277
|
status: 'draft' | 'active' | 'archived';
|
|
2270
2278
|
};
|
|
@@ -2401,7 +2409,7 @@ export type PutApiStepDefinitionsResponses = {
|
|
|
2401
2409
|
grants: Array<{
|
|
2402
2410
|
resource: string;
|
|
2403
2411
|
action: string;
|
|
2404
|
-
scope: 'self' | 'children';
|
|
2412
|
+
scope: 'self' | 'children' | 'project';
|
|
2405
2413
|
} | {
|
|
2406
2414
|
resource: string;
|
|
2407
2415
|
action: string;
|
|
@@ -2527,10 +2535,12 @@ export type PutApiStepDefinitionsResponses = {
|
|
|
2527
2535
|
mode: string;
|
|
2528
2536
|
} | {
|
|
2529
2537
|
mode: string;
|
|
2538
|
+
gitCredentials: 'auto' | 'none';
|
|
2530
2539
|
} | {
|
|
2531
2540
|
mode: string;
|
|
2532
2541
|
message: string | unknown;
|
|
2533
2542
|
onPushFailure: 'fail' | 'warn';
|
|
2543
|
+
gitCredentials: 'auto' | 'none';
|
|
2534
2544
|
};
|
|
2535
2545
|
status: 'draft' | 'active' | 'archived';
|
|
2536
2546
|
createdAt: string;
|
|
@@ -2675,7 +2685,7 @@ export type GetApiStepDefinitionsByStepDefinitionIdResponses = {
|
|
|
2675
2685
|
grants: Array<{
|
|
2676
2686
|
resource: string;
|
|
2677
2687
|
action: string;
|
|
2678
|
-
scope: 'self' | 'children';
|
|
2688
|
+
scope: 'self' | 'children' | 'project';
|
|
2679
2689
|
} | {
|
|
2680
2690
|
resource: string;
|
|
2681
2691
|
action: string;
|
|
@@ -2801,10 +2811,12 @@ export type GetApiStepDefinitionsByStepDefinitionIdResponses = {
|
|
|
2801
2811
|
mode: string;
|
|
2802
2812
|
} | {
|
|
2803
2813
|
mode: string;
|
|
2814
|
+
gitCredentials: 'auto' | 'none';
|
|
2804
2815
|
} | {
|
|
2805
2816
|
mode: string;
|
|
2806
2817
|
message: string | unknown;
|
|
2807
2818
|
onPushFailure: 'fail' | 'warn';
|
|
2819
|
+
gitCredentials: 'auto' | 'none';
|
|
2808
2820
|
};
|
|
2809
2821
|
status: 'draft' | 'active' | 'archived';
|
|
2810
2822
|
createdAt: string;
|
|
@@ -2949,7 +2961,7 @@ export type PutApiStepDefinitionsByStepDefinitionIdArchiveResponses = {
|
|
|
2949
2961
|
grants: Array<{
|
|
2950
2962
|
resource: string;
|
|
2951
2963
|
action: string;
|
|
2952
|
-
scope: 'self' | 'children';
|
|
2964
|
+
scope: 'self' | 'children' | 'project';
|
|
2953
2965
|
} | {
|
|
2954
2966
|
resource: string;
|
|
2955
2967
|
action: string;
|
|
@@ -3075,10 +3087,12 @@ export type PutApiStepDefinitionsByStepDefinitionIdArchiveResponses = {
|
|
|
3075
3087
|
mode: string;
|
|
3076
3088
|
} | {
|
|
3077
3089
|
mode: string;
|
|
3090
|
+
gitCredentials: 'auto' | 'none';
|
|
3078
3091
|
} | {
|
|
3079
3092
|
mode: string;
|
|
3080
3093
|
message: string | unknown;
|
|
3081
3094
|
onPushFailure: 'fail' | 'warn';
|
|
3095
|
+
gitCredentials: 'auto' | 'none';
|
|
3082
3096
|
};
|
|
3083
3097
|
status: 'draft' | 'active' | 'archived';
|
|
3084
3098
|
createdAt: string;
|
|
@@ -3259,7 +3273,7 @@ export type PostApiTasksResponses = {
|
|
|
3259
3273
|
grants: Array<{
|
|
3260
3274
|
resource: string;
|
|
3261
3275
|
action: string;
|
|
3262
|
-
scope: 'self' | 'children';
|
|
3276
|
+
scope: 'self' | 'children' | 'project';
|
|
3263
3277
|
} | {
|
|
3264
3278
|
resource: string;
|
|
3265
3279
|
action: string;
|
|
@@ -3570,7 +3584,7 @@ export type GetApiTasksByTaskIdResponses = {
|
|
|
3570
3584
|
grants: Array<{
|
|
3571
3585
|
resource: string;
|
|
3572
3586
|
action: string;
|
|
3573
|
-
scope: 'self' | 'children';
|
|
3587
|
+
scope: 'self' | 'children' | 'project';
|
|
3574
3588
|
} | {
|
|
3575
3589
|
resource: string;
|
|
3576
3590
|
action: string;
|
|
@@ -4454,7 +4468,7 @@ export type PostApiTaskRunsByTaskRunIdWorkerContextResponses = {
|
|
|
4454
4468
|
grants: Array<{
|
|
4455
4469
|
resource: string;
|
|
4456
4470
|
action: string;
|
|
4457
|
-
scope: 'self' | 'children';
|
|
4471
|
+
scope: 'self' | 'children' | 'project';
|
|
4458
4472
|
} | {
|
|
4459
4473
|
resource: string;
|
|
4460
4474
|
action: string;
|
|
@@ -4491,10 +4505,12 @@ export type PostApiTaskRunsByTaskRunIdWorkerContextResponses = {
|
|
|
4491
4505
|
mode: string;
|
|
4492
4506
|
} | {
|
|
4493
4507
|
mode: string;
|
|
4508
|
+
gitCredentials: 'auto' | 'none';
|
|
4494
4509
|
} | {
|
|
4495
4510
|
mode: string;
|
|
4496
4511
|
message: string | unknown;
|
|
4497
4512
|
onPushFailure: 'fail' | 'warn';
|
|
4513
|
+
gitCredentials: 'auto' | 'none';
|
|
4498
4514
|
};
|
|
4499
4515
|
envJson: Array<{
|
|
4500
4516
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
resolveMcpChecks,
|
|
100
100
|
toStepHandle,
|
|
101
101
|
toStepSpec
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-hpn4q02f.js";
|
|
103
103
|
import {
|
|
104
104
|
collectEnvPlaceholderNames,
|
|
105
105
|
isEnvPlaceholderValue,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
import"./chunk-5zsavw98.js";
|
|
124
124
|
import"./chunk-4ggr8af6.js";
|
|
125
125
|
import"./chunk-k4y5qt4y.js";
|
|
126
|
-
import"./chunk-
|
|
126
|
+
import"./chunk-xzx08r6y.js";
|
|
127
127
|
import {
|
|
128
128
|
Api,
|
|
129
129
|
Automations,
|
package/dist/push/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "../chunk-npy0jxfg.js";
|
|
10
10
|
import {
|
|
11
11
|
assertValidDefinitionSpecs
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-1yb2h6t9.js";
|
|
13
13
|
import {
|
|
14
14
|
PipelineDefinitionsApiError,
|
|
15
15
|
createPipelineDefinitionsClient
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
createStepDefinitionsClient,
|
|
19
19
|
toStepSpec
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-hpn4q02f.js";
|
|
21
21
|
import"../chunk-e1h021kq.js";
|
|
22
22
|
import"../chunk-63f90zky.js";
|
|
23
23
|
import"../chunk-jj9pezwb.js";
|
|
@@ -25,7 +25,7 @@ import"../chunk-y11p1q7r.js";
|
|
|
25
25
|
import"../chunk-5zsavw98.js";
|
|
26
26
|
import"../chunk-4ggr8af6.js";
|
|
27
27
|
import"../chunk-k4y5qt4y.js";
|
|
28
|
-
import"../chunk-
|
|
28
|
+
import"../chunk-xzx08r6y.js";
|
|
29
29
|
import"../chunk-vmdn05vj.js";
|
|
30
30
|
import"../chunk-ngy1fdcx.js";
|
|
31
31
|
import"../chunk-y2pv8d6a.js";
|
package/dist/repo-config.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ import { z } from "zod";
|
|
|
11
11
|
* `{{workItem.title}}` and `{{workItem.platformKey}}` tokens only) and
|
|
12
12
|
* `onPushFailure` picks whether a failed push fails the step.
|
|
13
13
|
*
|
|
14
|
+
* `readOnly` and `readWrite` also carry `gitCredentials` (`"auto"` or
|
|
15
|
+
* `"none"`): whether git inside the container gets credentials through the
|
|
16
|
+
* worker's credential relay when the worker offers one.
|
|
17
|
+
*
|
|
14
18
|
* Two shapes of the same data. `RepoConfigInput` is what an author or API client
|
|
15
19
|
* sends and may leave things out; `RepoConfig` is what is stored, returned and
|
|
16
20
|
* handed to the worker, fully resolved by `resolveRepoConfig`. A resolved
|
|
@@ -41,10 +45,28 @@ export type RepoExecutionMode = "workspace" | "no_workspace";
|
|
|
41
45
|
*/
|
|
42
46
|
export declare function findDisallowedCommitMessageTokenRoots(message: string): string[];
|
|
43
47
|
export declare const repoCommitMessageSchema: z.ZodString;
|
|
48
|
+
/**
|
|
49
|
+
* Whether git inside the step's container gets credentials through the
|
|
50
|
+
* worker's per-run credential relay.
|
|
51
|
+
*
|
|
52
|
+
* - `auto` (the default): yes, when the worker has git credentials enabled.
|
|
53
|
+
* The credential is whatever the worker's source issues; with the worker
|
|
54
|
+
* host's own git it may be able to push, so this names no permission.
|
|
55
|
+
* - `none`: the container gets no git credentials from Scarn.
|
|
56
|
+
*/
|
|
57
|
+
export declare const repoGitCredentialsSchema: z.ZodEnum<{
|
|
58
|
+
auto: "auto";
|
|
59
|
+
none: "none";
|
|
60
|
+
}>;
|
|
61
|
+
export type RepoGitCredentials = z.output<typeof repoGitCredentialsSchema>;
|
|
44
62
|
export declare const repoConfigInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
63
|
mode: z.ZodLiteral<"none">;
|
|
46
64
|
}, z.core.$strict>, z.ZodObject<{
|
|
47
65
|
mode: z.ZodLiteral<"readOnly">;
|
|
66
|
+
gitCredentials: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
auto: "auto";
|
|
68
|
+
none: "none";
|
|
69
|
+
}>>;
|
|
48
70
|
}, z.core.$strict>, z.ZodObject<{
|
|
49
71
|
mode: z.ZodLiteral<"readWrite">;
|
|
50
72
|
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -52,11 +74,19 @@ export declare const repoConfigInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
52
74
|
warn: "warn";
|
|
53
75
|
fail: "fail";
|
|
54
76
|
}>>;
|
|
77
|
+
gitCredentials: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
auto: "auto";
|
|
79
|
+
none: "none";
|
|
80
|
+
}>>;
|
|
55
81
|
}, z.core.$strict>], "mode">;
|
|
56
82
|
export declare const repoConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
57
83
|
mode: z.ZodLiteral<"none">;
|
|
58
84
|
}, z.core.$strict>, z.ZodObject<{
|
|
59
85
|
mode: z.ZodLiteral<"readOnly">;
|
|
86
|
+
gitCredentials: z.ZodEnum<{
|
|
87
|
+
auto: "auto";
|
|
88
|
+
none: "none";
|
|
89
|
+
}>;
|
|
60
90
|
}, z.core.$strict>, z.ZodObject<{
|
|
61
91
|
mode: z.ZodLiteral<"readWrite">;
|
|
62
92
|
message: z.ZodNullable<z.ZodString>;
|
|
@@ -64,6 +94,10 @@ export declare const repoConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
64
94
|
warn: "warn";
|
|
65
95
|
fail: "fail";
|
|
66
96
|
}>;
|
|
97
|
+
gitCredentials: z.ZodEnum<{
|
|
98
|
+
auto: "auto";
|
|
99
|
+
none: "none";
|
|
100
|
+
}>;
|
|
67
101
|
}, z.core.$strict>], "mode">;
|
|
68
102
|
export type RepoConfigInput = z.input<typeof repoConfigInputSchema>;
|
|
69
103
|
export type RepoConfig = z.output<typeof repoConfigSchema>;
|
|
@@ -83,8 +117,9 @@ export declare function repoRuntimeMismatch(executionMode: RepoExecutionMode, mo
|
|
|
83
117
|
/**
|
|
84
118
|
* Fills what an author left out: an omitted `repo` becomes the runtime's default
|
|
85
119
|
* (`readWrite` for `workspace`, `none` for `no_workspace`), an omitted
|
|
86
|
-
* `onPushFailure` becomes `"fail"
|
|
87
|
-
* Does not check the runtime
|
|
120
|
+
* `onPushFailure` becomes `"fail"`, an omitted `message` becomes `null` and an
|
|
121
|
+
* omitted `gitCredentials` becomes `"auto"`. Does not check the runtime
|
|
122
|
+
* pairing; that is the caller's invariant.
|
|
88
123
|
*/
|
|
89
124
|
export declare function resolveRepoConfig(executionMode: RepoExecutionMode, input?: RepoConfigInput | null): RepoConfig;
|
|
90
125
|
export {};
|
package/dist/repo-config.js
CHANGED
|
@@ -9,9 +9,10 @@ import {
|
|
|
9
9
|
repoCommitMessageSchema,
|
|
10
10
|
repoConfigInputSchema,
|
|
11
11
|
repoConfigSchema,
|
|
12
|
+
repoGitCredentialsSchema,
|
|
12
13
|
repoRuntimeMismatch,
|
|
13
14
|
resolveRepoConfig
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-xzx08r6y.js";
|
|
15
16
|
import"./chunk-skzxcba3.js";
|
|
16
17
|
import"./chunk-y64skrwp.js";
|
|
17
18
|
export {
|
|
@@ -24,6 +25,7 @@ export {
|
|
|
24
25
|
repoCommitMessageSchema,
|
|
25
26
|
repoConfigInputSchema,
|
|
26
27
|
repoConfigSchema,
|
|
28
|
+
repoGitCredentialsSchema,
|
|
27
29
|
repoRuntimeMismatch,
|
|
28
30
|
resolveRepoConfig
|
|
29
31
|
};
|
|
@@ -332,7 +332,7 @@ declare const buildTaskPlaneClient: (taskRuns: TaskRuns) => {
|
|
|
332
332
|
grants: Array<{
|
|
333
333
|
resource: string;
|
|
334
334
|
action: string;
|
|
335
|
-
scope: "self" | "children";
|
|
335
|
+
scope: "self" | "children" | "project";
|
|
336
336
|
} | {
|
|
337
337
|
resource: string;
|
|
338
338
|
action: string;
|
|
@@ -369,10 +369,12 @@ declare const buildTaskPlaneClient: (taskRuns: TaskRuns) => {
|
|
|
369
369
|
mode: string;
|
|
370
370
|
} | {
|
|
371
371
|
mode: string;
|
|
372
|
+
gitCredentials: "auto" | "none";
|
|
372
373
|
} | {
|
|
373
374
|
mode: string;
|
|
374
375
|
message: string | unknown;
|
|
375
376
|
onPushFailure: "fail" | "warn";
|
|
377
|
+
gitCredentials: "auto" | "none";
|
|
376
378
|
};
|
|
377
379
|
envJson: Array<{
|
|
378
380
|
name: string;
|