@boboddy/sdk 0.1.44-alpha → 0.2.1-alpha
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/client.js +97 -18
- package/dist/defaults/index.js +3 -3
- package/dist/definitions/pipelines/builder-helpers.d.ts +69 -0
- package/dist/definitions/pipelines/builder.d.ts +4 -57
- package/dist/definitions/pipelines/index.js +168 -101
- package/dist/definitions/steps/index.js +155 -75
- package/dist/definitions/steps/step-features.d.ts +34 -10
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/sdk.gen.d.ts +29 -9
- package/dist/generated/types.gen.d.ts +2267 -1318
- package/dist/index.js +252 -158
- package/dist/opencode-mcp.js +2 -2
- package/dist/opencode-plugin.js +2 -2
- package/dist/push/index.js +245 -159
- package/dist/step-execution-plane-client.d.ts +11 -0
- package/package.json +1 -1
package/dist/push/index.js
CHANGED
|
@@ -11235,7 +11235,7 @@ function finalize(ctx, schema) {
|
|
|
11235
11235
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
11236
11236
|
} else if (ctx.target === "draft-04") {
|
|
11237
11237
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
11238
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
11238
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
11239
11239
|
if (ctx.external?.uri) {
|
|
11240
11240
|
const id = ctx.external.registry.get(schema)?.id;
|
|
11241
11241
|
if (!id)
|
|
@@ -11479,7 +11479,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
|
|
|
11479
11479
|
if (val === undefined) {
|
|
11480
11480
|
if (ctx.unrepresentable === "throw") {
|
|
11481
11481
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
11482
|
-
}
|
|
11482
|
+
}
|
|
11483
11483
|
} else if (typeof val === "bigint") {
|
|
11484
11484
|
if (ctx.unrepresentable === "throw") {
|
|
11485
11485
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -11984,29 +11984,29 @@ function renderPromptTemplate(template, contextJson) {
|
|
|
11984
11984
|
}
|
|
11985
11985
|
|
|
11986
11986
|
// src/definitions/steps/define-step.ts
|
|
11987
|
-
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
|
|
11987
|
+
function resolveZodSchemaAtPath(schema, path) {
|
|
11988
|
+
if (!schema)
|
|
11989
|
+
return;
|
|
11990
|
+
const segments = path.split(".");
|
|
11991
|
+
let current = schema;
|
|
11992
|
+
for (const segment of segments) {
|
|
11993
|
+
if (!current)
|
|
11994
|
+
return;
|
|
11995
|
+
current = unwrapZodWrappers(current);
|
|
11996
|
+
const def = current.def;
|
|
11997
|
+
if (!def || def.type !== "object" || !def.shape)
|
|
11998
|
+
return;
|
|
11999
|
+
current = def.shape[segment];
|
|
11994
12000
|
}
|
|
11995
|
-
return
|
|
12001
|
+
return current;
|
|
11996
12002
|
}
|
|
11997
|
-
function
|
|
12003
|
+
function zodTypeToSignalType(schema) {
|
|
11998
12004
|
if (!schema)
|
|
11999
|
-
return
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
const next = current._def.shape?.[part];
|
|
12005
|
-
if (!next)
|
|
12006
|
-
return "string";
|
|
12007
|
-
current = unwrapZodType(next);
|
|
12008
|
-
}
|
|
12009
|
-
switch (current._def.type) {
|
|
12005
|
+
return;
|
|
12006
|
+
const unwrapped = unwrapZodWrappers(schema);
|
|
12007
|
+
const def = unwrapped.def;
|
|
12008
|
+
const typeName = def?.type;
|
|
12009
|
+
switch (typeName) {
|
|
12010
12010
|
case "string":
|
|
12011
12011
|
return "string";
|
|
12012
12012
|
case "number":
|
|
@@ -12016,12 +12016,21 @@ function deriveSignalType(schema, path) {
|
|
|
12016
12016
|
case "array":
|
|
12017
12017
|
return "array";
|
|
12018
12018
|
case "object":
|
|
12019
|
-
case "record":
|
|
12020
12019
|
return "object";
|
|
12021
12020
|
default:
|
|
12022
|
-
return
|
|
12021
|
+
return;
|
|
12023
12022
|
}
|
|
12024
12023
|
}
|
|
12024
|
+
function unwrapZodWrappers(schema) {
|
|
12025
|
+
const def = schema.def;
|
|
12026
|
+
if (!def)
|
|
12027
|
+
return schema;
|
|
12028
|
+
if (def.type === "optional" || def.type === "nullable" || def.type === "default" || def.type === "catch") {
|
|
12029
|
+
if (def.innerType)
|
|
12030
|
+
return unwrapZodWrappers(def.innerType);
|
|
12031
|
+
}
|
|
12032
|
+
return schema;
|
|
12033
|
+
}
|
|
12025
12034
|
function defineStep(config2) {
|
|
12026
12035
|
const features = config2.features ?? [];
|
|
12027
12036
|
let effectiveResult = config2.result;
|
|
@@ -12052,7 +12061,7 @@ ${feature._promptAddition}` : feature._promptAddition;
|
|
|
12052
12061
|
...(config2.signals ?? []).map((s) => ({
|
|
12053
12062
|
key: s.key ?? s.sourcePath,
|
|
12054
12063
|
sourcePath: s.sourcePath,
|
|
12055
|
-
type: s.type ??
|
|
12064
|
+
type: s.type ?? zodTypeToSignalType(resolveZodSchemaAtPath(effectiveResult, s.sourcePath)) ?? "string",
|
|
12056
12065
|
required: s.required ?? true,
|
|
12057
12066
|
availableWhenResultStatusIn: s.availableWhenResultStatusIn ?? null
|
|
12058
12067
|
})),
|
|
@@ -12919,15 +12928,6 @@ class Api extends HeyApiClient {
|
|
|
12919
12928
|
"allApiAuth*8"(options) {
|
|
12920
12929
|
return (options?.client ?? this.client).trace({ url: "/api/auth/*", ...options });
|
|
12921
12930
|
}
|
|
12922
|
-
getApiIntegrationsGithubInstall(options) {
|
|
12923
|
-
return (options?.client ?? this.client).get({ url: "/api/integrations/github/install", ...options });
|
|
12924
|
-
}
|
|
12925
|
-
getApiIntegrationsGithubCallback(options) {
|
|
12926
|
-
return (options?.client ?? this.client).get({ url: "/api/integrations/github/callback", ...options });
|
|
12927
|
-
}
|
|
12928
|
-
postApiIntegrationsGithubWebhook(options) {
|
|
12929
|
-
return (options?.client ?? this.client).post({ url: "/api/integrations/github/webhook", ...options });
|
|
12930
|
-
}
|
|
12931
12931
|
}
|
|
12932
12932
|
|
|
12933
12933
|
class Projects extends HeyApiClient {
|
|
@@ -13073,6 +13073,22 @@ class StepExecutions extends HeyApiClient {
|
|
|
13073
13073
|
getStepExecution(options) {
|
|
13074
13074
|
return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}", ...options });
|
|
13075
13075
|
}
|
|
13076
|
+
readStepExecutionLogs(options) {
|
|
13077
|
+
return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/logs", ...options });
|
|
13078
|
+
}
|
|
13079
|
+
appendStepExecutionLogs(options) {
|
|
13080
|
+
return (options.client ?? this.client).post({
|
|
13081
|
+
url: "/api/step-executions/{stepExecutionId}/logs",
|
|
13082
|
+
...options,
|
|
13083
|
+
headers: {
|
|
13084
|
+
"Content-Type": "application/json",
|
|
13085
|
+
...options.headers
|
|
13086
|
+
}
|
|
13087
|
+
});
|
|
13088
|
+
}
|
|
13089
|
+
getStepExecutionLogArchive(options) {
|
|
13090
|
+
return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/logs/archive", ...options });
|
|
13091
|
+
}
|
|
13076
13092
|
}
|
|
13077
13093
|
|
|
13078
13094
|
class PipelineDefinitions extends HeyApiClient {
|
|
@@ -13288,12 +13304,41 @@ class ProjectContext extends HeyApiClient {
|
|
|
13288
13304
|
}
|
|
13289
13305
|
}
|
|
13290
13306
|
|
|
13291
|
-
class
|
|
13292
|
-
|
|
13293
|
-
return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/
|
|
13307
|
+
class UserNotifications extends HeyApiClient {
|
|
13308
|
+
listUserNotifications(options) {
|
|
13309
|
+
return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/notifications", ...options });
|
|
13310
|
+
}
|
|
13311
|
+
getUserNotification(options) {
|
|
13312
|
+
return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/notifications/{notificationId}", ...options });
|
|
13313
|
+
}
|
|
13314
|
+
dismissUserNotification(options) {
|
|
13315
|
+
return (options.client ?? this.client).post({ url: "/api/projects/{projectId}/notifications/{notificationId}/dismiss", ...options });
|
|
13316
|
+
}
|
|
13317
|
+
respondToFeedbackRequest(options) {
|
|
13318
|
+
return (options.client ?? this.client).post({
|
|
13319
|
+
url: "/api/projects/{projectId}/notifications/{notificationId}/respond",
|
|
13320
|
+
...options,
|
|
13321
|
+
headers: {
|
|
13322
|
+
"Content-Type": "application/json",
|
|
13323
|
+
...options.headers
|
|
13324
|
+
}
|
|
13325
|
+
});
|
|
13326
|
+
}
|
|
13327
|
+
}
|
|
13328
|
+
|
|
13329
|
+
class NotificationRules extends HeyApiClient {
|
|
13330
|
+
listNotificationRules(options) {
|
|
13331
|
+
return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/notification-rules", ...options });
|
|
13294
13332
|
}
|
|
13295
|
-
|
|
13296
|
-
return (options.client ?? this.client).
|
|
13333
|
+
upsertNotificationRule(options) {
|
|
13334
|
+
return (options.client ?? this.client).put({
|
|
13335
|
+
url: "/api/projects/{projectId}/notification-rules",
|
|
13336
|
+
...options,
|
|
13337
|
+
headers: {
|
|
13338
|
+
"Content-Type": "application/json",
|
|
13339
|
+
...options.headers
|
|
13340
|
+
}
|
|
13341
|
+
});
|
|
13297
13342
|
}
|
|
13298
13343
|
}
|
|
13299
13344
|
|
|
@@ -13345,6 +13390,18 @@ class ProjectIntegrations extends HeyApiClient {
|
|
|
13345
13390
|
}
|
|
13346
13391
|
}
|
|
13347
13392
|
|
|
13393
|
+
class GitHubIntegrations extends HeyApiClient {
|
|
13394
|
+
beginGitHubAppInstall(options) {
|
|
13395
|
+
return (options?.client ?? this.client).get({ url: "/api/integrations/github/install", ...options });
|
|
13396
|
+
}
|
|
13397
|
+
completeGitHubAppInstall(options) {
|
|
13398
|
+
return (options?.client ?? this.client).get({ url: "/api/integrations/github/callback", ...options });
|
|
13399
|
+
}
|
|
13400
|
+
handleGitHubWebhook(options) {
|
|
13401
|
+
return (options?.client ?? this.client).post({ url: "/api/integrations/github/webhook", ...options });
|
|
13402
|
+
}
|
|
13403
|
+
}
|
|
13404
|
+
|
|
13348
13405
|
class ProjectInvites extends HeyApiClient {
|
|
13349
13406
|
getProjectInviteByToken(options) {
|
|
13350
13407
|
return (options.client ?? this.client).get({ url: "/api/project-invites/{token}", ...options });
|
|
@@ -13370,6 +13427,12 @@ class ProjectInvites extends HeyApiClient {
|
|
|
13370
13427
|
}
|
|
13371
13428
|
}
|
|
13372
13429
|
|
|
13430
|
+
class Billing extends HeyApiClient {
|
|
13431
|
+
getOrgUsage(options) {
|
|
13432
|
+
return (options.client ?? this.client).get({ url: "/api/orgs/{orgId}/usage", ...options });
|
|
13433
|
+
}
|
|
13434
|
+
}
|
|
13435
|
+
|
|
13373
13436
|
class BoboddyClient extends HeyApiClient {
|
|
13374
13437
|
static __registry = new HeyApiRegistry;
|
|
13375
13438
|
constructor(args) {
|
|
@@ -13408,9 +13471,13 @@ class BoboddyClient extends HeyApiClient {
|
|
|
13408
13471
|
get projectContext() {
|
|
13409
13472
|
return this._projectContext ??= new ProjectContext({ client: this.client });
|
|
13410
13473
|
}
|
|
13411
|
-
|
|
13412
|
-
get
|
|
13413
|
-
return this.
|
|
13474
|
+
_userNotifications;
|
|
13475
|
+
get userNotifications() {
|
|
13476
|
+
return this._userNotifications ??= new UserNotifications({ client: this.client });
|
|
13477
|
+
}
|
|
13478
|
+
_notificationRules;
|
|
13479
|
+
get notificationRules() {
|
|
13480
|
+
return this._notificationRules ??= new NotificationRules({ client: this.client });
|
|
13414
13481
|
}
|
|
13415
13482
|
_stepDefinitionTemplates;
|
|
13416
13483
|
get stepDefinitionTemplates() {
|
|
@@ -13420,10 +13487,18 @@ class BoboddyClient extends HeyApiClient {
|
|
|
13420
13487
|
get projectIntegrations() {
|
|
13421
13488
|
return this._projectIntegrations ??= new ProjectIntegrations({ client: this.client });
|
|
13422
13489
|
}
|
|
13490
|
+
_gitHubIntegrations;
|
|
13491
|
+
get gitHubIntegrations() {
|
|
13492
|
+
return this._gitHubIntegrations ??= new GitHubIntegrations({ client: this.client });
|
|
13493
|
+
}
|
|
13423
13494
|
_projectInvites;
|
|
13424
13495
|
get projectInvites() {
|
|
13425
13496
|
return this._projectInvites ??= new ProjectInvites({ client: this.client });
|
|
13426
13497
|
}
|
|
13498
|
+
_billing;
|
|
13499
|
+
get billing() {
|
|
13500
|
+
return this._billing ??= new Billing({ client: this.client });
|
|
13501
|
+
}
|
|
13427
13502
|
}
|
|
13428
13503
|
|
|
13429
13504
|
// src/definitions/steps/step-definitions-client.ts
|
|
@@ -15811,61 +15886,66 @@ function date4(params) {
|
|
|
15811
15886
|
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
15812
15887
|
config(en_default());
|
|
15813
15888
|
// src/definitions/steps/step-features.ts
|
|
15814
|
-
var
|
|
15815
|
-
var
|
|
15816
|
-
var
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
|
-
|
|
15820
|
-
"
|
|
15821
|
-
|
|
15822
|
-
|
|
15823
|
-
|
|
15824
|
-
|
|
15825
|
-
|
|
15826
|
-
|
|
15827
|
-
|
|
15828
|
-
|
|
15829
|
-
|
|
15889
|
+
var NOTIFICATION_SIGNAL_KEY = "$boboddy_notifications_v1";
|
|
15890
|
+
var NOTIFICATION_RESULT_KEY = "$boboddy_notifications_v1";
|
|
15891
|
+
var notificationItemSchema = exports_external.object({
|
|
15892
|
+
kind: exports_external.enum([
|
|
15893
|
+
"feedback_request",
|
|
15894
|
+
"status_update",
|
|
15895
|
+
"blocked",
|
|
15896
|
+
"result_ready",
|
|
15897
|
+
"warning"
|
|
15898
|
+
]).describe("The kind of user notification."),
|
|
15899
|
+
title: exports_external.string().describe("Short, human-readable notification title."),
|
|
15900
|
+
body: exports_external.string().describe("The notification body / details."),
|
|
15901
|
+
priority: exports_external.enum(["low", "normal", "high", "urgent"]).describe("How important this notification is for the user."),
|
|
15902
|
+
suggestedChannels: exports_external.array(exports_external.enum(["in_app", "work_item_platform_comment", "email", "slack"])).optional().describe("Channels the agent thinks are worth using. The platform policy decides the final channels."),
|
|
15903
|
+
payload: exports_external.record(exports_external.string(), exports_external.unknown()).optional().describe('Kind-specific structured data. For "feedback_request": { category, urgency, suggestedKey? }.')
|
|
15904
|
+
}).describe("A single user notification emitted by the agent.");
|
|
15905
|
+
var notificationsFeature = {
|
|
15830
15906
|
_resultExtension: exports_external.object({
|
|
15831
|
-
[
|
|
15907
|
+
[NOTIFICATION_RESULT_KEY]: exports_external.array(notificationItemSchema).optional()
|
|
15832
15908
|
}),
|
|
15833
15909
|
_promptAddition: [
|
|
15834
|
-
"##
|
|
15910
|
+
"## User Notifications",
|
|
15835
15911
|
"",
|
|
15836
|
-
`If you
|
|
15912
|
+
`If you need to communicate something to a human, populate the \`${NOTIFICATION_RESULT_KEY}\` array.`,
|
|
15837
15913
|
"Each item must include:",
|
|
15838
|
-
"- **
|
|
15839
|
-
|
|
15840
|
-
"- **
|
|
15841
|
-
|
|
15842
|
-
'
|
|
15843
|
-
|
|
15844
|
-
'
|
|
15845
|
-
"- **suggestedKey** *(optional)*: A suggested answer key for reference."
|
|
15914
|
+
"- **kind**: One of `feedback_request`, `status_update`, `blocked`, `result_ready`, `warning`.",
|
|
15915
|
+
"- **title**: A short, human-readable title.",
|
|
15916
|
+
"- **body**: The details of the notification.",
|
|
15917
|
+
"- **priority**: One of `low`, `normal`, `high`, `urgent`.",
|
|
15918
|
+
'- **suggestedChannels** *(optional)*: Channels you think are worth using (e.g. `["in_app", "work_item_platform_comment"]`).',
|
|
15919
|
+
" You only *suggest* channels \u2014 the platform policy decides the final delivery channels.",
|
|
15920
|
+
'- **payload** *(optional)*: Kind-specific data. For `feedback_request`, include `{ "category": string, "urgency": "blocking"|"clarification"|"assumption"|"informational", "suggestedKey"?: string }`.'
|
|
15846
15921
|
].join(`
|
|
15847
15922
|
`),
|
|
15848
15923
|
_signals: [
|
|
15849
15924
|
{
|
|
15850
|
-
key:
|
|
15851
|
-
sourcePath:
|
|
15925
|
+
key: NOTIFICATION_SIGNAL_KEY,
|
|
15926
|
+
sourcePath: NOTIFICATION_RESULT_KEY,
|
|
15852
15927
|
type: "array",
|
|
15853
15928
|
required: false
|
|
15854
15929
|
}
|
|
15855
15930
|
]
|
|
15856
15931
|
};
|
|
15857
15932
|
var Features = {
|
|
15858
|
-
|
|
15933
|
+
notifications: Object.assign(() => notificationsFeature, {
|
|
15859
15934
|
signal: {
|
|
15860
|
-
key:
|
|
15935
|
+
key: NOTIFICATION_SIGNAL_KEY,
|
|
15861
15936
|
find(signals) {
|
|
15862
|
-
const match = signals.find((s) => s.key ===
|
|
15937
|
+
const match = signals.find((s) => s.key === NOTIFICATION_SIGNAL_KEY);
|
|
15863
15938
|
if (!match)
|
|
15864
15939
|
return;
|
|
15865
|
-
const parsed = exports_external.array(
|
|
15940
|
+
const parsed = exports_external.array(notificationItemSchema).safeParse(match.valueJson);
|
|
15866
15941
|
return parsed.success ? parsed.data : undefined;
|
|
15867
15942
|
}
|
|
15868
15943
|
}
|
|
15944
|
+
}),
|
|
15945
|
+
feedbackRequests: Object.assign(() => notificationsFeature, {
|
|
15946
|
+
signal: {
|
|
15947
|
+
key: NOTIFICATION_SIGNAL_KEY
|
|
15948
|
+
}
|
|
15869
15949
|
})
|
|
15870
15950
|
};
|
|
15871
15951
|
// src/definitions/advancement-policies/define-advancement-policy.ts
|
|
@@ -16221,6 +16301,82 @@ function materializeAccessor(accessor) {
|
|
|
16221
16301
|
};
|
|
16222
16302
|
}
|
|
16223
16303
|
|
|
16304
|
+
// src/definitions/pipelines/builder-helpers.ts
|
|
16305
|
+
var WORK_ITEM_ACCESSOR = Object.freeze({
|
|
16306
|
+
title: Object.freeze({ source: "work_item", field: "title" }),
|
|
16307
|
+
description: Object.freeze({
|
|
16308
|
+
source: "work_item",
|
|
16309
|
+
field: "description"
|
|
16310
|
+
}),
|
|
16311
|
+
field: (fieldName) => Object.freeze({ source: "work_item", field: `fields.${fieldName}` })
|
|
16312
|
+
});
|
|
16313
|
+
var WORK_ITEM_FIELD_BINDINGS = {
|
|
16314
|
+
workItemTitle: { source: "work_item", field: "title" },
|
|
16315
|
+
workItemDescription: { source: "work_item", field: "description" }
|
|
16316
|
+
};
|
|
16317
|
+
function makeStepInputCtx(inputSchema) {
|
|
16318
|
+
const baseAccessor = createInputAccessor(inputSchema);
|
|
16319
|
+
const input = new Proxy(baseAccessor, {
|
|
16320
|
+
get(target, prop) {
|
|
16321
|
+
if (typeof prop === "string" && prop in WORK_ITEM_FIELD_BINDINGS) {
|
|
16322
|
+
return WORK_ITEM_FIELD_BINDINGS[prop];
|
|
16323
|
+
}
|
|
16324
|
+
return target[prop];
|
|
16325
|
+
}
|
|
16326
|
+
});
|
|
16327
|
+
return {
|
|
16328
|
+
input,
|
|
16329
|
+
signal(step, key) {
|
|
16330
|
+
return { source: "step_signal", step, signalKey: key };
|
|
16331
|
+
},
|
|
16332
|
+
output(step) {
|
|
16333
|
+
return { source: "step_output", step };
|
|
16334
|
+
},
|
|
16335
|
+
literal: literal2
|
|
16336
|
+
};
|
|
16337
|
+
}
|
|
16338
|
+
function literal2(value) {
|
|
16339
|
+
return { source: "literal", value };
|
|
16340
|
+
}
|
|
16341
|
+
function normalizeInputMapping(mapping) {
|
|
16342
|
+
if (!mapping)
|
|
16343
|
+
return;
|
|
16344
|
+
const out = {};
|
|
16345
|
+
for (const [key, value] of Object.entries(mapping)) {
|
|
16346
|
+
if (value === undefined)
|
|
16347
|
+
continue;
|
|
16348
|
+
out[key] = isInputAccessor(value) ? materializeAccessor(value) : value;
|
|
16349
|
+
}
|
|
16350
|
+
return out;
|
|
16351
|
+
}
|
|
16352
|
+
function resolveAdditionalStepInputBindings(label, definition) {
|
|
16353
|
+
if (!definition) {
|
|
16354
|
+
return {};
|
|
16355
|
+
}
|
|
16356
|
+
const raw = definition.bindings({
|
|
16357
|
+
workItemField: (fieldName) => ({
|
|
16358
|
+
source: "work_item",
|
|
16359
|
+
field: `fields.${fieldName}`
|
|
16360
|
+
}),
|
|
16361
|
+
literal: literal2
|
|
16362
|
+
});
|
|
16363
|
+
if (definition.schema instanceof exports_external.ZodObject) {
|
|
16364
|
+
const validKeys = new Set(Object.keys(definition.schema.shape));
|
|
16365
|
+
const unknown2 = Object.keys(raw).filter((key) => !validKeys.has(key));
|
|
16366
|
+
if (unknown2.length > 0) {
|
|
16367
|
+
throw new Error(`${label}.bindings returned key${unknown2.length > 1 ? "s" : ""} not in schema: ${unknown2.map((key) => `"${key}"`).join(", ")}`);
|
|
16368
|
+
}
|
|
16369
|
+
}
|
|
16370
|
+
return normalizeInputMapping(raw) ?? {};
|
|
16371
|
+
}
|
|
16372
|
+
function mergeStepBindings(pipelineBindings, explicitBindings) {
|
|
16373
|
+
const merged = {
|
|
16374
|
+
...pipelineBindings,
|
|
16375
|
+
...explicitBindings ?? {}
|
|
16376
|
+
};
|
|
16377
|
+
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
16378
|
+
}
|
|
16379
|
+
|
|
16224
16380
|
// src/definitions/pipelines/builder.ts
|
|
16225
16381
|
class PipelineStepAdvancementBuilder {
|
|
16226
16382
|
inputSchema;
|
|
@@ -16237,6 +16393,8 @@ class PipelineStepAdvancementBuilder {
|
|
|
16237
16393
|
}
|
|
16238
16394
|
advance(callback) {
|
|
16239
16395
|
const last = this.steps.at(-1);
|
|
16396
|
+
if (!last)
|
|
16397
|
+
throw new Error("Internal error: no steps available");
|
|
16240
16398
|
const ctx = makeAdvanceCtx();
|
|
16241
16399
|
const result = callback(ctx);
|
|
16242
16400
|
const policy = {
|
|
@@ -16333,80 +16491,6 @@ class PipelineBuilder {
|
|
|
16333
16491
|
return new PipelineStepAdvancementBuilder(this.inputSchema, this.meta, this.steps, this.pipelineInputBindings, this.pipelineStepInputBindings);
|
|
16334
16492
|
}
|
|
16335
16493
|
}
|
|
16336
|
-
var WORK_ITEM_ACCESSOR = Object.freeze({
|
|
16337
|
-
title: Object.freeze({ source: "work_item", field: "title" }),
|
|
16338
|
-
description: Object.freeze({
|
|
16339
|
-
source: "work_item",
|
|
16340
|
-
field: "description"
|
|
16341
|
-
}),
|
|
16342
|
-
field: (fieldName) => Object.freeze({ source: "work_item", field: `fields.${fieldName}` })
|
|
16343
|
-
});
|
|
16344
|
-
var WORK_ITEM_FIELD_BINDINGS = {
|
|
16345
|
-
workItemTitle: { source: "work_item", field: "title" },
|
|
16346
|
-
workItemDescription: { source: "work_item", field: "description" }
|
|
16347
|
-
};
|
|
16348
|
-
function makeStepInputCtx(inputSchema) {
|
|
16349
|
-
const baseAccessor = createInputAccessor(inputSchema);
|
|
16350
|
-
const input = new Proxy(baseAccessor, {
|
|
16351
|
-
get(target, prop) {
|
|
16352
|
-
if (typeof prop === "string" && prop in WORK_ITEM_FIELD_BINDINGS) {
|
|
16353
|
-
return WORK_ITEM_FIELD_BINDINGS[prop];
|
|
16354
|
-
}
|
|
16355
|
-
return target[prop];
|
|
16356
|
-
}
|
|
16357
|
-
});
|
|
16358
|
-
return {
|
|
16359
|
-
input,
|
|
16360
|
-
signal(step, key) {
|
|
16361
|
-
return { source: "step_signal", step, signalKey: key };
|
|
16362
|
-
},
|
|
16363
|
-
output(step) {
|
|
16364
|
-
return { source: "step_output", step };
|
|
16365
|
-
},
|
|
16366
|
-
literal: literal2
|
|
16367
|
-
};
|
|
16368
|
-
}
|
|
16369
|
-
function literal2(value) {
|
|
16370
|
-
return { source: "literal", value };
|
|
16371
|
-
}
|
|
16372
|
-
function normalizeInputMapping(mapping) {
|
|
16373
|
-
if (!mapping)
|
|
16374
|
-
return;
|
|
16375
|
-
const out = {};
|
|
16376
|
-
for (const [key, value] of Object.entries(mapping)) {
|
|
16377
|
-
if (value === undefined)
|
|
16378
|
-
continue;
|
|
16379
|
-
out[key] = isInputAccessor(value) ? materializeAccessor(value) : value;
|
|
16380
|
-
}
|
|
16381
|
-
return out;
|
|
16382
|
-
}
|
|
16383
|
-
function resolveAdditionalStepInputBindings(label, definition) {
|
|
16384
|
-
if (!definition) {
|
|
16385
|
-
return {};
|
|
16386
|
-
}
|
|
16387
|
-
const raw = definition.bindings({
|
|
16388
|
-
workItemField: (fieldName) => ({
|
|
16389
|
-
source: "work_item",
|
|
16390
|
-
field: `fields.${fieldName}`
|
|
16391
|
-
}),
|
|
16392
|
-
literal: literal2
|
|
16393
|
-
});
|
|
16394
|
-
if (definition.schema instanceof exports_external.ZodObject) {
|
|
16395
|
-
const validKeys = new Set(Object.keys(definition.schema.shape));
|
|
16396
|
-
const unknown2 = Object.keys(raw).filter((key) => !validKeys.has(key));
|
|
16397
|
-
if (unknown2.length > 0) {
|
|
16398
|
-
throw new Error(`${label}.bindings returned key${unknown2.length > 1 ? "s" : ""} not in schema: ${unknown2.map((key) => `"${key}"`).join(", ")}`);
|
|
16399
|
-
}
|
|
16400
|
-
}
|
|
16401
|
-
return normalizeInputMapping(raw) ?? {};
|
|
16402
|
-
}
|
|
16403
|
-
function mergeStepBindings(pipelineBindings, explicitBindings) {
|
|
16404
|
-
const merged = {
|
|
16405
|
-
...pipelineBindings,
|
|
16406
|
-
...explicitBindings ?? {}
|
|
16407
|
-
};
|
|
16408
|
-
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
16409
|
-
}
|
|
16410
16494
|
function pipeline(meta3) {
|
|
16411
16495
|
return new PipelineBuilder(meta3);
|
|
16412
16496
|
}
|
|
@@ -16424,7 +16508,7 @@ var buildPipelineDefinitionsClient = (pipelineDefinitions) => {
|
|
|
16424
16508
|
});
|
|
16425
16509
|
if (result.error)
|
|
16426
16510
|
throw new Error(JSON.stringify(result.error));
|
|
16427
|
-
return result.data
|
|
16511
|
+
return result.data;
|
|
16428
16512
|
},
|
|
16429
16513
|
upsertFromSpec: async (projectId, spec, stepDefs, options) => {
|
|
16430
16514
|
const stepDefMap = new Map;
|
|
@@ -16504,7 +16588,7 @@ function makeFieldRef(fact, path) {
|
|
|
16504
16588
|
};
|
|
16505
16589
|
}
|
|
16506
16590
|
function makeAssign(pipeline2) {
|
|
16507
|
-
if (typeof pipeline2 !== "object" ||
|
|
16591
|
+
if (typeof pipeline2 !== "object" || typeof pipeline2["key"] !== "string" || !Array.isArray(pipeline2["steps"])) {
|
|
16508
16592
|
throw new Error("assign() requires a pipeline spec produced by pipeline().build(). " + "Pass the default-exported value from a pipeline definition file.");
|
|
16509
16593
|
}
|
|
16510
16594
|
return { _tag: "assign", pipeline: pipeline2 };
|
|
@@ -16553,13 +16637,10 @@ function serializeConditionNode(condition) {
|
|
|
16553
16637
|
value: condition.value
|
|
16554
16638
|
};
|
|
16555
16639
|
}
|
|
16556
|
-
if (condition.
|
|
16557
|
-
|
|
16558
|
-
return { all: condition.conditions.map(serializeConditionNode) };
|
|
16559
|
-
}
|
|
16560
|
-
return { any: condition.conditions.map(serializeConditionNode) };
|
|
16640
|
+
if (condition.mode === "all") {
|
|
16641
|
+
return { all: condition.conditions.map(serializeConditionNode) };
|
|
16561
16642
|
}
|
|
16562
|
-
|
|
16643
|
+
return { any: condition.conditions.map(serializeConditionNode) };
|
|
16563
16644
|
}
|
|
16564
16645
|
function serializeOutcome(outcome) {
|
|
16565
16646
|
if (outcome._tag === "skip")
|
|
@@ -16637,7 +16718,9 @@ function extractRoutePipelineKeys(policy) {
|
|
|
16637
16718
|
}
|
|
16638
16719
|
var PUSH_SCRIPT_NAMES = new Set(["push.ts", "push.mjs", "push.js"]);
|
|
16639
16720
|
async function pushFromDirectory(dir, opts) {
|
|
16640
|
-
const log = opts.log ?? ((msg) =>
|
|
16721
|
+
const log = opts.log ?? ((msg) => {
|
|
16722
|
+
console.warn(msg);
|
|
16723
|
+
});
|
|
16641
16724
|
const headers = { Authorization: `Bearer ${opts.accessToken}` };
|
|
16642
16725
|
const absDir = resolve(dir);
|
|
16643
16726
|
const allFiles = readdirSync(absDir).filter((f) => f.endsWith(".ts") || f.endsWith(".js"));
|
|
@@ -16695,7 +16778,7 @@ async function pushFromDirectory(dir, opts) {
|
|
|
16695
16778
|
const serverSteps = await stepsClient.listByProjectId(opts.projectId, {
|
|
16696
16779
|
headers
|
|
16697
16780
|
});
|
|
16698
|
-
const stepDefs =
|
|
16781
|
+
const stepDefs = serverSteps.map((s) => ({
|
|
16699
16782
|
id: s.id,
|
|
16700
16783
|
key: s.key,
|
|
16701
16784
|
version: s.version
|
|
@@ -16746,6 +16829,9 @@ async function syncDefaultPipelineAssignment(spec, opts, headers, pipelinesClien
|
|
|
16746
16829
|
}
|
|
16747
16830
|
}
|
|
16748
16831
|
const linearPipelineDefinitionId = pipelineKeyToId.get(serialized.linearPipelineDefinitionKey);
|
|
16832
|
+
if (!linearPipelineDefinitionId) {
|
|
16833
|
+
throw new Error(`Pipeline key "${serialized.linearPipelineDefinitionKey}" was not found on the server.`);
|
|
16834
|
+
}
|
|
16749
16835
|
const resolvedRules = serialized.rulesJson.rules.map((rule) => {
|
|
16750
16836
|
if (rule.event.type === "assign" && typeof rule.event.params?.["pipelineKey"] === "string") {
|
|
16751
16837
|
const pKey = rule.event.params["pipelineKey"];
|
|
@@ -186,5 +186,16 @@ declare const buildStepExecutionPlaneClient: (stepExecutions: StepExecutions) =>
|
|
|
186
186
|
resultJson: JsonValue;
|
|
187
187
|
errorJson: JsonValue;
|
|
188
188
|
}, options?: RequestOptions) => Promise<void>;
|
|
189
|
+
appendStepExecutionLogs: (stepExecutionId: string, body: {
|
|
190
|
+
claimToken: string;
|
|
191
|
+
lines: {
|
|
192
|
+
seq: number;
|
|
193
|
+
stream: "worker" | "ai-server" | "conversation";
|
|
194
|
+
ts: string;
|
|
195
|
+
content: string;
|
|
196
|
+
}[];
|
|
197
|
+
}, options?: RequestOptions) => Promise<{
|
|
198
|
+
nextOffset: number;
|
|
199
|
+
}>;
|
|
189
200
|
};
|
|
190
201
|
export {};
|