@boboddy/sdk 0.1.38-alpha → 0.1.40-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.
@@ -106,6 +106,58 @@ export type GetApiProjectsResponses = {
106
106
  createdAt: string;
107
107
  updatedAt: string;
108
108
  }>;
109
+ defaultPipelineAssignment: {
110
+ linearPipelineDefinitionId: string;
111
+ rulesJson: {
112
+ rules: Array<{
113
+ conditions: {
114
+ [key: string]: unknown;
115
+ };
116
+ event: {
117
+ type: string;
118
+ params?: {
119
+ [key: string]: unknown;
120
+ };
121
+ };
122
+ name?: string;
123
+ priority?: number;
124
+ [key: string]: unknown | {
125
+ [key: string]: unknown;
126
+ } | {
127
+ type: string;
128
+ params?: {
129
+ [key: string]: unknown;
130
+ };
131
+ } | string | number | undefined;
132
+ }>;
133
+ [key: string]: unknown | Array<{
134
+ conditions: {
135
+ [key: string]: unknown;
136
+ };
137
+ event: {
138
+ type: string;
139
+ params?: {
140
+ [key: string]: unknown;
141
+ };
142
+ };
143
+ name?: string;
144
+ priority?: number;
145
+ [key: string]: unknown | {
146
+ [key: string]: unknown;
147
+ } | {
148
+ type: string;
149
+ params?: {
150
+ [key: string]: unknown;
151
+ };
152
+ } | string | number | undefined;
153
+ }>;
154
+ };
155
+ defaultEventType: 'assign' | 'skip';
156
+ defaultEventParamsJson: {
157
+ [key: string]: unknown;
158
+ } | unknown;
159
+ allowedEventTypes: Array<'assign' | 'skip'>;
160
+ } | unknown;
109
161
  createdAt: string;
110
162
  updatedAt: string;
111
163
  }>;
@@ -220,6 +272,58 @@ export type PostApiProjectsResponses = {
220
272
  createdAt: string;
221
273
  updatedAt: string;
222
274
  }>;
275
+ defaultPipelineAssignment: {
276
+ linearPipelineDefinitionId: string;
277
+ rulesJson: {
278
+ rules: Array<{
279
+ conditions: {
280
+ [key: string]: unknown;
281
+ };
282
+ event: {
283
+ type: string;
284
+ params?: {
285
+ [key: string]: unknown;
286
+ };
287
+ };
288
+ name?: string;
289
+ priority?: number;
290
+ [key: string]: unknown | {
291
+ [key: string]: unknown;
292
+ } | {
293
+ type: string;
294
+ params?: {
295
+ [key: string]: unknown;
296
+ };
297
+ } | string | number | undefined;
298
+ }>;
299
+ [key: string]: unknown | Array<{
300
+ conditions: {
301
+ [key: string]: unknown;
302
+ };
303
+ event: {
304
+ type: string;
305
+ params?: {
306
+ [key: string]: unknown;
307
+ };
308
+ };
309
+ name?: string;
310
+ priority?: number;
311
+ [key: string]: unknown | {
312
+ [key: string]: unknown;
313
+ } | {
314
+ type: string;
315
+ params?: {
316
+ [key: string]: unknown;
317
+ };
318
+ } | string | number | undefined;
319
+ }>;
320
+ };
321
+ defaultEventType: 'assign' | 'skip';
322
+ defaultEventParamsJson: {
323
+ [key: string]: unknown;
324
+ } | unknown;
325
+ allowedEventTypes: Array<'assign' | 'skip'>;
326
+ } | unknown;
223
327
  createdAt: string;
224
328
  updatedAt: string;
225
329
  };
@@ -444,11 +548,280 @@ export type GetApiProjectsByProjectIdResponses = {
444
548
  createdAt: string;
445
549
  updatedAt: string;
446
550
  }>;
