@boboddy/sdk 0.1.14-alpha → 0.1.16-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.
Files changed (31) hide show
  1. package/dist/boboddy-config-parser.js +4 -325
  2. package/dist/client.js +2 -1
  3. package/dist/defaults/auth-file.d.ts +14 -0
  4. package/dist/defaults/base-url.d.ts +1 -0
  5. package/dist/defaults/index.d.ts +7 -0
  6. package/dist/defaults/index.js +312 -0
  7. package/dist/defaults/load-push-defaults.d.ts +21 -0
  8. package/dist/defaults/project-config.d.ts +5 -0
  9. package/dist/definitions/advancement-policies/define-advancement-policy.d.ts +4 -0
  10. package/dist/definitions/advancement-policies/fluent-rules.d.ts +82 -0
  11. package/dist/definitions/advancement-policies/index.d.ts +1 -0
  12. package/dist/definitions/advancement-policies/index.js +87 -0
  13. package/dist/definitions/pipelines/builder.d.ts +111 -0
  14. package/dist/definitions/pipelines/define-pipeline.d.ts +24 -52
  15. package/dist/definitions/pipelines/index.d.ts +2 -0
  16. package/dist/definitions/pipelines/index.js +14672 -75
  17. package/dist/definitions/pipelines/input-accessor.d.ts +25 -0
  18. package/dist/definitions/pipelines/pipeline-definitions-client.d.ts +17 -21
  19. package/dist/definitions/steps/define-step.d.ts +17 -4
  20. package/dist/definitions/steps/index.d.ts +1 -0
  21. package/dist/definitions/steps/index.js +1605 -1578
  22. package/dist/definitions/steps/prompt-template.d.ts +16 -0
  23. package/dist/definitions/steps/step-features.d.ts +1 -1
  24. package/dist/generated/types.gen.d.ts +90 -108
  25. package/dist/index.js +1981 -1956
  26. package/dist/jsonc.js +1 -0
  27. package/dist/opencode-mcp.js +1573 -1572
  28. package/dist/push/index.d.ts +2 -0
  29. package/dist/push/index.js +16480 -0
  30. package/dist/push/push-from-directory.d.ts +21 -0
  31. package/package.json +9 -1
@@ -0,0 +1,25 @@
1
+ import type { ZodType } from "zod";
2
+ import type { PipelineInputBinding } from "./define-pipeline";
3
+ type DeepAccessor<T> = T extends ReadonlyArray<infer U> ? {
4
+ readonly [index: number]: InputAccessor<U>;
5
+ } : T extends object ? {
6
+ readonly [K in keyof T]: InputAccessor<T[K]>;
7
+ } : object;
8
+ /**
9
+ * Type-level shape of the input accessor. Claims to be a `PipelineInputBinding`
10
+ * so it slots into binding positions for type-checking; the actual binding
11
+ * object is produced at builder time via `materializeAccessor`.
12
+ */
13
+ export type InputAccessor<T> = PipelineInputBinding & DeepAccessor<T>;
14
+ /**
15
+ * Creates a recursive proxy bound to the pipeline's input schema. Each property
16
+ * access returns a new accessor whose `materializeAccessor()` yields a
17
+ * `PipelineInputBinding` with the accumulated dot-path.
18
+ *
19
+ * The schema argument is used only for type inference — no runtime validation
20
+ * is performed against it.
21
+ */
22
+ export declare function createInputAccessor<T extends ZodType>(_schema: T): InputAccessor<T["_output"]>;
23
+ export declare function isInputAccessor(value: unknown): value is InputAccessor<unknown>;
24
+ export declare function materializeAccessor(accessor: InputAccessor<unknown>): PipelineInputBinding;
25
+ export {};
@@ -20,6 +20,7 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
20
20
  description: string | unknown;
21
21
  status: "draft" | "active" | "archived";
22
22
  archivedAt: string | unknown;
23
+ inputSchemaJson: unknown;
23
24
  stepDefinitions: Array<{
24
25
  id: string;
25
26
  linearPipelineDefinitionId: string;
@@ -33,6 +34,9 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
33
34
  [key: string]: {
34
35
  source: string;
35
36
  path: string | unknown;
37
+ } | {
38
+ source: string;
39
+ field: "title" | "description";
36
40
  } | {
37
41
  source: string;
38
42
  stepKey: string;
@@ -47,9 +51,7 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
47
51
  };
48
52
  } | unknown;
