@boboddy/sdk 0.4.3 → 0.5.1

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 (39) hide show
  1. package/dist/boboddy-config-parser.js +2 -2
  2. package/dist/client.js +20 -43
  3. package/dist/contracts/artifacts.js +948 -948
  4. package/dist/defaults/index.js +11 -11
  5. package/dist/definitions/advancement-policies/define-advancement-policy.d.ts +30 -5
  6. package/dist/definitions/advancement-policies/index.js +21 -11
  7. package/dist/definitions/pipelines/bindings.d.ts +62 -0
  8. package/dist/definitions/pipelines/builder-helpers.d.ts +19 -106
  9. package/dist/definitions/pipelines/chain-graph.d.ts +15 -14
  10. package/dist/definitions/pipelines/compile-node-definitions.d.ts +27 -0
  11. package/dist/definitions/pipelines/define-pipeline.d.ts +101 -154
  12. package/dist/definitions/pipelines/index.d.ts +0 -2
  13. package/dist/definitions/pipelines/index.js +1457 -1602
  14. package/dist/definitions/pipelines/node-input-ctx.d.ts +31 -0
  15. package/dist/definitions/pipelines/pipeline-definitions-client.d.ts +18 -4
  16. package/dist/definitions/pipelines/pipeline-states.d.ts +104 -0
  17. package/dist/definitions/steps/define-code-step.d.ts +50 -0
  18. package/dist/definitions/steps/define-step.d.ts +22 -1
  19. package/dist/definitions/steps/index.d.ts +1 -0
  20. package/dist/definitions/steps/index.js +13782 -13765
  21. package/dist/definitions/steps/step-definitions-client.d.ts +29 -5
  22. package/dist/definitions/validation/index.js +15152 -98
  23. package/dist/definitions/validation/validate-definition-specs.d.ts +19 -1
  24. package/dist/generated/index.d.ts +1 -1
  25. package/dist/generated/sdk.gen.d.ts +1 -4
  26. package/dist/generated/types.gen.d.ts +296 -878
  27. package/dist/health-checks.js +950 -950
  28. package/dist/index.js +1624 -1729
  29. package/dist/jsonc.js +2 -2
  30. package/dist/opencode-mcp.js +946 -946
  31. package/dist/opencode-plugin.js +950 -950
  32. package/dist/push/collect-definitions.d.ts +40 -1
  33. package/dist/push/index.d.ts +2 -2
  34. package/dist/push/index.js +14595 -14545
  35. package/dist/step-execution-plane-client.d.ts +9 -4
  36. package/package.json +2 -2
  37. package/dist/definitions/pipelines/builder.d.ts +0 -80
  38. package/dist/definitions/pipelines/fan-out-builder.d.ts +0 -66
  39. package/dist/definitions/pipelines/input-accessor.d.ts +0 -25
@@ -22,7 +22,7 @@ declare const buildStepExecutionPlaneClient: (stepExecutions: StepExecutions) =>
22
22
  projectId: string;
23
23
  stepDefinitionId: string;
24
24
  stepDefinitionVersion: number;
25
- status: "queued" | "running" | "succeeded" | "failed" | "timeout" | "abandoned" | "cancelled" | "skipped";
25
+ status: "pending" | "queued" | "running" | "succeeded" | "failed" | "timeout" | "abandoned" | "cancelled" | "skipped";
26
26
  inputJson: unknown;
27
27
  claimedBy: string | unknown;
28
28
  claimedAt: string | unknown;
@@ -65,7 +65,7 @@ declare const buildStepExecutionPlaneClient: (stepExecutions: StepExecutions) =>
65
65
  projectId: string;
66
66
  stepDefinitionId: string;
67
67
  stepDefinitionVersion: number;
68
- status: "queued" | "running" | "succeeded" | "failed" | "timeout" | "abandoned" | "cancelled" | "skipped";
68
+ status: "pending" | "queued" | "running" | "succeeded" | "failed" | "timeout" | "abandoned" | "cancelled" | "skipped";
69
69
  inputJson: unknown;
70
70
  claimedBy: string | unknown;
71
71
  claimedAt: string | unknown;
@@ -126,7 +126,7 @@ declare const buildStepExecutionPlaneClient: (stepExecutions: StepExecutions) =>
126
126
  };