551
+ defaultPipelineAssignment: {
552
+ linearPipelineDefinitionId: string;
553
+ rulesJson: {
554
+ rules: Array<{
555
+ conditions: {
556
+ [key: string]: unknown;
557
+ };
558
+ event: {
559
+ type: string;
560
+ params?: {
561
+ [key: string]: unknown;
562
+ };
563
+ };
564
+ name?: string;
565
+ priority?: number;
566
+ [key: string]: unknown | {
567
+ [key: string]: unknown;
568
+ } | {
569
+ type: string;
570
+ params?: {
571
+ [key: string]: unknown;
572
+ };
573
+ } | string | number | undefined;
574
+ }>;
575
+ [key: string]: unknown | Array<{
576
+ conditions: {
577
+ [key: string]: unknown;
578
+ };
579
+ event: {
580
+ type: string;
581
+ params?: {
582
+ [key: string]: unknown;
583
+ };
584
+ };
585
+ name?: string;
586
+ priority?: number;
587
+ [key: string]: unknown | {
588
+ [key: string]: unknown;
589
+ } | {
590
+ type: string;
591
+ params?: {
592
+ [key: string]: unknown;
593
+ };
594
+ } | string | number | undefined;
595
+ }>;
596
+ };
597
+ defaultEventType: 'assign' | 'skip';
598
+ defaultEventParamsJson: {
599
+ [key: string]: unknown;
600
+ } | unknown;
601
+ allowedEventTypes: Array<'assign' | 'skip'>;
602
+ } | unknown;
447
603
  createdAt: string;
448
604
  updatedAt: string;
449
605
  };
450
606
  };
451
607
  export type GetApiProjectsByProjectIdResponse = GetApiProjectsByProjectIdResponses[keyof GetApiProjectsByProjectIdResponses];
