@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/index.js
CHANGED
|
@@ -864,15 +864,6 @@ class Api extends HeyApiClient {
|
|
|
864
864
|
"allApiAuth*8"(options) {
|
|
865
865
|
return (options?.client ?? this.client).trace({ url: "/api/auth/*", ...options });
|
|
866
866
|
}
|
|
867
|
-
getApiIntegrationsGithubInstall(options) {
|
|
868
|
-
return (options?.client ?? this.client).get({ url: "/api/integrations/github/install", ...options });
|
|
869
|
-
}
|
|
870
|
-
getApiIntegrationsGithubCallback(options) {
|
|
871
|
-
return (options?.client ?? this.client).get({ url: "/api/integrations/github/callback", ...options });
|
|
872
|
-
}
|
|
873
|
-
postApiIntegrationsGithubWebhook(options) {
|
|
874
|
-
return (options?.client ?? this.client).post({ url: "/api/integrations/github/webhook", ...options });
|
|
875
|
-
}
|
|
876
867
|
}
|
|
877
868
|
|
|
878
869
|
class Projects extends HeyApiClient {
|
|
@@ -1018,6 +1009,22 @@ class StepExecutions extends HeyApiClient {
|
|
|
1018
1009
|
getStepExecution(options) {
|
|
1019
1010
|
return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}", ...options });
|
|
1020
1011
|
}
|
|
1012
|
+
readStepExecutionLogs(options) {
|
|
1013
|
+
return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/logs", ...options });
|
|
1014
|
+
}
|
|
1015
|
+
appendStepExecutionLogs(options) {
|
|
1016
|
+
return (options.client ?? this.client).post({
|
|
1017
|
+
url: "/api/step-executions/{stepExecutionId}/logs",
|
|
1018
|
+
...options,
|
|
1019
|
+
headers: {
|
|
1020
|
+
"Content-Type": "application/json",
|
|
1021
|
+
...options.headers
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
getStepExecutionLogArchive(options) {
|
|
1026
|
+
return (options.client ?? this.client).get({ url: "/api/step-executions/{stepExecutionId}/logs/archive", ...options });
|
|
1027
|
+
}
|
|
1021
1028
|
}
|
|
1022
1029
|
|
|
1023
1030
|
class PipelineDefinitions extends HeyApiClient {
|
|
@@ -1233,12 +1240,41 @@ class ProjectContext extends HeyApiClient {
|
|
|
1233
1240
|
}
|
|
1234
1241
|
}
|
|
1235
1242
|
|
|
1236
|
-
class
|
|
1237
|
-
|
|
1238
|
-
return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/
|
|
1243
|
+
class UserNotifications extends HeyApiClient {
|
|
1244
|
+
listUserNotifications(options) {
|
|
1245
|
+
return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/notifications", ...options });
|
|
1246
|
+
}
|
|
1247
|
+
getUserNotification(options) {
|
|
1248
|
+
return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/notifications/{notificationId}", ...options });
|
|
1249
|
+
}
|
|
1250
|
+
dismissUserNotification(options) {
|
|
1251
|
+
return (options.client ?? this.client).post({ url: "/api/projects/{projectId}/notifications/{notificationId}/dismiss", ...options });
|
|
1252
|
+
}
|
|
1253
|
+
respondToFeedbackRequest(options) {
|
|
1254
|
+
return (options.client ?? this.client).post({
|
|
1255
|
+
url: "/api/projects/{projectId}/notifications/{notificationId}/respond",
|
|
1256
|
+
...options,
|
|
1257
|
+
headers: {
|
|
1258
|
+
"Content-Type": "application/json",
|
|
1259
|
+
...options.headers
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
class NotificationRules extends HeyApiClient {
|
|
1266
|
+
listNotificationRules(options) {
|
|
1267
|
+
return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/notification-rules", ...options });
|
|
1239
1268
|
}
|
|
1240
|
-
|
|
1241
|
-
return (options.client ?? this.client).
|
|
1269
|
+
upsertNotificationRule(options) {
|
|
1270
|
+
return (options.client ?? this.client).put({
|
|
1271
|
+
url: "/api/projects/{projectId}/notification-rules",
|
|
1272
|
+
...options,
|
|
1273
|
+
headers: {
|
|
1274
|
+
"Content-Type": "application/json",
|
|
1275
|
+
...options.headers
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1242
1278
|
}
|
|
1243
1279
|
}
|
|
1244
1280
|
|
|
@@ -1290,6 +1326,18 @@ class ProjectIntegrations extends HeyApiClient {
|
|
|
1290
1326
|
}
|
|
1291
1327
|
}
|
|
1292
1328
|
|
|
1329
|
+
class GitHubIntegrations extends HeyApiClient {
|
|
1330
|
+
beginGitHubAppInstall(options) {
|
|
1331
|
+
return (options?.client ?? this.client).get({ url: "/api/integrations/github/install", ...options });
|
|
1332
|
+
}
|
|
1333
|
+
completeGitHubAppInstall(options) {
|
|
1334
|
+
return (options?.client ?? this.client).get({ url: "/api/integrations/github/callback", ...options });
|
|
1335
|
+
}
|
|
1336
|
+
handleGitHubWebhook(options) {
|
|
1337
|
+
return (options?.client ?? this.client).post({ url: "/api/integrations/github/webhook", ...options });
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1293
1341
|
class ProjectInvites extends HeyApiClient {
|
|
1294
1342
|
getProjectInviteByToken(options) {
|
|
1295
1343
|
return (options.client ?? this.client).get({ url: "/api/project-invites/{token}", ...options });
|
|
@@ -1315,6 +1363,12 @@ class ProjectInvites extends HeyApiClient {
|
|
|
1315
1363
|
}
|
|
1316
1364
|
}
|
|
1317
1365
|
|
|
1366
|
+
class Billing extends HeyApiClient {
|
|
1367
|
+
getOrgUsage(options) {
|
|
1368
|
+
return (options.client ?? this.client).get({ url: "/api/orgs/{orgId}/usage", ...options });
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1318
1372
|
class BoboddyClient extends HeyApiClient {
|
|
1319
1373
|
static __registry = new HeyApiRegistry;
|
|
1320
1374
|
constructor(args) {
|
|
@@ -1353,9 +1407,13 @@ class BoboddyClient extends HeyApiClient {
|
|
|
1353
1407
|
get projectContext() {
|
|
1354
1408
|
return this._projectContext ??= new ProjectContext({ client: this.client });
|
|
1355
1409
|
}
|
|
1356
|
-
|
|
1357
|
-
get
|
|
1358
|
-
return this.
|
|
1410
|
+
_userNotifications;
|
|
1411
|
+
get userNotifications() {
|
|
1412
|
+
return this._userNotifications ??= new UserNotifications({ client: this.client });
|
|
1413
|
+
}
|
|
1414
|
+
_notificationRules;
|
|
1415
|
+
get notificationRules() {
|
|
1416
|
+
return this._notificationRules ??= new NotificationRules({ client: this.client });
|
|
1359
1417
|
}
|
|
1360
1418
|
_stepDefinitionTemplates;
|
|
1361
1419
|
get stepDefinitionTemplates() {
|
|
@@ -1365,10 +1423,18 @@ class BoboddyClient extends HeyApiClient {
|
|
|
1365
1423
|
get projectIntegrations() {
|
|
1366
1424
|
return this._projectIntegrations ??= new ProjectIntegrations({ client: this.client });
|
|
1367
1425
|
}
|
|
1426
|
+
_gitHubIntegrations;
|
|
1427
|
+
get gitHubIntegrations() {
|
|
1428
|
+
return this._gitHubIntegrations ??= new GitHubIntegrations({ client: this.client });
|
|
1429
|
+
}
|
|
1368
1430
|
_projectInvites;
|
|
1369
1431
|
get projectInvites() {
|
|
1370
1432
|
return this._projectInvites ??= new ProjectInvites({ client: this.client });
|
|
1371
1433
|
}
|
|
1434
|
+
_billing;
|
|
1435
|
+
get billing() {
|
|
1436
|
+
return this._billing ??= new Billing({ client: this.client });
|
|
1437
|
+
}
|
|
1372
1438
|
}
|
|
1373
1439
|
// src/step-execution-plane-client.ts
|
|
1374
1440
|
function createStepExecutionPlaneClient(baseUrl) {
|
|
@@ -1431,6 +1497,16 @@ var buildStepExecutionPlaneClient = (stepExecutions) => {
|
|
|
1431
1497
|
});
|
|
1432
1498
|
if (result.error)
|
|
1433
1499
|
throw new Error(JSON.stringify(result.error));
|
|
1500
|
+
},
|
|
1501
|
+
appendStepExecutionLogs: async (stepExecutionId, body, options) => {
|
|
1502
|
+
const result = await stepExecutions.appendStepExecutionLogs({
|
|
1503
|
+
path: { stepExecutionId },
|
|
1504
|
+
body,
|
|
1505
|
+
headers: options?.headers
|
|
1506
|
+
});
|
|
1507
|
+
if (result.error)
|
|
1508
|
+
throw new Error(JSON.stringify(result.error));
|
|
1509
|
+
return result.data;
|
|
1434
1510
|
}
|
|
1435
1511
|
};
|
|
1436
1512
|
};
|
|
@@ -12662,7 +12738,7 @@ function finalize(ctx, schema) {
|
|
|
12662
12738
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
12663
12739
|
} else if (ctx.target === "draft-04") {
|
|
12664
12740
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
12665
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
12741
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
12666
12742
|
if (ctx.external?.uri) {
|
|
12667
12743
|
const id = ctx.external.registry.get(schema)?.id;
|
|
12668
12744
|
if (!id)
|
|
@@ -12906,7 +12982,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
|
|
|
12906
12982
|
if (val === undefined) {
|
|
12907
12983
|
if (ctx.unrepresentable === "throw") {
|
|
12908
12984
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
12909
|
-
}
|
|
12985
|
+
}
|
|
12910
12986
|
} else if (typeof val === "bigint") {
|
|
12911
12987
|
if (ctx.unrepresentable === "throw") {
|
|
12912
12988
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -13411,29 +13487,29 @@ function renderPromptTemplate(template, contextJson) {
|
|
|
13411
13487
|
}
|
|
13412
13488
|
|
|
13413
13489
|
// src/definitions/steps/define-step.ts
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13490
|
+
function resolveZodSchemaAtPath(schema, path) {
|
|
13491
|
+
if (!schema)
|
|
13492
|
+
return;
|
|
13493
|
+
const segments = path.split(".");
|
|
13494
|
+
let current = schema;
|
|
13495
|
+
for (const segment of segments) {
|
|
13496
|
+
if (!current)
|
|
13497
|
+
return;
|
|
13498
|
+
current = unwrapZodWrappers(current);
|
|
13499
|
+
const def = current.def;
|
|
13500
|
+
if (!def || def.type !== "object" || !def.shape)
|
|
13501
|
+
return;
|
|
13502
|
+
current = def.shape[segment];
|
|
13421
13503
|
}
|
|
13422
|
-
return
|
|
13504
|
+
return current;
|
|
13423
13505
|
}
|
|
13424
|
-
function
|
|
13506
|
+
function zodTypeToSignalType(schema) {
|
|
13425
13507
|
if (!schema)
|
|
13426
|
-
return
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
const next = current._def.shape?.[part];
|
|
13432
|
-
if (!next)
|
|
13433
|
-
return "string";
|
|
13434
|
-
current = unwrapZodType(next);
|
|
13435
|
-
}
|
|
13436
|
-
switch (current._def.type) {
|
|
13508
|
+
return;
|
|
13509
|
+
const unwrapped = unwrapZodWrappers(schema);
|
|
13510
|
+
const def = unwrapped.def;
|
|
13511
|
+
const typeName = def?.type;
|
|
13512
|
+
switch (typeName) {
|
|
13437
13513
|
case "string":
|
|
13438
13514
|
return "string";
|
|
13439
13515
|
case "number":
|
|
@@ -13443,12 +13519,21 @@ function deriveSignalType(schema, path) {
|
|
|
13443
13519
|
case "array":
|
|
13444
13520
|
return "array";
|
|
13445
13521
|
case "object":
|
|
13446
|
-
case "record":
|
|
13447
13522
|
return "object";
|
|
13448
13523
|
default:
|
|
13449
|
-
return
|
|
13524
|
+
return;
|
|
13450
13525
|
}
|
|
13451
13526
|
}
|
|
13527
|
+
function unwrapZodWrappers(schema) {
|
|
13528
|
+
const def = schema.def;
|
|
13529
|
+
if (!def)
|
|
13530
|
+
return schema;
|
|
13531
|
+
if (def.type === "optional" || def.type === "nullable" || def.type === "default" || def.type === "catch") {
|
|
13532
|
+
if (def.innerType)
|
|
13533
|
+
return unwrapZodWrappers(def.innerType);
|
|
13534
|
+
}
|
|
13535
|
+
return schema;
|
|
13536
|
+
}
|
|
13452
13537
|
function defineStep(config2) {
|
|
13453
13538
|
const features = config2.features ?? [];
|
|
13454
13539
|
let effectiveResult = config2.result;
|
|
@@ -13479,7 +13564,7 @@ ${feature._promptAddition}` : feature._promptAddition;
|
|
|
13479
13564
|
...(config2.signals ?? []).map((s) => ({
|
|
13480
13565
|
key: s.key ?? s.sourcePath,
|
|
13481
13566
|
sourcePath: s.sourcePath,
|
|
13482
|
-
type: s.type ??
|
|
13567
|
+
type: s.type ?? zodTypeToSignalType(resolveZodSchemaAtPath(effectiveResult, s.sourcePath)) ?? "string",
|
|
13483
13568
|
required: s.required ?? true,
|
|
13484
13569
|
availableWhenResultStatusIn: s.availableWhenResultStatusIn ?? null
|
|
13485
13570
|
})),
|
|
@@ -15881,61 +15966,66 @@ function date4(params) {
|
|
|
15881
15966
|
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
15882
15967
|
config(en_default());
|
|
15883
15968
|
// src/definitions/steps/step-features.ts
|
|
15884
|
-
var
|
|
15885
|
-
var
|
|
15886
|
-
var
|
|
15887
|
-
|
|
15888
|
-
|
|
15889
|
-
|
|
15890
|
-
"
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
|
|
15969
|
+
var NOTIFICATION_SIGNAL_KEY = "$boboddy_notifications_v1";
|
|
15970
|
+
var NOTIFICATION_RESULT_KEY = "$boboddy_notifications_v1";
|
|
15971
|
+
var notificationItemSchema = exports_external.object({
|
|
15972
|
+
kind: exports_external.enum([
|
|
15973
|
+
"feedback_request",
|
|
15974
|
+
"status_update",
|
|
15975
|
+
"blocked",
|
|
15976
|
+
"result_ready",
|
|
15977
|
+
"warning"
|
|
15978
|
+
]).describe("The kind of user notification."),
|
|
15979
|
+
title: exports_external.string().describe("Short, human-readable notification title."),
|
|
15980
|
+
body: exports_external.string().describe("The notification body / details."),
|
|
15981
|
+
priority: exports_external.enum(["low", "normal", "high", "urgent"]).describe("How important this notification is for the user."),
|
|
15982
|
+
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."),
|
|
15983
|
+
payload: exports_external.record(exports_external.string(), exports_external.unknown()).optional().describe('Kind-specific structured data. For "feedback_request": { category, urgency, suggestedKey? }.')
|
|
15984
|
+
}).describe("A single user notification emitted by the agent.");
|
|
15985
|
+
var notificationsFeature = {
|
|
15900
15986
|
_resultExtension: exports_external.object({
|
|
15901
|
-
[
|
|
15987
|
+
[NOTIFICATION_RESULT_KEY]: exports_external.array(notificationItemSchema).optional()
|
|
15902
15988
|
}),
|
|
15903
15989
|
_promptAddition: [
|
|
15904
|
-
"##
|
|
15990
|
+
"## User Notifications",
|
|
15905
15991
|
"",
|
|
15906
|
-
`If you
|
|
15992
|
+
`If you need to communicate something to a human, populate the \`${NOTIFICATION_RESULT_KEY}\` array.`,
|
|
15907
15993
|
"Each item must include:",
|
|
15908
|
-
"- **
|
|
15909
|
-
|
|
15910
|
-
"- **
|
|
15911
|
-
|
|
15912
|
-
'
|
|
15913
|
-
|
|
15914
|
-
'
|
|
15915
|
-
"- **suggestedKey** *(optional)*: A suggested answer key for reference."
|
|
15994
|
+
"- **kind**: One of `feedback_request`, `status_update`, `blocked`, `result_ready`, `warning`.",
|
|
15995
|
+
"- **title**: A short, human-readable title.",
|
|
15996
|
+
"- **body**: The details of the notification.",
|
|
15997
|
+
"- **priority**: One of `low`, `normal`, `high`, `urgent`.",
|
|
15998
|
+
'- **suggestedChannels** *(optional)*: Channels you think are worth using (e.g. `["in_app", "work_item_platform_comment"]`).',
|
|
15999
|
+
" You only *suggest* channels \u2014 the platform policy decides the final delivery channels.",
|
|
16000
|
+
'- **payload** *(optional)*: Kind-specific data. For `feedback_request`, include `{ "category": string, "urgency": "blocking"|"clarification"|"assumption"|"informational", "suggestedKey"?: string }`.'
|
|
15916
16001
|
].join(`
|
|
15917
16002
|
`),
|
|
15918
16003
|
_signals: [
|
|
15919
16004
|
{
|
|
15920
|
-
key:
|
|
15921
|
-
sourcePath:
|
|
16005
|
+
key: NOTIFICATION_SIGNAL_KEY,
|
|
16006
|
+
sourcePath: NOTIFICATION_RESULT_KEY,
|
|
15922
16007
|
type: "array",
|
|
15923
16008
|
required: false
|
|
15924
16009
|
}
|
|
15925
16010
|
]
|
|
15926
16011
|
};
|
|
15927
16012
|
var Features = {
|
|
15928
|
-
|
|
16013
|
+
notifications: Object.assign(() => notificationsFeature, {
|
|
15929
16014
|
signal: {
|
|
15930
|
-
key:
|
|
16015
|
+
key: NOTIFICATION_SIGNAL_KEY,
|
|
15931
16016
|
find(signals) {
|
|
15932
|
-
const match = signals.find((s) => s.key ===
|
|
16017
|
+
const match = signals.find((s) => s.key === NOTIFICATION_SIGNAL_KEY);
|
|
15933
16018
|
if (!match)
|
|
15934
16019
|
return;
|
|
15935
|
-
const parsed = exports_external.array(
|
|
16020
|
+
const parsed = exports_external.array(notificationItemSchema).safeParse(match.valueJson);
|
|
15936
16021
|
return parsed.success ? parsed.data : undefined;
|
|
15937
16022
|
}
|
|
15938
16023
|
}
|
|
16024
|
+
}),
|
|
16025
|
+
feedbackRequests: Object.assign(() => notificationsFeature, {
|
|
16026
|
+
signal: {
|
|
16027
|
+
key: NOTIFICATION_SIGNAL_KEY
|
|
16028
|
+
}
|
|
15939
16029
|
})
|
|
15940
16030
|
};
|
|
15941
16031
|
// src/definitions/advancement-policies/define-advancement-policy.ts
|
|
@@ -16291,6 +16381,82 @@ function materializeAccessor(accessor) {
|
|
|
16291
16381
|
};
|
|
16292
16382
|
}
|
|
16293
16383
|
|
|
16384
|
+
// src/definitions/pipelines/builder-helpers.ts
|
|
16385
|
+
var WORK_ITEM_ACCESSOR = Object.freeze({
|
|
16386
|
+
title: Object.freeze({ source: "work_item", field: "title" }),
|
|
16387
|
+
description: Object.freeze({
|
|
16388
|
+
source: "work_item",
|
|
16389
|
+
field: "description"
|
|
16390
|
+
}),
|
|
16391
|
+
field: (fieldName) => Object.freeze({ source: "work_item", field: `fields.${fieldName}` })
|
|
16392
|
+
});
|
|
16393
|
+
var WORK_ITEM_FIELD_BINDINGS = {
|
|
16394
|
+
workItemTitle: { source: "work_item", field: "title" },
|
|
16395
|
+
workItemDescription: { source: "work_item", field: "description" }
|
|
16396
|
+
};
|
|
16397
|
+
function makeStepInputCtx(inputSchema) {
|
|
16398
|
+
const baseAccessor = createInputAccessor(inputSchema);
|
|
16399
|
+
const input = new Proxy(baseAccessor, {
|
|
16400
|
+
get(target, prop) {
|
|
16401
|
+
if (typeof prop === "string" && prop in WORK_ITEM_FIELD_BINDINGS) {
|
|
16402
|
+
return WORK_ITEM_FIELD_BINDINGS[prop];
|
|
16403
|
+
}
|
|
16404
|
+
return target[prop];
|
|
16405
|
+
}
|
|
16406
|
+
});
|
|
16407
|
+
return {
|
|
16408
|
+
input,
|
|
16409
|
+
signal(step, key) {
|
|
16410
|
+
return { source: "step_signal", step, signalKey: key };
|
|
16411
|
+
},
|
|
16412
|
+
output(step) {
|
|
16413
|
+
return { source: "step_output", step };
|
|
16414
|
+
},
|
|
16415
|
+
literal: literal2
|
|
16416
|
+
};
|
|
16417
|
+
}
|
|
16418
|
+
function literal2(value) {
|
|
16419
|
+
return { source: "literal", value };
|
|
16420
|
+
}
|
|
16421
|
+
function normalizeInputMapping(mapping) {
|
|
16422
|
+
if (!mapping)
|
|
16423
|
+
return;
|
|
16424
|
+
const out = {};
|
|
16425
|
+
for (const [key, value] of Object.entries(mapping)) {
|
|
16426
|
+
if (value === undefined)
|
|
16427
|
+
continue;
|
|
16428
|
+
out[key] = isInputAccessor(value) ? materializeAccessor(value) : value;
|
|
16429
|
+
}
|
|
16430
|
+
return out;
|
|
16431
|
+
}
|
|
16432
|
+
function resolveAdditionalStepInputBindings(label, definition) {
|
|
16433
|
+
if (!definition) {
|
|
16434
|
+
return {};
|
|
16435
|
+
}
|
|
16436
|
+
const raw = definition.bindings({
|
|
16437
|
+
workItemField: (fieldName) => ({
|
|
16438
|
+
source: "work_item",
|
|
16439
|
+
field: `fields.${fieldName}`
|
|
16440
|
+
}),
|
|
16441
|
+
literal: literal2
|
|
16442
|
+
});
|
|
16443
|
+
if (definition.schema instanceof exports_external.ZodObject) {
|
|
16444
|
+
const validKeys = new Set(Object.keys(definition.schema.shape));
|
|
16445
|
+
const unknown2 = Object.keys(raw).filter((key) => !validKeys.has(key));
|
|
16446
|
+
if (unknown2.length > 0) {
|
|
16447
|
+
throw new Error(`${label}.bindings returned key${unknown2.length > 1 ? "s" : ""} not in schema: ${unknown2.map((key) => `"${key}"`).join(", ")}`);
|
|
16448
|
+
}
|
|
16449
|
+
}
|
|
16450
|
+
return normalizeInputMapping(raw) ?? {};
|
|
16451
|
+
}
|
|
16452
|
+
function mergeStepBindings(pipelineBindings, explicitBindings) {
|
|
16453
|
+
const merged = {
|
|
16454
|
+
...pipelineBindings,
|
|
16455
|
+
...explicitBindings ?? {}
|
|
16456
|
+
};
|
|
16457
|
+
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
16458
|
+
}
|
|
16459
|
+
|
|
16294
16460
|
// src/definitions/pipelines/builder.ts
|
|
16295
16461
|
class PipelineStepAdvancementBuilder {
|
|
16296
16462
|
inputSchema;
|
|
@@ -16307,6 +16473,8 @@ class PipelineStepAdvancementBuilder {
|
|
|
16307
16473
|
}
|
|
16308
16474
|
advance(callback) {
|
|
16309
16475
|
const last = this.steps.at(-1);
|
|
16476
|
+
if (!last)
|
|
16477
|
+
throw new Error("Internal error: no steps available");
|
|
16310
16478
|
const ctx = makeAdvanceCtx();
|
|
16311
16479
|
const result = callback(ctx);
|
|
16312
16480
|
const policy = {
|
|
@@ -16403,80 +16571,6 @@ class PipelineBuilder {
|
|
|
16403
16571
|
return new PipelineStepAdvancementBuilder(this.inputSchema, this.meta, this.steps, this.pipelineInputBindings, this.pipelineStepInputBindings);
|
|
16404
16572
|
}
|
|
16405
16573
|
}
|
|
16406
|
-
var WORK_ITEM_ACCESSOR = Object.freeze({
|
|
16407
|
-
title: Object.freeze({ source: "work_item", field: "title" }),
|
|
16408
|
-
description: Object.freeze({
|
|
16409
|
-
source: "work_item",
|
|
16410
|
-
field: "description"
|
|
16411
|
-
}),
|
|
16412
|
-
field: (fieldName) => Object.freeze({ source: "work_item", field: `fields.${fieldName}` })
|
|
16413
|
-
});
|
|
16414
|
-
var WORK_ITEM_FIELD_BINDINGS = {
|
|
16415
|
-
workItemTitle: { source: "work_item", field: "title" },
|
|
16416
|
-
workItemDescription: { source: "work_item", field: "description" }
|
|
16417
|
-
};
|
|
16418
|
-
function makeStepInputCtx(inputSchema) {
|
|
16419
|
-
const baseAccessor = createInputAccessor(inputSchema);
|
|
16420
|
-
const input = new Proxy(baseAccessor, {
|
|
16421
|
-
get(target, prop) {
|
|
16422
|
-
if (typeof prop === "string" && prop in WORK_ITEM_FIELD_BINDINGS) {
|
|
16423
|
-
return WORK_ITEM_FIELD_BINDINGS[prop];
|
|
16424
|
-
}
|
|
16425
|
-
return target[prop];
|
|
16426
|
-
}
|
|
16427
|
-
});
|
|
16428
|
-
return {
|
|
16429
|
-
input,
|
|
16430
|
-
signal(step, key) {
|
|
16431
|
-
return { source: "step_signal", step, signalKey: key };
|
|
16432
|
-
},
|
|
16433
|
-
output(step) {
|
|
16434
|
-
return { source: "step_output", step };
|
|
16435
|
-
},
|
|
16436
|
-
literal: literal2
|
|
16437
|
-
};
|
|
16438
|
-
}
|
|
16439
|
-
function literal2(value) {
|
|
16440
|
-
return { source: "literal", value };
|
|
16441
|
-
}
|
|
16442
|
-
function normalizeInputMapping(mapping) {
|
|
16443
|
-
if (!mapping)
|
|
16444
|
-
return;
|
|
16445
|
-
const out = {};
|
|
16446
|
-
for (const [key, value] of Object.entries(mapping)) {
|
|
16447
|
-
if (value === undefined)
|
|
16448
|
-
continue;
|
|
16449
|
-
out[key] = isInputAccessor(value) ? materializeAccessor(value) : value;
|
|
16450
|
-
}
|
|
16451
|
-
return out;
|
|
16452
|
-
}
|
|
16453
|
-
function resolveAdditionalStepInputBindings(label, definition) {
|
|
16454
|
-
if (!definition) {
|
|
16455
|
-
return {};
|
|
16456
|
-
}
|
|
16457
|
-
const raw = definition.bindings({
|
|
16458
|
-
workItemField: (fieldName) => ({
|
|
16459
|
-
source: "work_item",
|
|
16460
|
-
field: `fields.${fieldName}`
|
|
16461
|
-
}),
|
|
16462
|
-
literal: literal2
|
|
16463
|
-
});
|
|
16464
|
-
if (definition.schema instanceof exports_external.ZodObject) {
|
|
16465
|
-
const validKeys = new Set(Object.keys(definition.schema.shape));
|
|
16466
|
-
const unknown2 = Object.keys(raw).filter((key) => !validKeys.has(key));
|
|
16467
|
-
if (unknown2.length > 0) {
|
|
16468
|
-
throw new Error(`${label}.bindings returned key${unknown2.length > 1 ? "s" : ""} not in schema: ${unknown2.map((key) => `"${key}"`).join(", ")}`);
|
|
16469
|
-
}
|
|
16470
|
-
}
|
|
16471
|
-
return normalizeInputMapping(raw) ?? {};
|
|
16472
|
-
}
|
|
16473
|
-
function mergeStepBindings(pipelineBindings, explicitBindings) {
|
|
16474
|
-
const merged = {
|
|
16475
|
-
...pipelineBindings,
|
|
16476
|
-
...explicitBindings ?? {}
|
|
16477
|
-
};
|
|
16478
|
-
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
16479
|
-
}
|
|
16480
16574
|
function pipeline(meta3) {
|
|
16481
16575
|
return new PipelineBuilder(meta3);
|
|
16482
16576
|
}
|
|
@@ -16494,7 +16588,7 @@ var buildPipelineDefinitionsClient = (pipelineDefinitions) => {
|
|
|
16494
16588
|
});
|
|
16495
16589
|
if (result.error)
|
|
16496
16590
|
throw new Error(JSON.stringify(result.error));
|
|
16497
|
-
return result.data
|
|
16591
|
+
return result.data;
|
|
16498
16592
|
},
|
|
16499
16593
|
upsertFromSpec: async (projectId, spec, stepDefs, options) => {
|
|
16500
16594
|
const stepDefMap = new Map;
|
|
@@ -16574,7 +16668,7 @@ function makeFieldRef(fact, path) {
|
|
|
16574
16668
|
};
|
|
16575
16669
|
}
|
|
16576
16670
|
function makeAssign(pipeline2) {
|
|
16577
|
-
if (typeof pipeline2 !== "object" ||
|
|
16671
|
+
if (typeof pipeline2 !== "object" || typeof pipeline2["key"] !== "string" || !Array.isArray(pipeline2["steps"])) {
|
|
16578
16672
|
throw new Error("assign() requires a pipeline spec produced by pipeline().build(). " + "Pass the default-exported value from a pipeline definition file.");
|
|
16579
16673
|
}
|
|
16580
16674
|
return { _tag: "assign", pipeline: pipeline2 };
|
|
@@ -16623,13 +16717,10 @@ function serializeConditionNode(condition) {
|
|
|
16623
16717
|
value: condition.value
|
|
16624
16718
|
};
|
|
16625
16719
|
}
|
|
16626
|
-
if (condition.
|
|
16627
|
-
|
|
16628
|
-
return { all: condition.conditions.map(serializeConditionNode) };
|
|
16629
|
-
}
|
|
16630
|
-
return { any: condition.conditions.map(serializeConditionNode) };
|
|
16720
|
+
if (condition.mode === "all") {
|
|
16721
|
+
return { all: condition.conditions.map(serializeConditionNode) };
|
|
16631
16722
|
}
|
|
16632
|
-
|
|
16723
|
+
return { any: condition.conditions.map(serializeConditionNode) };
|
|
16633
16724
|
}
|
|
16634
16725
|
function serializeOutcome(outcome) {
|
|
16635
16726
|
if (outcome._tag === "skip")
|
|
@@ -17023,6 +17114,7 @@ export {
|
|
|
17023
17114
|
createBoboddyClient,
|
|
17024
17115
|
buildPipelineSpec,
|
|
17025
17116
|
WorkItems,
|
|
17117
|
+
UserNotifications,
|
|
17026
17118
|
StepExecutions,
|
|
17027
17119
|
StepDefinitions,
|
|
17028
17120
|
StepDefinitionTemplates,
|
|
@@ -17036,11 +17128,13 @@ export {
|
|
|
17036
17128
|
PipelineExecutions,
|
|
17037
17129
|
PipelineDefinitions,
|
|
17038
17130
|
PipelineBuilder,
|
|
17039
|
-
|
|
17131
|
+
NotificationRules,
|
|
17132
|
+
GitHubIntegrations,
|
|
17040
17133
|
Features,
|
|
17041
17134
|
DEFAULT_PIPELINE_ASSIGNMENT_FILENAME,
|
|
17042
17135
|
Computed,
|
|
17043
17136
|
BoboddyClient,
|
|
17137
|
+
Billing,
|
|
17044
17138
|
BOBODDY_CONFIG_RELATIVE_PATH,
|
|
17045
17139
|
Api
|
|
17046
17140
|
};
|
package/dist/opencode-mcp.js
CHANGED
|
@@ -11478,7 +11478,7 @@ function finalize(ctx, schema) {
|
|
|
11478
11478
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
11479
11479
|
} else if (ctx.target === "draft-04") {
|
|
11480
11480
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
11481
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
11481
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
11482
11482
|
if (ctx.external?.uri) {
|
|
11483
11483
|
const id = ctx.external.registry.get(schema)?.id;
|
|
11484
11484
|
if (!id)
|
|
@@ -11722,7 +11722,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
|
|
|
11722
11722
|
if (val === undefined) {
|
|
11723
11723
|
if (ctx.unrepresentable === "throw") {
|
|
11724
11724
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
11725
|
-
}
|
|
11725
|
+
}
|
|
11726
11726
|
} else if (typeof val === "bigint") {
|
|
11727
11727
|
if (ctx.unrepresentable === "throw") {
|
|
11728
11728
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
package/dist/opencode-plugin.js
CHANGED
|
@@ -11478,7 +11478,7 @@ function finalize(ctx, schema) {
|
|
|
11478
11478
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
11479
11479
|
} else if (ctx.target === "draft-04") {
|
|
11480
11480
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
11481
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
11481
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
11482
11482
|
if (ctx.external?.uri) {
|
|
11483
11483
|
const id = ctx.external.registry.get(schema)?.id;
|
|
11484
11484
|
if (!id)
|
|
@@ -11722,7 +11722,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
|
|
|
11722
11722
|
if (val === undefined) {
|
|
11723
11723
|
if (ctx.unrepresentable === "throw") {
|
|
11724
11724
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
11725
|
-
}
|
|
11725
|
+
}
|
|
11726
11726
|
} else if (typeof val === "bigint") {
|
|
11727
11727
|
if (ctx.unrepresentable === "throw") {
|
|
11728
11728
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|