127
127
  stepExecution: {
128
128
  id: string;
129
- status: "queued" | "running" | "succeeded" | "failed" | "timeout" | "abandoned" | "cancelled" | "skipped";
129
+ status: "pending" | "queued" | "running" | "succeeded" | "failed" | "timeout" | "abandoned" | "cancelled" | "skipped";
130
130
  inputJson: unknown;
131
131
  executionTimeoutSeconds: number | unknown;
132
132
  };
@@ -134,7 +134,12 @@ declare const buildStepExecutionPlaneClient: (stepExecutions: StepExecutions) =>
134
134
  id: string;
135
135
  key: string;
136
136
  name: string;
137
- prompt: string;
137
+ prompt: string | unknown;
138
+ kind: "built_in" | "user_defined" | "code";
139
+ entrypointJson: {
140
+ sourceFile: string;
141
+ exportName: string;
142
+ } | unknown;
138
143
  executionMode: "workspace" | "no_workspace";
139
144
  resultSchemaJson: {
140
145
  [key: string]: unknown;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@boboddy/sdk",
4
- "version": "0.4.3",
4
+ "version": "0.5.1",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "devDependencies": {
85
85
  "@hey-api/openapi-ts": "^0.90.10",
86
- "bun-types": "^1.3.12",
86
+ "bun-types": "^1.4.0",
87
87
  "zod": "^4.3.6"
88
88
  }
89
89
  }