608
+ export type PutApiProjectsByProjectIdDefaultPipelineAssignmentData = {
609
+ body: {
610
+ defaultPipelineAssignment: {
611
+ linearPipelineDefinitionId: string;
612
+ rulesJson: {
613
+ rules: Array<{
614
+ conditions: {
615
+ [key: string]: unknown;
616
+ };
617
+ event: {
618
+ type: string;
619
+ params?: {
620
+ [key: string]: unknown;
621
+ };
622
+ };
623
+ name?: string;
624
+ priority?: number;
625
+ [key: string]: unknown | {
626
+ [key: string]: unknown;
627
+ } | {
628
+ type: string;
629
+ params?: {
630
+ [key: string]: unknown;
631
+ };
632
+ } | string | number | undefined;
633
+ }>;
634
+ [key: string]: unknown | Array<{
635
+ conditions: {
636
+ [key: string]: unknown;
637
+ };
638
+ event: {
639
+ type: string;
640
+ params?: {
641
+ [key: string]: unknown;
642
+ };
643
+ };
644
+ name?: string;
645
+ priority?: number;
646
+ [key: string]: unknown | {
647
+ [key: string]: unknown;
648
+ } | {
649
+ type: string;
650
+ params?: {
651
+ [key: string]: unknown;
652
+ };
653
+ } | string | number | undefined;
654
+ }>;
655
+ };
656
+ defaultEventType: 'assign' | 'skip';
657
+ defaultEventParamsJson: {
658
+ [key: string]: unknown;
659
+ } | unknown;
660
+ allowedEventTypes: Array<'assign' | 'skip'>;
661
+ } | unknown;
662
+ };
663
+ path: {
664
+ projectId: string;
665
+ };
666
+ query?: never;
667
+ url: '/api/projects/{projectId}/default-pipeline-assignment';
668
+ };
669
+ export type PutApiProjectsByProjectIdDefaultPipelineAssignmentErrors = {
670
+ /**
671
+ * Response for status 401
672
+ */
673
+ 401: {
674
+ type: string;
675
+ title: string;
676
+ status: number;
677
+ detail?: string;
678
+ instance?: string;
679
+ code?: string;
680
+ errors?: Array<{
681
+ path: string;
682
+ message: string;
683
+ summary?: string;
684
+ }>;
685
+ };
686
+ /**
687
+ * Response for status 403
688
+ */
689
+ 403: {
690
+ type: string;
691
+ title: string;
692
+ status: number;
693
+ detail?: string;
694
+ instance?: string;
695
+ code?: string;
696
+ errors?: Array<{
697
+ path: string;
698
+ message: string;
699
+ summary?: string;
700
+ }>;
701
+ };
702
+ /**
703
+ * Response for status 404
704
+ */
705
+ 404: {
706
+ type: string;
707
+ title: string;
708
+ status: number;
709
+ detail?: string;
710
+ instance?: string;
711
+ code?: string;
712
+ errors?: Array<{
713
+ path: string;
714
+ message: string;
715
+ summary?: string;
716
+ }>;
717
+ };
718
+ /**
719
+ * Response for status 422
720
+ */
721
+ 422: {
722
+ type: string;
723
+ title: string;
724
+ status: number;
725
+ detail?: string;
726
+ instance?: string;
727
+ code?: string;
728
+ errors?: Array<{
729
+ path: string;
730
+ message: string;
731
+ summary?: string;
732
+ }>;
733
+ };
734
+ /**
735
+ * Response for status 500
736
+ */
737
+ 500: {
738
+ type: string;
739
+ title: string;
740
+ status: number;
741
+ detail?: string;
742
+ instance?: string;
743
+ code?: string;
744
+ errors?: Array<{
745
+ path: string;
746
+ message: string;
747
+ summary?: string;
748
+ }>;
749
+ };
750
+ };
751
+ export type PutApiProjectsByProjectIdDefaultPipelineAssignmentError = PutApiProjectsByProjectIdDefaultPipelineAssignmentErrors[keyof PutApiProjectsByProjectIdDefaultPipelineAssignmentErrors];
752
+ export type PutApiProjectsByProjectIdDefaultPipelineAssignmentResponses = {
753
+ /**
754
+ * Response for status 200
755
+ */
756
+ 200: {
757
+ id: string;
758
+ name: string;
759
+ description: string | unknown;
760
+ gitUrl: string;
761
+ createdByUserId: string;
762
+ memberships: Array<{
763
+ userId: string;
764
+ permissions: Array<string>;
765
+ createdAt: string;
766
+ updatedAt: string;
767
+ }>;
768
+ defaultPipelineAssignment: {
769
+ linearPipelineDefinitionId: string;
770
+ rulesJson: {
771
+ rules: Array<{
772
+ conditions: {
773
+ [key: string]: unknown;
774
+ };
775
+ event: {
776
+ type: string;
777
+ params?: {
778
+ [key: string]: unknown;
779
+ };
780
+ };
781
+ name?: string;
782
+ priority?: number;
783
+ [key: string]: unknown | {
784
+ [key: string]: unknown;
785
+ } | {
786
+ type: string;
787
+ params?: {
788
+ [key: string]: unknown;
789
+ };
790
+ } | string | number | undefined;
791
+ }>;
792
+ [key: string]: unknown | Array<{
793
+ conditions: {
794
+ [key: string]: unknown;
795
+ };
796
+ event: {
797
+ type: string;
798
+ params?: {
799
+ [key: string]: unknown;
800
+ };
801
+ };
802
+ name?: string;
803
+ priority?: number;
804
+ [key: string]: unknown | {
805
+ [key: string]: unknown;
806
+ } | {
807
+ type: string;
808
+ params?: {
809
+ [key: string]: unknown;
810
+ };
811
+ } | string | number | undefined;
812
+ }>;
813
+ };
814
+ defaultEventType: 'assign' | 'skip';
815
+ defaultEventParamsJson: {
816
+ [key: string]: unknown;
817
+ } | unknown;
818
+ allowedEventTypes: Array<'assign' | 'skip'>;
819
+ } | unknown;
820
+ createdAt: string;
821
+ updatedAt: string;
822
+ };
823
+ };
824
+ export type PutApiProjectsByProjectIdDefaultPipelineAssignmentResponse = PutApiProjectsByProjectIdDefaultPipelineAssignmentResponses[keyof PutApiProjectsByProjectIdDefaultPipelineAssignmentResponses];
452
825
  export type PutApiProjectsByProjectIdMembersByUserIdPermissionsData = {
453
826
  body?: never;
454
827
  path: {
@@ -557,6 +930,58 @@ export type PutApiProjectsByProjectIdMembersByUserIdPermissionsResponses = {
557
930
  createdAt: string;
558
931
  updatedAt: string;
559
932
  }>;
933
+ defaultPipelineAssignment: {
934
+ linearPipelineDefinitionId: string;
935
+ rulesJson: {
936
+ rules: Array<{
937
+ conditions: {
938
+ [key: string]: unknown;
939
+ };
940
+ event: {
941
+ type: string;
942
+ params?: {
943
+ [key: string]: unknown;
944
+ };
945
+ };
946
+ name?: string;
947
+ priority?: number;
948
+ [key: string]: unknown | {
949
+ [key: string]: unknown;
950
+ } | {
951
+ type: string;
952
+ params?: {
953
+ [key: string]: unknown;
954
+ };
955
+ } | string | number | undefined;
956
+ }>;
957
+ [key: string]: unknown | Array<{
958
+ conditions: {
959
+ [key: string]: unknown;
960
+ };
961
+ event: {
962
+ type: string;
963
+ params?: {
964
+ [key: string]: unknown;
965
+ };
966
+ };
967
+ name?: string;
968
+ priority?: number;
969
+ [key: string]: unknown | {
970
+ [key: string]: unknown;
971
+ } | {
972
+ type: string;
973
+ params?: {
974
+ [key: string]: unknown;
975
+ };
976
+ } | string | number | undefined;
977
+ }>;
978
+ };
979
+ defaultEventType: 'assign' | 'skip';
980
+ defaultEventParamsJson: {
981
+ [key: string]: unknown;
982
+ } | unknown;
983
+ allowedEventTypes: Array<'assign' | 'skip'>;
984
+ } | unknown;
560
985
  createdAt: string;
561
986
  updatedAt: string;
562
987
  };
package/dist/index.js CHANGED
@@ -895,6 +895,16 @@ class Projects extends HeyApiClient {
895
895
  getProject(options) {
896
896
  return (options.client ?? this.client).get({ url: "/api/projects/{projectId}", ...options });
897
897
  }
898
+ updateProjectDefaultPipelineAssignment(options) {
899
+ return (options.client ?? this.client).put({
900
+ url: "/api/projects/{projectId}/default-pipeline-assignment",
901
+ ...options,
902
+ headers: {
903
+ "Content-Type": "application/json",
904
+ ...options.headers
905
+ }
906
+ });
907
+ }
898
908
  updateProjectMemberPermissions(options) {
899
909
  return (options.client ?? this.client).put({ url: "/api/projects/{projectId}/members/{userId}/permissions", ...options });
900
910
  }
@@ -16486,6 +16496,141 @@ var buildPipelineDefinitionsClient = (pipelineDefinitions) => {
16486
16496
  }
16487
16497
  };
16488
16498
  };