49
53
  timeoutSeconds: number | unknown;
50
- retryPolicyJson: {
51
- [key: string]: unknown;
52
- } | unknown;
54
+ retryPolicyJson: unknown;
53
55
  advancementPolicyDefinition: {
54
56
  id: string;
55
57
  linearPipelineStepDefinitionId: string;
@@ -98,9 +100,7 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
98
100
  }>;
99
101
  };
100
102
  defaultEventType: "continue" | "block" | "complete" | "route";
101
- defaultEventParamsJson: {
102
- [key: string]: unknown;
103
- } | unknown;
103
+ defaultEventParamsJson: unknown;
104
104
  allowedEventTypes: Array<"continue" | "block" | "complete" | "route">;
105
105
  createdAt: string;
106
106
  updatedAt: string;
@@ -110,9 +110,7 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
110
110
  key: string;
111
111
  type: "average" | "weighted_average" | "sum" | "min" | "max" | "count" | "boolean_any" | "boolean_all";
112
112
  inputSignalKeys: Array<string>;
113
- configJson: {
114
- [key: string]: unknown;
115
- } | unknown;
113
+ configJson: unknown;
116
114
  availableWhenResultStatusIn: Array<string> | unknown;
117
115
  createdAt: string;
118
116
  updatedAt: string;
@@ -125,9 +123,9 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
125
123
  }[]>;