@@ -1,80 +0,0 @@
1
- import { z, type ZodType } from "zod";
2
- import { type AdvanceCtx, type AdvanceResult } from "../advancement-policies/fluent-rules";
3
- import { type AnyBinding, type PipelineDefinitionSpec, type PipelineNodeConfig } from "./define-pipeline";
4
- import { type AnyTypedStep, type IsAny, type LastSignalKeys, type OptionalInputKeys, type PipelineMeta, type RequiredInputKeys, type StepInputCtx } from "./builder-helpers";
5
- import { type FanOutStepConfig } from "./fan-out-builder";
6
- export type { AnyTypedStep, PipelineMeta, StepInputCtx, WorkItemAccessor, } from "./builder-helpers";
7
- export { type FanOutStepConfig, type FanOutInputMapping, } from "./fan-out-builder";
8
- type StepInputMapping<S extends AnyTypedStep> = IsAny<S["__inputType"]> extends true ? Partial<Record<string, AnyBinding>> : S["__inputType"] extends object ? {
9
- [K in RequiredInputKeys<S["__inputType"]>]: AnyBinding;
10
- } & {
11
- [K in OptionalInputKeys<S["__inputType"]>]?: AnyBinding;
12
- } : Partial<Record<string, AnyBinding>>;
13
- /**
14
- * `.step()`'s single options argument. Deliberately a single generic type
15
- * (not a set of overload signatures split on `S["__hasAdditionalInput"]`):
16
- * with overloads, a mistake inside `options.input`'s return value fails
17
- * every overload, and TS reports "no overload matches" against the whole
18
- * call rather than pointing at the specific missing/wrong property inside
19
- * `input`'s return type. A single signature lets TS check `options`
20
- * structurally in one pass and localize the error correctly.
21
- */
22
- type StepOptions<TInput extends ZodType, TSteps extends ReadonlyArray<AnyTypedStep>, TFanOuts extends ReadonlyArray<AnyTypedStep>, S extends AnyTypedStep> = (S extends {
23
- __hasAdditionalInput: false;
24
- } ? {
25
- input?: (ctx: StepInputCtx<TInput, TSteps, TFanOuts>) => Partial<Record<string, AnyBinding>>;
26
- } : {
27
- input: (ctx: StepInputCtx<TInput, TSteps, TFanOuts>) => StepInputMapping<S>;
28
- }) & {
29
- advance: (ctx: AdvanceCtx<S["__signalKeys"], S["__signalTypeMap"]>) => AdvanceResult<S["__signalKeys"]>;
30
- timeout?: number | null;
31
- };
32
- /**
33
- * Returned by `.step()`/`pipeline()`. Provides `.step()` to chain the next
34
- * step, `.fanOutStep()` to begin a fan-out+cohort-gate pair (issue #167),
35
- * and `.build()` to finalize. `.step()` requires an `advance` callback in
36
- * its options — deciding how the pipeline continues past this step — as
37
- * part of the same call that declares the step's input, rather than as a
38
- * separate chained method on an intermediate builder class.
39
- */
40
- export declare class PipelineStepBuilder<TInput extends ZodType, TSteps extends ReadonlyArray<AnyTypedStep>, TFanOuts extends ReadonlyArray<AnyTypedStep> = []> {
41
- protected readonly inputSchema: TInput;
42
- protected readonly meta: Omit<PipelineMeta<TInput>, "additionalPipelineInput" | "additionalStepInput">;
43
- protected readonly nodes: PipelineNodeConfig[];
44
- protected readonly pipelineInputBindings: Record<string, AnyBinding>;
45
- protected readonly pipelineStepInputBindings: Record<string, AnyBinding>;
46
- readonly __steps: TSteps;
47
- readonly __fanOuts: TFanOuts;
48
- constructor(inputSchema: TInput, meta: Omit<PipelineMeta<TInput>, "additionalPipelineInput" | "additionalStepInput">, nodes: PipelineNodeConfig[], pipelineInputBindings?: Record<string, AnyBinding>, pipelineStepInputBindings?: Record<string, AnyBinding>);
49
- step<S extends AnyTypedStep>(step: S, options: StepOptions<TInput, TSteps, TFanOuts, S>): PipelineStepBuilder<TInput, [...TSteps, S], TFanOuts>;
50
- /**
51
- * Begins a fan-out+cohort-gate pair (issue #167): `step` is the template
52
- * every branch executes, with its branch count (and, when `over` names
53
- * an array-typed signal, each branch's own typed `item`) resolved at
54
- * runtime from `config.over` (a signal on the step immediately
55
- * preceding this fan-out). `config` requires both `advance` (each
56
- * branch's own continue/block decision) and `advanceAll` (the
57
- * whole-cohort decision — a pure gate, not a step; nothing besides the
58
- * fan-out+gate pair itself is appended to the pipeline's node sequence)
59
- * up front, mirroring how `.step()` requires `advance` in its own
60
- * options rather than as a separate chained call.
61
- */
62
- fanOutStep<S extends AnyTypedStep, K extends LastSignalKeys<TSteps>>(step: S, config: FanOutStepConfig<TInput, TSteps, TFanOuts, S, K>): PipelineStepBuilder<TInput, TSteps, [...TFanOuts, S]>;
63
- build(): PipelineDefinitionSpec;
64
- }
65
- /**
66
- * Entry-point builder returned by `pipeline()`. Only exposes `.step()` —
67
- * call that to receive a `PipelineStepBuilder`, which chains further
68
- * `.step()`/`.fanOutStep()` calls or finalizes with `.build()`.
69
- */
70
- export declare class PipelineBuilder<TInput extends ZodType> {
71
- private readonly inputSchema;
72
- private readonly meta;
73
- private readonly nodes;
74
- private readonly pipelineInputBindings;
75
- private readonly pipelineStepInputBindings;
76
- constructor(meta: PipelineMeta<TInput>);
77
- step<S extends AnyTypedStep>(step: S, options: StepOptions<TInput, [], [], S>): PipelineStepBuilder<TInput, [S]>;
78
- }
79
- export { literal } from "./builder-helpers";
80
- export declare function pipeline<TInput extends ZodType = z.ZodUnknown>(meta: PipelineMeta<TInput>): PipelineBuilder<TInput>;
@@ -1,66 +0,0 @@
1
- import type { ZodType } from "zod";
2
- import { type AdvanceAllCtx, type AdvanceAllResult, type AdvanceEachCtx, type AdvanceEachResult } from "../advancement-policies/cohort-fluent-rules";
3
- import { type AnyTypedStep, type FanOutInputCtx, type IsAny, type LastSignalKeys, type PipelineMeta, type RequiredInputKeys } from "./builder-helpers";
4
- import type { AnyBinding, PipelineNodeConfig } from "./define-pipeline";
5
- import { PipelineStepBuilder } from "./builder";
6
- /**
7
- * `.fanOutStep()` (issue #167) split out of `builder.ts` (which would
8
- * otherwise exceed this repo's `max-lines` limit) — genuinely mutually
9
- * referential with `PipelineStepBuilder` (`beginFanOut` both is called from
10
- * `PipelineStepBuilder.fanOutStep()` and returns a new one), so the import
11
- * cycle is structural, not accidental.
12
- */
13
- export type FanOutInputMapping<S extends AnyTypedStep> = Partial<Record<string, AnyBinding>> & (IsAny<S["__inputType"]> extends true ? unknown : S["__inputType"] extends object ? {
14
- [K in RequiredInputKeys<S["__inputType"]>]: AnyBinding;
15
- } : unknown);
16
- /**
17
- * `.fanOutStep(step, config)`'s sole config argument — `step` itself is a
18
- * separate positional argument (mirroring `.step(step, options)`), not a
19
- * field on this object. `K` is inferred from the literal value of
20
- * `config.over` in the same pass TypeScript type-checks `config.input`,
21
- * the same mechanism `builder.ts`'s `StepOptions` already relies on for
22
- * `.step()` — see that type's doc comment for why overloads are avoided
23
- * here too.
24
- */
25
- export type FanOutStepConfig<TInput extends ZodType, TSteps extends ReadonlyArray<AnyTypedStep>, TFanOuts extends ReadonlyArray<AnyTypedStep>, S extends AnyTypedStep, K extends LastSignalKeys<TSteps> = LastSignalKeys<TSteps>> = {
26
- /**
27
- * The signal to resolve each branch from — constrained to the most
28
- * recent ordinary step's declared signal keys (`TSteps`'s last element).
29
- * Note this is the last *step*, not necessarily the fan-out's immediate
30
- * graph predecessor: chaining a second `.fanOutStep()` right after
31
- * `.advanceAll()` (with no intervening `.step()`) still only offers this
32
- * same step's signals, since a `cohortGate` node produces no signals of
33
- * its own to resolve from.
34
- *
35
- * A number-typed signal resolves a fixed branch count with no `item` on
36
- * the input ctx (count-only mode); an array-typed signal resolves branch
37
- * count from the array's length and adds a typed `item` to the input
38
- * ctx for each branch.
39
- */
40
- over: K;
41
- input?: (ctx: FanOutInputCtx<TInput, TSteps, TFanOuts, K>) => FanOutInputMapping<S>;
42
- /**
43
- * Every branch's own continue/block decision (even the default "always
44
- * continue" must be declared explicitly) — evaluated once per branch
45
- * against that branch's own signals.
46
- */
47
- advance: (ctx: AdvanceEachCtx<S["__signalKeys"], S["__signalTypeMap"]>) => AdvanceEachResult;
48
- /**
49
- * The whole-cohort decision, evaluated once the fan-out's branches have
50
- * settled — a pure gate, not a step: nothing besides the fan-out+gate
51
- * pair itself is appended to the pipeline's node sequence.
52
- */
53
- advanceAll: (ctx: AdvanceAllCtx) => AdvanceAllResult;
54
- timeout?: number | null;
55
- };
56
- /**
57
- * Builds and pushes the `fanOut`+`cohortGate` node pair, resolves both the
58
- * per-branch (`advance`) and whole-cohort (`advanceAll`) policies from
59
- * `config`, and returns straight into a `PipelineStepBuilder` — mirroring
60
- * how `pushStep` in `builder.ts` resolves a step's `advance` policy inline
61
- * rather than through a chained `.advance()` call on an intermediate
62
- * builder. Called from `PipelineStepBuilder.fanOutStep()` — factored out
63
- * here (rather than inlined there) purely to keep the node-construction
64
- * logic next to the types it feeds.
65
- */
66
- export declare function beginFanOut<TInput extends ZodType, TSteps extends ReadonlyArray<AnyTypedStep>, TFanOuts extends ReadonlyArray<AnyTypedStep>, S extends AnyTypedStep, K extends LastSignalKeys<TSteps> = LastSignalKeys<TSteps>>(inputSchema: TInput, meta: Omit<PipelineMeta<TInput>, "additionalPipelineInput" | "additionalStepInput">, nodes: PipelineNodeConfig[], pipelineInputBindings: Record<string, AnyBinding>, pipelineStepInputBindings: Record<string, AnyBinding>, step: S, config: FanOutStepConfig<TInput, TSteps, TFanOuts, S, K>): PipelineStepBuilder<TInput, TSteps, [...TFanOuts, S]>;
@@ -1,25 +0,0 @@
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 {};