@scarn/sdk 0.8.3 → 0.8.5
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-3gy0cb5f.js → chunk-0k12bjee.js} +1 -1
- package/dist/{chunk-fyfvp6jx.js → chunk-5abvv19e.js} +117 -5
- package/dist/{chunk-0vzq22dj.js → chunk-fb3sqfrw.js} +1 -1
- package/dist/{chunk-8z1wa3kd.js → chunk-ksnta9b5.js} +1 -1
- package/dist/{chunk-wnfj3wyx.js → chunk-n5vr1tn6.js} +16 -0
- package/dist/client.js +2 -2
- package/dist/contracts/work-item-changes.d.ts +0 -4
- package/dist/contracts/work-item-changes.js +1 -2
- package/dist/defaults/index.js +2 -2
- package/dist/definitions/automations/index.js +2 -2
- package/dist/definitions/pipelines/index.js +2 -2
- package/dist/definitions/steps/define-code-step.d.ts +5 -4
- package/dist/definitions/steps/define-step.d.ts +9 -11
- package/dist/definitions/steps/index.js +6 -2
- package/dist/definitions/steps/step-definitions-client.d.ts +93 -3
- package/dist/definitions/steps/step-features.d.ts +87 -4
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/sdk.gen.d.ts +5 -2
- package/dist/generated/types.gen.d.ts +1262 -137
- package/dist/index.js +8 -4
- package/dist/push/index.js +4 -4
- package/dist/task-plane-client.d.ts +31 -1
- package/package.json +2 -2
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
import {
|
|
35
35
|
StepDefinitions,
|
|
36
36
|
createClient
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-n5vr1tn6.js";
|
|
38
38
|
import {
|
|
39
39
|
buildArtifactMarker
|
|
40
40
|
} from "./chunk-ngy1fdcx.js";
|
|
@@ -1218,10 +1218,29 @@ function assertStepMcpInput(config2) {
|
|
|
1218
1218
|
const issues = parsed.error.issues.map((issue) => issue.path.length > 0 ? `${issue.path.map(String).join(".")}: ${issue.message}` : issue.message).join("; ");
|
|
1219
1219
|
throw new Error(`Step "${config2.key}" healthChecks: ${issues}. MCP health checks are declared on the server with defineMcp({ healthChecks }).`);
|
|
1220
1220
|
}
|
|
1221
|
+
function collectGrants(stepKey, features) {
|
|
1222
|
+
const grants = [];
|
|
1223
|
+
const seen = new Set;
|
|
1224
|
+
for (const feature of features) {
|
|
1225
|
+
const grant = feature._grant;
|
|
1226
|
+
if (!grant)
|
|
1227
|
+
continue;
|
|
1228
|
+
const key = `${grant.resource}:${grant.action}:${grant.scope}`;
|
|
1229
|
+
if (seen.has(key)) {
|
|
1230
|
+
throw new Error(`Step "${stepKey}": more than one Features.${grant.resource}s.${grant.action}({ scope: "${grant.scope}" }). Attach each work item grant once.`);
|
|
1231
|
+
}
|
|
1232
|
+
seen.add(key);
|
|
1233
|
+
grants.push("labels" in grant ? { ...grant, labels: [...grant.labels] } : { ...grant });
|
|
1234
|
+
}
|
|
1235
|
+
return grants;
|
|
1236
|
+
}
|
|
1221
1237
|
function defineStep(config2) {
|
|
1222
1238
|
const features = config2.features ?? [];
|
|
1239
|
+
const grants = collectGrants(config2.key, features);
|
|
1223
1240
|
let effectiveResult = config2.result;
|
|
1224
1241
|
for (const feature of features) {
|
|
1242
|
+
if (!feature._resultExtension)
|
|
1243
|
+
continue;
|
|
1225
1244
|
effectiveResult = effectiveResult ? effectiveResult.extend(feature._resultExtension.shape) : feature._resultExtension;
|
|
1226
1245
|
}
|
|
1227
1246
|
const basePrompt = typeof config2.agentPrompt === "function" ? config2.agentPrompt(createPromptTemplateContext()) : config2.agentPrompt;
|
|
@@ -1270,7 +1289,7 @@ ${feature._promptAddition}` : feature._promptAddition;
|
|
|
1270
1289
|
...config2.concurrency !== undefined ? {
|
|
1271
1290
|
concurrency: compileStepConcurrency(config2.key, config2.concurrency)
|
|
1272
1291
|
} : {},
|
|
1273
|
-
...
|
|
1292
|
+
...grants.length > 0 ? { grants } : {}
|
|
1274
1293
|
};
|
|
1275
1294
|
return toStepHandle(spec);
|
|
1276
1295
|
}
|
|
@@ -1279,6 +1298,8 @@ function codeStep(config2) {
|
|
|
1279
1298
|
const features = config2.features ?? [];
|
|
1280
1299
|
let effectiveResult = config2.resultSchema;
|
|
1281
1300
|
for (const feature of features) {
|
|
1301
|
+
if (!feature._resultExtension)
|
|
1302
|
+
continue;
|
|
1282
1303
|
effectiveResult = effectiveResult ? effectiveResult.extend(feature._resultExtension.shape) : feature._resultExtension;
|
|
1283
1304
|
}
|
|
1284
1305
|
const {
|
|
@@ -1369,7 +1390,7 @@ var buildStepDefinitionsClient = (stepDefinitions) => {
|
|
|
1369
1390
|
})),
|
|
1370
1391
|
maxTurns: spec.maxTurns ?? null,
|
|
1371
1392
|
concurrency: spec.concurrency ?? null,
|
|
1372
|
-
|
|
1393
|
+
grants: (spec.grants ?? []).map((grant) => ({ ...grant })),
|
|
1373
1394
|
status: spec.status,
|
|
1374
1395
|
projectId
|
|
1375
1396
|
};
|
|
@@ -1384,6 +1405,16 @@ var buildStepDefinitionsClient = (stepDefinitions) => {
|
|
|
1384
1405
|
};
|
|
1385
1406
|
};
|
|
1386
1407
|
// src/definitions/steps/step-features.ts
|
|
1408
|
+
var grantActionValues = [
|
|
1409
|
+
"read",
|
|
1410
|
+
"update",
|
|
1411
|
+
"comment",
|
|
1412
|
+
"label",
|
|
1413
|
+
"block",
|
|
1414
|
+
"close",
|
|
1415
|
+
"create"
|
|
1416
|
+
];
|
|
1417
|
+
var grantScopeValues = ["self", "children"];
|
|
1387
1418
|
var notificationKindSchema = exports_external.enum([
|
|
1388
1419
|
"feedback_request",
|
|
1389
1420
|
"status_update",
|
|
@@ -1453,9 +1484,90 @@ var feedbackRequestsFeature = {
|
|
|
1453
1484
|
].join(`
|
|
1454
1485
|
`)
|
|
1455
1486
|
};
|
|
1487
|
+
var WORK_ITEM_TOOLS = {
|
|
1488
|
+
read: "scarn-get-work-item",
|
|
1489
|
+
update: "scarn-set-work-item-description",
|
|
1490
|
+
comment: "scarn-comment-on-work-item",
|
|
1491
|
+
label: "scarn-label-work-item",
|
|
1492
|
+
block: "scarn-block-work-item",
|
|
1493
|
+
close: "scarn-close-work-item",
|
|
1494
|
+
create: "scarn-create-work-item"
|
|
1495
|
+
};
|
|
1496
|
+
var WORK_ITEM_ACTION_TEXT = {
|
|
1497
|
+
read: "read",
|
|
1498
|
+
update: "replace the description of",
|
|
1499
|
+
comment: "comment on",
|
|
1500
|
+
label: "add or remove labels on",
|
|
1501
|
+
block: "mark as blocked",
|
|
1502
|
+
close: "close",
|
|
1503
|
+
create: "create"
|
|
1504
|
+
};
|
|
1505
|
+
var scopeText = (action, scope) => {
|
|
1506
|
+
if (action === "create")
|
|
1507
|
+
return "child work items of your work item";
|
|
1508
|
+
return scope === "self" ? "your work item" : "its child work items";
|
|
1509
|
+
};
|
|
1510
|
+
var scopeHeading = {
|
|
1511
|
+
self: "Your Work Item",
|
|
1512
|
+
children: "Child Work Items"
|
|
1513
|
+
};
|
|
1514
|
+
var actionHeading = {
|
|
1515
|
+
read: "Read",
|
|
1516
|
+
update: "Update",
|
|
1517
|
+
comment: "Comment on",
|
|
1518
|
+
label: "Label",
|
|
1519
|
+
block: "Block",
|
|
1520
|
+
close: "Close",
|
|
1521
|
+
create: "Create"
|
|
1522
|
+
};
|
|
1523
|
+
function workItemPrompt(grant) {
|
|
1524
|
+
const heading = grant.action === "create" ? "## Work Items: Create Child Work Items" : `## Work Items: ${actionHeading[grant.action]} ${scopeHeading[grant.scope]}`;
|
|
1525
|
+
const lines = [
|
|
1526
|
+
heading,
|
|
1527
|
+
"",
|
|
1528
|
+
`You may ${WORK_ITEM_ACTION_TEXT[grant.action]} ${scopeText(grant.action, grant.scope)}. Use the \`${WORK_ITEM_TOOLS[grant.action]}\` tool.`
|
|
1529
|
+
];
|
|
1530
|
+
if (grant.action === "label" || grant.action === "create") {
|
|
1531
|
+
lines.push("", "Allowed labels:", ...grant.labels.map((label) => `- \`${label}\``), "", "Any other label is rejected.");
|
|
1532
|
+
}
|
|
1533
|
+
return lines.join(`
|
|
1534
|
+
`);
|
|
1535
|
+
}
|
|
1536
|
+
function workItemFeature(grant) {
|
|
1537
|
+
return { _grant: grant, _promptAddition: workItemPrompt(grant) };
|
|
1538
|
+
}
|
|
1539
|
+
var workItems = {
|
|
1540
|
+
read: ({ scope }) => workItemFeature({ resource: "workItem", action: "read", scope }),
|
|
1541
|
+
update: ({ scope }) => workItemFeature({ resource: "workItem", action: "update", scope }),
|
|
1542
|
+
comment: ({ scope }) => workItemFeature({
|
|
1543
|
+
resource: "workItem",
|
|
1544
|
+
action: "comment",
|
|
1545
|
+
scope
|
|
1546
|
+
}),
|
|
1547
|
+
block: ({ scope }) => workItemFeature({ resource: "workItem", action: "block", scope }),
|
|
1548
|
+
close: ({ scope }) => workItemFeature({ resource: "workItem", action: "close", scope }),
|
|
1549
|
+
label: ({
|
|
1550
|
+
scope,
|
|
1551
|
+
labels
|
|
1552
|
+
}) => workItemFeature({
|
|
1553
|
+
resource: "workItem",
|
|
1554
|
+
action: "label",
|
|
1555
|
+
scope,
|
|
1556
|
+
labels: [...labels]
|
|
1557
|
+
}),
|
|
1558
|
+
create: ({
|
|
1559
|
+
labels
|
|
1560
|
+
}) => workItemFeature({
|
|
1561
|
+
resource: "workItem",
|
|
1562
|
+
action: "create",
|
|
1563
|
+
scope: "children",
|
|
1564
|
+
labels: [...labels]
|
|
1565
|
+
})
|
|
1566
|
+
};
|
|
1456
1567
|
var Features = {
|
|
1457
1568
|
notifications: () => notificationsFeature,
|
|
1458
|
-
feedbackRequests: () => feedbackRequestsFeature
|
|
1569
|
+
feedbackRequests: () => feedbackRequestsFeature,
|
|
1570
|
+
workItems
|
|
1459
1571
|
};
|
|
1460
1572
|
var Notify = {
|
|
1461
1573
|
create: (item) => ({
|
|
@@ -1480,4 +1592,4 @@ var Notify = {
|
|
|
1480
1592
|
[NOTIFICATION_RESULT_KEY]: fragments.flatMap((fragment) => fragment[NOTIFICATION_RESULT_KEY])
|
|
1481
1593
|
})
|
|
1482
1594
|
};
|
|
1483
|
-
export { ARTIFACT_BRAND, ArtifactTypes, normalizeArtifactAccept, artifact, Artifact, exports_z, createPromptInputProxy, createPromptTemplateContext, renderPromptTemplate, isSecretLookingEnvName, Env, normalizeEnv, Repo, compileRepo, Runtime, compileEnvironment, isMcpHandle, defineMcp, resolveMcpChecks, compileMcps, compileStepErrors, compileStepRetry, compileStepMaxTurns, compileStepConcurrency, toStepHandle, toStepSpec, defineStep, codeStep, createStepDefinitionsClient, Features, Notify };
|
|
1595
|
+
export { ARTIFACT_BRAND, ArtifactTypes, normalizeArtifactAccept, artifact, Artifact, exports_z, createPromptInputProxy, createPromptTemplateContext, renderPromptTemplate, isSecretLookingEnvName, Env, normalizeEnv, Repo, compileRepo, Runtime, compileEnvironment, isMcpHandle, defineMcp, resolveMcpChecks, compileMcps, compileStepErrors, compileStepRetry, compileStepMaxTurns, compileStepConcurrency, toStepHandle, toStepSpec, defineStep, codeStep, createStepDefinitionsClient, grantActionValues, grantScopeValues, Features, Notify };
|
|
@@ -1561,6 +1561,19 @@ class ProjectIntegrations extends HeyApiClient {
|
|
|
1561
1561
|
deleteProjectIntegration(options) {
|
|
1562
1562
|
return (options.client ?? this.client).delete({ url: "/api/projects/{projectId}/integrations/{integrationId}", ...options });
|
|
1563
1563
|
}
|
|
1564
|
+
disableProjectIntegrationAutoSync(options) {
|
|
1565
|
+
return (options.client ?? this.client).delete({ url: "/api/projects/{projectId}/integrations/{integrationId}/auto-sync", ...options });
|
|
1566
|
+
}
|
|
1567
|
+
enableProjectIntegrationAutoSync(options) {
|
|
1568
|
+
return (options.client ?? this.client).put({
|
|
1569
|
+
url: "/api/projects/{projectId}/integrations/{integrationId}/auto-sync",
|
|
1570
|
+
...options,
|
|
1571
|
+
headers: {
|
|
1572
|
+
"Content-Type": "application/json",
|
|
1573
|
+
...options.headers
|
|
1574
|
+
}
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1564
1577
|
}
|
|
1565
1578
|
|
|
1566
1579
|
class GitHubIntegrations extends HeyApiClient {
|
|
@@ -1655,6 +1668,9 @@ class Secrets extends HeyApiClient {
|
|
|
1655
1668
|
}
|
|
1656
1669
|
});
|
|
1657
1670
|
}
|
|
1671
|
+
stopUsingMySecret(options) {
|
|
1672
|
+
return (options.client ?? this.client).delete({ url: "/api/me/secrets/{secretId}/uses/{integrationId}", ...options });
|
|
1673
|
+
}
|
|
1658
1674
|
}
|
|
1659
1675
|
|
|
1660
1676
|
class ScarnClient extends HeyApiClient {
|
package/dist/client.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createScarnClient,
|
|
4
4
|
createTaskPlaneClient
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-0k12bjee.js";
|
|
6
6
|
import {
|
|
7
7
|
Api,
|
|
8
8
|
Automations,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
WorkItemCommentDrafts,
|
|
29
29
|
WorkItemComments,
|
|
30
30
|
WorkItems
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-n5vr1tn6.js";
|
|
32
32
|
import"./chunk-y64skrwp.js";
|
|
33
33
|
export {
|
|
34
34
|
Api,
|
|
@@ -35,10 +35,6 @@ export type WorkItemChange = {
|
|
|
35
35
|
workItemId: string;
|
|
36
36
|
reason: WorkItemCloseReason;
|
|
37
37
|
resolution?: string | null;
|
|
38
|
-
} | {
|
|
39
|
-
kind: "startTask";
|
|
40
|
-
workItemId: string;
|
|
41
|
-
stepKey: string;
|
|
42
38
|
};
|
|
43
39
|
export declare function buildWorkItemChangesPath(workspacePath: string): string;
|
|
44
40
|
/** The changes recorded so far; a missing file means none. */
|
package/dist/defaults/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "../chunk-rt9tq4j6.js";
|
|
5
5
|
import {
|
|
6
6
|
createScarnClient
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import"../chunk-
|
|
7
|
+
} from "../chunk-0k12bjee.js";
|
|
8
|
+
import"../chunk-n5vr1tn6.js";
|
|
9
9
|
import"../chunk-y64skrwp.js";
|
|
10
10
|
|
|
11
11
|
// src/defaults/auth-file.ts
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AutomationsApiError,
|
|
4
4
|
createAutomationsClient
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import"../../chunk-
|
|
5
|
+
} from "../../chunk-fb3sqfrw.js";
|
|
6
|
+
import"../../chunk-n5vr1tn6.js";
|
|
7
7
|
import"../../chunk-skzxcba3.js";
|
|
8
8
|
import"../../chunk-y64skrwp.js";
|
|
9
9
|
export {
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
WORK_ITEM_TOP_LEVEL_FIELDS,
|
|
6
6
|
createPipelineDefinitionsClient,
|
|
7
7
|
resolveWorkItemFieldPath
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import"../../chunk-
|
|
8
|
+
} from "../../chunk-ksnta9b5.js";
|
|
9
|
+
import"../../chunk-n5vr1tn6.js";
|
|
10
10
|
import"../../chunk-skzxcba3.js";
|
|
11
11
|
import"../../chunk-y64skrwp.js";
|
|
12
12
|
export {
|
|
@@ -3,7 +3,7 @@ import type { EffectiveResult, StepConcurrency, StepRetryEntry } from "./define-
|
|
|
3
3
|
import type { BuiltInError } from "../../pipelines/types";
|
|
4
4
|
import { type StepHandle } from "./step-handle";
|
|
5
5
|
import { type CodeStepEnvironment } from "./runtime";
|
|
6
|
-
import type {
|
|
6
|
+
import type { CodeStepFeature } from "./step-features";
|
|
7
7
|
/** What the worker passes a code step besides its input. */
|
|
8
8
|
export type CodeStepContext = {
|
|
9
9
|
/**
|
|
@@ -14,7 +14,7 @@ export type CodeStepContext = {
|
|
|
14
14
|
artifactsDir: string;
|
|
15
15
|
};
|
|
16
16
|
export type CodeStepFn<TInput, TResult> = (input: TInput, context: CodeStepContext) => TResult | Promise<TResult>;
|
|
17
|
-
export type DefineCodeStepInput<TInput extends ZodType = ZodType, TResult extends ZodType = ZodType, TFeatures extends ReadonlyArray<
|
|
17
|
+
export type DefineCodeStepInput<TInput extends ZodType = ZodType, TResult extends ZodType = ZodType, TFeatures extends ReadonlyArray<CodeStepFeature> = never[]> = {
|
|
18
18
|
key: string;
|
|
19
19
|
name: string;
|
|
20
20
|
description?: string | null;
|
|
@@ -38,7 +38,8 @@ export type DefineCodeStepInput<TInput extends ZodType = ZodType, TResult extend
|
|
|
38
38
|
/**
|
|
39
39
|
* Step features to attach — unlike `defineStep()`, only each feature's
|
|
40
40
|
* `_resultExtension` applies here (there is no prompt to append
|
|
41
|
-
* to on a `kind: "code"` step).
|
|
41
|
+
* to on a `kind: "code"` step). `Features.workItems.*` is rejected: a code
|
|
42
|
+
* step has no agent tools to use a grant with.
|
|
42
43
|
*/
|
|
43
44
|
features?: TFeatures;
|
|
44
45
|
/**
|
|
@@ -77,7 +78,7 @@ export type DefineCodeStepInput<TInput extends ZodType = ZodType, TResult extend
|
|
|
77
78
|
* `entrypoint.fn` reference attached instead — see `StepDefinitionSpec`'s
|
|
78
79
|
* own doc comment for what happens to it during collection.
|
|
79
80
|
*/
|
|
80
|
-
export declare function codeStep<TInput extends ZodType = ZodType, TResult extends ZodType = ZodType, const TFeatures extends ReadonlyArray<
|
|
81
|
+
export declare function codeStep<TInput extends ZodType = ZodType, TResult extends ZodType = ZodType, const TFeatures extends ReadonlyArray<CodeStepFeature> = never[], const TErrors extends string = never>(config: Omit<DefineCodeStepInput<TInput, TResult, TFeatures>, "errors" | "retry"> & {
|
|
81
82
|
errors?: readonly TErrors[];
|
|
82
83
|
retry?: readonly {
|
|
83
84
|
on: readonly (BuiltInError | TErrors)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ZodType } from "zod";
|
|
2
|
-
import type { AnyStepFeature, FeatureResultExtensions } from "./step-features";
|
|
2
|
+
import type { AnyStepFeature, FeatureResultExtensions, Grant } from "./step-features";
|
|
3
3
|
import { type PromptTemplateContext } from "./prompt-template";
|
|
4
4
|
import { type HealthChecksInput, type StepHealthChecksInput } from "../../health-checks";
|
|
5
5
|
import type { OpenCodeMcpServers } from "../../opencode-mcp";
|
|
@@ -9,7 +9,6 @@ import type { EnvRecord, PromptEnvContext } from "./env";
|
|
|
9
9
|
import { type StepEnvironment } from "./runtime";
|
|
10
10
|
import type { McpHandle } from "./define-mcp";
|
|
11
11
|
import type { BuiltInError, ConversationResult } from "../../pipelines/types";
|
|
12
|
-
import type { PutApiStepDefinitionsData } from "../../generated/types.gen";
|
|
13
12
|
import { type StepHandle } from "./step-handle";
|
|
14
13
|
type Prettify<T> = {
|
|
15
14
|
[K in keyof T]: T[K];
|
|
@@ -66,16 +65,12 @@ export type DefineStepInput<TInput extends ZodType = ZodType, TResult extends Zo
|
|
|
66
65
|
* dropped. Omitted means no limit. Pipeline nodes can't override it.
|
|
67
66
|
*/
|
|
68
67
|
concurrency?: StepConcurrency;
|
|
69
|
-
/** Work item permissions the step's Tasks get on top of `self`. */
|
|
70
|
-
workItemPermissions?: readonly WorkItemPermission[];
|
|
71
68
|
};
|
|
72
69
|
/** A step's per-work-item concurrency limit. */
|
|
73
70
|
export type StepConcurrency = {
|
|
74
71
|
max: number;
|
|
75
72
|
waiting: number;
|
|
76
73
|
};
|
|
77
|
-
/** A work item permission a step's Tasks may be granted. */
|
|
78
|
-
export type WorkItemPermission = NonNullable<PutApiStepDefinitionsData["body"]["workItemPermissions"]>[number];
|
|
79
74
|
/** One `retry` entry: the same shape as a pipeline node's `retry`. */
|
|
80
75
|
export type StepRetryEntry = {
|
|
81
76
|
on: readonly string[];
|
|
@@ -130,8 +125,11 @@ export type StepDefinitionSpec = {
|
|
|
130
125
|
maxTurns?: number;
|
|
131
126
|
/** The step's per-work-item concurrency limit; omitted means no limit. */
|
|
132
127
|
concurrency?: StepConcurrency;
|
|
133
|
-
/**
|
|
134
|
-
|
|
128
|
+
/**
|
|
129
|
+
* What the step's Tasks may do to work items, from its
|
|
130
|
+
* `Features.workItems.*` features. Every Task may also read its own.
|
|
131
|
+
*/
|
|
132
|
+
grants?: readonly Grant[];
|
|
135
133
|
/**
|
|
136
134
|
* `kind === "code"` only: the live function of a spec produced by
|
|
137
135
|
* `codeStep()`. Code-step discovery (`findCodeStepInModule`) reads it to
|
|
@@ -150,10 +148,10 @@ export type StepDefinitionSpec = {
|
|
|
150
148
|
export type EffectiveResult<TResult, TFeatures extends ReadonlyArray<AnyStepFeature>> = Prettify<TResult & FeatureResultExtensions<TFeatures>>;
|
|
151
149
|
/**
|
|
152
150
|
* A `defineStep` handle's result type: `ConversationResult` when the step has
|
|
153
|
-
* no `result` and no
|
|
154
|
-
* result.
|
|
151
|
+
* no `result` and no feature adds result fields (a conversation step), else
|
|
152
|
+
* its effective result.
|
|
155
153
|
*/
|
|
156
|
-
export type DefineStepResult<TResult extends ZodType, TFeatures extends ReadonlyArray<AnyStepFeature>> = ZodType extends TResult ? [TFeatures
|
|
154
|
+
export type DefineStepResult<TResult extends ZodType, TFeatures extends ReadonlyArray<AnyStepFeature>> = ZodType extends TResult ? [keyof FeatureResultExtensions<TFeatures>] extends [never] ? ConversationResult : EffectiveResult<TResult["_output"], TFeatures> : EffectiveResult<TResult["_output"], TFeatures>;
|
|
157
155
|
export declare function defineStep<TInput extends ZodType = ZodType, TResult extends ZodType = ZodType, const TFeatures extends ReadonlyArray<AnyStepFeature> = never[], TEnv extends EnvRecord = EnvRecord, const TErrors extends string = never>(config: Omit<DefineStepInput<TInput, TResult, TEnv>, "features" | "errors" | "retry"> & {
|
|
158
156
|
features?: TFeatures;
|
|
159
157
|
errors?: readonly TErrors[];
|
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
defineMcp,
|
|
24
24
|
defineStep,
|
|
25
25
|
exports_z,
|
|
26
|
+
grantActionValues,
|
|
27
|
+
grantScopeValues,
|
|
26
28
|
isMcpHandle,
|
|
27
29
|
isSecretLookingEnvName,
|
|
28
30
|
normalizeArtifactAccept,
|
|
@@ -31,7 +33,7 @@ import {
|
|
|
31
33
|
resolveMcpChecks,
|
|
32
34
|
toStepHandle,
|
|
33
35
|
toStepSpec
|
|
34
|
-
} from "../../chunk-
|
|
36
|
+
} from "../../chunk-5abvv19e.js";
|
|
35
37
|
import"../../chunk-e1h021kq.js";
|
|
36
38
|
import"../../chunk-63f90zky.js";
|
|
37
39
|
import"../../chunk-jj9pezwb.js";
|
|
@@ -40,7 +42,7 @@ import"../../chunk-5zsavw98.js";
|
|
|
40
42
|
import"../../chunk-4ggr8af6.js";
|
|
41
43
|
import"../../chunk-k4y5qt4y.js";
|
|
42
44
|
import"../../chunk-ejzfdm1z.js";
|
|
43
|
-
import"../../chunk-
|
|
45
|
+
import"../../chunk-n5vr1tn6.js";
|
|
44
46
|
import"../../chunk-ngy1fdcx.js";
|
|
45
47
|
import"../../chunk-y2pv8d6a.js";
|
|
46
48
|
import"../../chunk-01nfqm18.js";
|
|
@@ -69,6 +71,8 @@ export {
|
|
|
69
71
|
createStepDefinitionsClient,
|
|
70
72
|
defineMcp,
|
|
71
73
|
defineStep,
|
|
74
|
+
grantActionValues,
|
|
75
|
+
grantScopeValues,
|
|
72
76
|
isMcpHandle,
|
|
73
77
|
isSecretLookingEnvName,
|
|
74
78
|
normalizeArtifactAccept,
|
|
@@ -32,7 +32,37 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
32
32
|
on: Array<string>;
|
|
33
33
|
maxAttempts: number;
|
|
34
34
|
}>;
|
|
35
|
-
|
|
35
|
+
grants: Array<{
|
|
36
|
+
resource: string;
|
|
37
|
+
action: string;
|
|
38
|
+
scope: "self" | "children";
|
|
39
|
+
} | {
|
|
40
|
+
resource: string;
|
|
41
|
+
action: string;
|
|
42
|
+
scope: "self" | "children";
|
|
43
|
+
} | {
|
|
44
|
+
resource: string;
|
|
45
|
+
action: string;
|
|
46
|
+
scope: "self" | "children";
|
|
47
|
+
} | {
|
|
48
|
+
resource: string;
|
|
49
|
+
action: string;
|
|
50
|
+
scope: "self" | "children";
|
|
51
|
+
labels: Array<string>;
|
|
52
|
+
} | {
|
|
53
|
+
resource: string;
|
|
54
|
+
action: string;
|
|
55
|
+
scope: "self" | "children";
|
|
56
|
+
} | {
|
|
57
|
+
resource: string;
|
|
58
|
+
action: string;
|
|
59
|
+
scope: "self" | "children";
|
|
60
|
+
} | {
|
|
61
|
+
resource: string;
|
|
62
|
+
action: string;
|
|
63
|
+
scope: string;
|
|
64
|
+
labels: Array<string>;
|
|
65
|
+
}>;
|
|
36
66
|
maxTurns: number | unknown;
|
|
37
67
|
concurrency: {
|
|
38
68
|
max: number;
|
|
@@ -164,7 +194,37 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
164
194
|
on: Array<string>;
|
|
165
195
|
maxAttempts: number;
|
|
166
196
|
}>;
|
|
167
|
-
|
|
197
|
+
grants: Array<{
|
|
198
|
+
resource: string;
|
|
199
|
+
action: string;
|
|
200
|
+
scope: "self" | "children";
|
|
201
|
+
} | {
|
|
202
|
+
resource: string;
|
|
203
|
+
action: string;
|
|
204
|
+
scope: "self" | "children";
|
|
205
|
+
} | {
|
|
206
|
+
resource: string;
|
|
207
|
+
action: string;
|
|
208
|
+
scope: "self" | "children";
|
|
209
|
+
} | {
|
|
210
|
+
resource: string;
|
|
211
|
+
action: string;
|
|
212
|
+
scope: "self" | "children";
|
|
213
|
+
labels: Array<string>;
|
|
214
|
+
} | {
|
|
215
|
+
resource: string;
|
|
216
|
+
action: string;
|
|
217
|
+
scope: "self" | "children";
|
|
218
|
+
} | {
|
|
219
|
+
resource: string;
|
|
220
|
+
action: string;
|
|
221
|
+
scope: "self" | "children";
|
|
222
|
+
} | {
|
|
223
|
+
resource: string;
|
|
224
|
+
action: string;
|
|
225
|
+
scope: string;
|
|
226
|
+
labels: Array<string>;
|
|
227
|
+
}>;
|
|
168
228
|
maxTurns: number | unknown;
|
|
169
229
|
concurrency: {
|
|
170
230
|
max: number;
|
|
@@ -306,7 +366,37 @@ declare const buildStepDefinitionsClient: (stepDefinitions: StepDefinitions) =>
|
|
|
306
366
|
on: Array<string>;
|
|
307
367
|
maxAttempts: number;
|
|
308
368
|
}>;
|
|
309
|
-
|
|
369
|
+
grants: Array<{
|
|
370
|
+
resource: string;
|
|
371
|
+
action: string;
|
|
372
|
+
scope: "self" | "children";
|
|
373
|
+
} | {
|
|
374
|
+
resource: string;
|
|
375
|
+
action: string;
|
|
376
|
+
scope: "self" | "children";
|
|
377
|
+
} | {
|
|
378
|
+
resource: string;
|
|
379
|
+
action: string;
|
|
380
|
+
scope: "self" | "children";
|
|
381
|
+
} | {
|
|
382
|
+
resource: string;
|
|
383
|
+
action: string;
|
|
384
|
+
scope: "self" | "children";
|
|
385
|
+
labels: Array<string>;
|
|
386
|
+
} | {
|
|
387
|
+
resource: string;
|
|
388
|
+
action: string;
|
|
389
|
+
scope: "self" | "children";
|
|
390
|
+
} | {
|
|
391
|
+
resource: string;
|
|
392
|
+
action: string;
|
|
393
|
+
scope: "self" | "children";
|
|
394
|
+
} | {
|
|
395
|
+
resource: string;
|
|
396
|
+
action: string;
|
|
397
|
+
scope: string;
|
|
398
|
+
labels: Array<string>;
|
|
399
|
+
}>;
|
|
310
400
|
maxTurns: number | unknown;
|
|
311
401
|
concurrency: {
|
|
312
402
|
max: number;
|