16499
+ // src/definitions/pipelines/define-default-pipeline-assignment.ts
16500
+ var DEFAULT_PIPELINE_ASSIGNMENT_FILENAME = "default-pipeline-assignment.ts";
16501
+ function makeLeaf(fact, path, operator, value) {
16502
+ const condition = {
16503
+ _tag: "leaf",
16504
+ fact,
16505
+ ...path ? { path } : {},
16506
+ operator,
16507
+ value
16508
+ };
16509
+ return {
16510
+ _condition: condition,
16511
+ then(outcome) {
16512
+ return { _tag: "assignment_rule", conditions: [condition], mode: "all", outcome };
16513
+ }
16514
+ };
16515
+ }
16516
+ function makeFieldRef(fact, path) {
16517
+ return {
16518
+ eq: (v) => makeLeaf(fact, path, "equal", v),
16519
+ ne: (v) => makeLeaf(fact, path, "notEqual", v),
16520
+ gt: (v) => makeLeaf(fact, path, "greaterThan", v),
16521
+ gte: (v) => makeLeaf(fact, path, "greaterThanInclusive", v),
16522
+ lt: (v) => makeLeaf(fact, path, "lessThan", v),
16523
+ lte: (v) => makeLeaf(fact, path, "lessThanInclusive", v),
16524
+ in: (vs) => makeLeaf(fact, path, "in", vs),
16525
+ notIn: (vs) => makeLeaf(fact, path, "notIn", vs),
16526
+ contains: (v) => makeLeaf(fact, path, "contains", v),
16527
+ doesNotContain: (v) => makeLeaf(fact, path, "doesNotContain", v)
16528
+ };
16529
+ }
16530
+ function makeAssign(pipeline2) {
16531
+ if (typeof pipeline2 !== "object" || pipeline2 === null || typeof pipeline2["key"] !== "string" || !Array.isArray(pipeline2["steps"])) {
16532
+ throw new Error("assign() requires a pipeline spec produced by pipeline().build(). " + "Pass the default-exported value from a pipeline definition file.");
16533
+ }
16534
+ return { _tag: "assign", pipeline: pipeline2 };
16535
+ }
16536
+ function extractCondition2(ref) {
16537
+ return ref._condition;
16538
+ }
16539
+ function makeGroup(mode, refs) {
16540
+ const conditions = refs.map(extractCondition2);
16541
+ const condition = { _tag: "group", mode, conditions };
16542
+ return {
16543
+ _condition: condition,
16544
+ then(outcome) {
16545
+ return { _tag: "assignment_rule", conditions, mode, outcome };
16546
+ }
16547
+ };
16548
+ }
16549
+ function buildCtx() {
16550
+ return {
16551
+ workItem: {
16552
+ field: (name) => makeFieldRef("workItem", `$.fields.${name}`)
16553
+ },
16554
+ context: {
16555
+ isNew: makeFieldRef("context", "$.isNew")
16556
+ },
16557
+ assign: makeAssign,
16558
+ skip: () => ({ _tag: "skip" }),
16559
+ all: (...refs) => makeGroup("all", refs),
16560
+ any: (...refs) => makeGroup("any", refs)
16561
+ };
16562
+ }
16563
+ function defaultPipelineAssignment(callback) {
16564
+ const input = callback(buildCtx());
16565
+ return {
16566
+ _tag: "default_pipeline_assignment",
16567
+ default: input.default,
16568
+ rules: input.rules
16569
+ };
16570
+ }
16571
+ function serializeConditionNode(condition) {
16572
+ if (condition._tag === "leaf") {
16573
+ return {
16574
+ fact: condition.fact,
16575
+ ...condition.path ? { path: condition.path } : {},
16576
+ operator: condition.operator,
16577
+ value: condition.value
16578
+ };
16579
+ }
16580
+ if (condition._tag === "group") {
16581
+ if (condition.mode === "all") {
16582
+ return { all: condition.conditions.map(serializeConditionNode) };
16583
+ }
16584
+ return { any: condition.conditions.map(serializeConditionNode) };
16585
+ }
16586
+ throw new Error(`Unknown condition tag: ${JSON.stringify(condition["_tag"])}`);
16587
+ }
16588
+ function serializeOutcome(outcome) {
16589
+ if (outcome._tag === "skip")
16590
+ return { type: "skip", params: null };
16591
+ return { type: "assign", params: { pipelineKey: outcome.pipeline.key } };
16592
+ }
16593
+ function serializeAssignmentRule(rule) {
16594
+ const { type, params } = serializeOutcome(rule.outcome);
16595
+ return {
16596
+ conditions: { [rule.mode]: rule.conditions.map(serializeConditionNode) },
16597
+ event: { type, ...params ? { params } : {} }
16598
+ };
16599
+ }
16600
+ function serializeDefaultPipelineAssignment(spec) {
16601
+ let primaryKey = null;
16602
+ if (spec.default._tag === "assign") {
16603
+ primaryKey = spec.default.pipeline.key;
16604
+ } else {
16605
+ for (const rule of spec.rules) {
16606
+ if (rule.outcome._tag === "assign") {
16607
+ primaryKey = rule.outcome.pipeline.key;
16608
+ break;
16609
+ }
16610
+ }
16611
+ }
16612
+ if (primaryKey === null) {
16613
+ throw new Error("defaultPipelineAssignment must contain at least one assign() outcome " + "(in `default` or in `rules`). A policy that only skips is not useful.");
16614
+ }
16615
+ const { type: defaultType, params: defaultParams } = serializeOutcome(spec.default);
16616
+ const outcomeSet = new Set([defaultType]);
16617
+ const serializedRules = spec.rules.map((rule) => {
16618
+ outcomeSet.add(serializeOutcome(rule.outcome).type);
16619
+ return serializeAssignmentRule(rule);
16620
+ });
16621
+ return {
16622
+ linearPipelineDefinitionKey: primaryKey,
16623
+ rulesJson: { rules: serializedRules },
16624
+ defaultEventType: defaultType,
16625
+ defaultEventParamsJson: defaultParams,
16626
+ allowedEventTypes: [...outcomeSet]
16627
+ };
16628
+ }
16629
+ function isDefaultPipelineAssignmentSpec(value) {
16630
+ if (typeof value !== "object" || value === null)
16631
+ return false;
16632
+ return value["_tag"] === "default_pipeline_assignment";
16633
+ }
16489
16634
  // src/opencode-mcp.ts