126
124
  /**
127
125
  * Upserts a pipeline definition keyed by (projectId, key). Accepts the
128
- * `PipelineDefinitionSpec` produced by `definePipeline()` directly, along
129
- * with the list of pushed step definitions (used to resolve
130
- * `stepDefinitionId` for each pipeline step).
126
+ * `PipelineDefinitionSpec` produced by `pipeline().build()`, along with the
127
+ * list of pushed step definitions (used to resolve `stepDefinitionId` for
128
+ * each pipeline step).
131
129
  *
132
130
  * Throws if any pipeline step references a step key/version that isn't
133
131
  * present in `stepDefs`.
@@ -140,6 +138,7 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
140
138
  description: string | unknown;
141
139
  status: "draft" | "active" | "archived";
142
140
  archivedAt: string | unknown;
141
+ inputSchemaJson: unknown;
143
142
  stepDefinitions: Array<{
144
143
  id: string;
145
144
  linearPipelineDefinitionId: string;
@@ -153,6 +152,9 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
153
152
  [key: string]: {
154
153
  source: string;
155
154
  path: string | unknown;
155
+ } | {
156
+ source: string;
157
+ field: "title" | "description";
156
158
  } | {
157
159
  source: string;
158
160
  stepKey: string;
@@ -167,9 +169,7 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
167
169
  };
168
170
  } | unknown;
169
171
  timeoutSeconds: number | unknown;
170
- retryPolicyJson: {
171
- [key: string]: unknown;
172
- } | unknown;
172
+ retryPolicyJson: unknown;
173
173
  advancementPolicyDefinition: {
174
174
  id: string;
175
175
  linearPipelineStepDefinitionId: string;
@@ -218,9 +218,7 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
218
218
  }>;
219
219
  };
220
220
  defaultEventType: "continue" | "block" | "complete" | "route";
221
- defaultEventParamsJson: {
222
- [key: string]: unknown;
223
- } | unknown;
221
+ defaultEventParamsJson: unknown;
224
222
  allowedEventTypes: Array<"continue" | "block" | "complete" | "route">;
225
223
  createdAt: string;
226
224
  updatedAt: string;
@@ -230,9 +228,7 @@ declare const buildPipelineDefinitionsClient: (pipelineDefinitions: PipelineDefi
230
228
  key: string;
231
229
  type: "average" | "weighted_average" | "sum" | "min" | "max" | "count" | "boolean_any" | "boolean_all";
232
230
  inputSignalKeys: Array<string>;
233
- configJson: {
234
- [key: string]: unknown;
235
- } | unknown;
231
+ configJson: unknown;
236
232
  availableWhenResultStatusIn: Array<string> | unknown;
237
233
  createdAt: string;
238
234
  updatedAt: string;
@@ -1,5 +1,6 @@
1
1
  import type { ZodType } from "zod";
2
2
  import type { AnyStepFeature, FeatureResultExtensions, FeatureSignalKeys } from "./step-features";
3
+ import { type PromptInputProxy } from "./prompt-template";
3
4
  type OpenCodeMcpServers = Record<string, {
4
5
  type: "local";
5
6
  command: string[];
@@ -48,7 +49,7 @@ export type DefineStepInput<TInput extends ZodType = ZodType, TResult extends Zo
48
49
  name: string;
49
50
  description?: string | null;
50
51
  version?: number;
51
- prompt?: string | null;
52
+ prompt?: string | null | ((input: PromptInputProxy<TInput["_output"]>) => string);
52
53
  input?: TInput;
53
54
  result?: TResult;
54
55
  signals?: SignalSpecInput<TResult["_output"]>[];
@@ -75,10 +76,19 @@ export type StepDefinitionSpec = {
75
76
  }>;
76
77
  opencodeMcpJson: OpenCodeMcpServers | null;
77
78
  };
78
- export type TypedStepDefinitionSpec<TInput = unknown, TResult = unknown, TSignalKeys extends string = string> = StepDefinitionSpec & {
79
+ export type SignalTypeStrToTs<T extends SignalTypeStr> = T extends "string" ? string : T extends "number" ? number : T extends "boolean" ? boolean : T extends "array" ? unknown[] : T extends "object" ? object : unknown;
80
+ export type SignalTypeMapOf<TSignals extends readonly unknown[], TResult> = {
81
+ [S in TSignals[number] as ExtractSignalKey<S>]: S extends {
82
+ type: infer T extends SignalTypeStr;
83
+ } ? SignalTypeStrToTs<T> : S extends {
84
+ sourcePath: infer P extends string;
85
+ } ? TypeAtPath<TResult, P> : unknown;
86
+ };
87
+ export type TypedStepDefinitionSpec<TInput = unknown, TResult = unknown, TSignalKeys extends string = string, TSignalTypeMap extends Partial<Record<string, unknown>> = Record<string, unknown>> = StepDefinitionSpec & {
79
88
  readonly __inputType: TInput;
80
89
  readonly __resultType: TResult;
81
90
  readonly __signalKeys: TSignalKeys;
91
+ readonly __signalTypeMap: TSignalTypeMap;
82
92
  };
83
93
  type ExtractSignalKey<T> = T extends {
84
94
  key: infer K extends string;
@@ -86,8 +96,11 @@ type ExtractSignalKey<T> = T extends {
86
96
  sourcePath: infer S extends string;
87
97
  } ? S : string;
88
98
  export type SignalKeysOf<TSignals extends readonly unknown[]> = TSignals extends readonly (infer S)[] ? ExtractSignalKey<S> : string;
89
- export declare function defineStep<TInput extends ZodType = ZodType, TResult extends ZodType = ZodType, const TSignals extends ReadonlyArray<SignalSpecInput<TResult["_output"]>> = never[], const TFeatures extends ReadonlyArray<AnyStepFeature> = never[]>(config: Omit<DefineStepInput<TInput, TResult>, "signals" | "features"> & {
99
+ export declare function defineStep<TInput extends ZodType = ZodType, TResult extends ZodType = ZodType, const TSignals extends ReadonlyArray<{
100
+ sourcePath: string;
101
+ key?: string;
102
+ }> = never[], const TFeatures extends ReadonlyArray<AnyStepFeature> = never[]>(config: Omit<DefineStepInput<TInput, TResult>, "signals" | "features"> & {
90
103
  signals?: TSignals;
91
104
  features?: TFeatures;
92
- }): TypedStepDefinitionSpec<TInput["_output"], TResult["_output"] & FeatureResultExtensions<TFeatures>, SignalKeysOf<TSignals> | FeatureSignalKeys<TFeatures>>;
105
+ }): TypedStepDefinitionSpec<TInput["_output"], TResult["_output"] & FeatureResultExtensions<TFeatures>, SignalKeysOf<TSignals> | FeatureSignalKeys<TFeatures>, SignalTypeMapOf<TSignals, TResult["_output"]>>;
93
106
  export {};
@@ -1,3 +1,4 @@
1
1
  export * from "./define-step";
2
+ export * from "./prompt-template";
2
3
  export * from "./step-definitions-client";
3
4
  export * from "./step-features";