16490
16635
  var nonEmptyStringSchema = exports_external.string().trim().min(1);
16491
16636
  var mcpStringMapSchema = exports_external.record(exports_external.string(), exports_external.string());
@@ -16806,6 +16951,7 @@ async function parseBoboddyConfig(workspacePath) {
16806
16951
  export {
16807
16952
  stripTrailingCommas,
16808
16953
  stripJsoncComments,
16954
+ serializeDefaultPipelineAssignment,
16809
16955
  renderPromptTemplate,
16810
16956
  pipeline,
16811
16957
  parseJsonc,
@@ -16819,7 +16965,9 @@ export {
16819
16965
  materializeAccessor,
16820
16966
  literal2 as literal,
16821
16967
  isInputAccessor,
16968
+ isDefaultPipelineAssignmentSpec,
16822
16969
  defineStep,
16970
+ defaultPipelineAssignment,
16823
16971
  createStepExecutionPlaneClient,
16824
16972
  createStepDefinitionsClient,
16825
16973
  createPromptInputProxy,
@@ -16842,6 +16990,7 @@ export {
16842
16990
  PipelineBuilder,
16843
16991
  FeedbackRequests,
16844
16992
  Features,
16993
+ DEFAULT_PIPELINE_ASSIGNMENT_FILENAME,
16845
16994
  Computed,
16846
16995
  BoboddyClient,
16847
16996
  BOBODDY_CONFIG_RELATIVE_PATH,