@boboddy/sdk 0.5.2 → 0.5.4
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/definitions/steps/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/push/collect-definitions.d.ts +12 -0
- package/dist/push/index.d.ts +1 -1
- package/dist/push/index.js +38 -36
- package/package.json +1 -1
|
@@ -13731,7 +13731,7 @@ var buildStepDefinitionsClient = (stepDefinitions) => {
|
|
|
13731
13731
|
key: spec.key,
|
|
13732
13732
|
name: spec.name,
|
|
13733
13733
|
description: spec.description,
|
|
13734
|
-
prompt: spec.prompt ??
|
|
13734
|
+
prompt: spec.prompt ?? null,
|
|
13735
13735
|
version: spec.version,
|
|
13736
13736
|
kind: spec.kind,
|
|
13737
13737
|
entrypointJson: spec.entrypointJson ?? null,
|
package/dist/index.js
CHANGED
|
@@ -16195,7 +16195,7 @@ var buildStepDefinitionsClient = (stepDefinitions) => {
|
|
|
16195
16195
|
key: spec.key,
|
|
16196
16196
|
name: spec.name,
|
|
16197
16197
|
description: spec.description,
|
|
16198
|
-
prompt: spec.prompt ??
|
|
16198
|
+
prompt: spec.prompt ?? null,
|
|
16199
16199
|
version: spec.version,
|
|
16200
16200
|
kind: spec.kind,
|
|
16201
16201
|
entrypointJson: spec.entrypointJson ?? null,
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { PipelineDefinitionSpec } from "../definitions/pipelines";
|
|
2
2
|
import { type DefaultPipelineAssignmentSpec } from "../definitions/pipelines/define-default-pipeline-assignment";
|
|
3
3
|
import type { StepDefinitionSpec } from "../definitions/steps";
|
|
4
|
+
/**
|
|
5
|
+
* The fixed, repo-root-relative directory `boboddy pipelines init` scaffolds
|
|
6
|
+
* and `boboddy pipelines push`/`studio` always run from. `resolveCodeStepEntrypoint`
|
|
7
|
+
* uses this to record a `kind: "code"` step's `sourceFile` relative to the repo
|
|
8
|
+
* root (what the worker's `execute-code-step.ts` expects when it joins
|
|
9
|
+
* `sourceFile` onto the checked-out workspace root), regardless of what the
|
|
10
|
+
* collecting process's own `cwd` happens to be.
|
|
11
|
+
*
|
|
12
|
+
* Duplicated nowhere else — `@boboddy/worker`'s own `PIPELINE_BUILDER_DIR`
|
|
13
|
+
* imports this one, so there's a single source of truth.
|
|
14
|
+
*/
|
|
15
|
+
export declare const PIPELINE_BUILDER_DIR = ".boboddy/pipeline-builder";
|
|
4
16
|
export type CollectedDefinitions = {
|
|
5
17
|
readonly pipelines: readonly PipelineDefinitionSpec[];
|
|
6
18
|
/** Deduped by `key@vN`; named exports take precedence over embedded steps. */
|
package/dist/push/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { collectDefinitionsFromDirectory, collectDefinitionsFromDirectoryTolerant, } from "./collect-definitions";
|
|
1
|
+
export { PIPELINE_BUILDER_DIR, collectDefinitionsFromDirectory, collectDefinitionsFromDirectoryTolerant, } from "./collect-definitions";
|
|
2
2
|
export type { BrokenPipeline, CollectedDefinitions, TolerantCollectedDefinitions, } from "./collect-definitions";
|
|
3
3
|
export { pushFromDirectory } from "./push-from-directory";
|
|
4
4
|
export type { PushFromDirectoryOptions, PushFromDirectoryResult, } from "./push-from-directory";
|
package/dist/push/index.js
CHANGED
|
@@ -277,7 +277,7 @@ __export(exports_core2, {
|
|
|
277
277
|
parse: () => parse,
|
|
278
278
|
parseAsync: () => parseAsync,
|
|
279
279
|
prettifyError: () => prettifyError,
|
|
280
|
-
process: () =>
|
|
280
|
+
process: () => process,
|
|
281
281
|
regexes: () => exports_regexes,
|
|
282
282
|
registry: () => registry,
|
|
283
283
|
safeDecode: () => safeDecode,
|
|
@@ -11017,7 +11017,7 @@ function initializeContext(params) {
|
|
|
11017
11017
|
external: params?.external ?? undefined
|
|
11018
11018
|
};
|
|
11019
11019
|
}
|
|
11020
|
-
function
|
|
11020
|
+
function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
11021
11021
|
var _a3;
|
|
11022
11022
|
const def = schema._zod.def;
|
|
11023
11023
|
const seen = ctx.seen.get(schema);
|
|
@@ -11054,7 +11054,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
11054
11054
|
if (parent) {
|
|
11055
11055
|
if (!result.ref)
|
|
11056
11056
|
result.ref = parent;
|
|
11057
|
-
|
|
11057
|
+
process(parent, ctx, params);
|
|
11058
11058
|
ctx.seen.get(parent).isParent = true;
|
|
11059
11059
|
}
|
|
11060
11060
|
}
|
|
@@ -11337,14 +11337,14 @@ function isTransforming(_schema, _ctx) {
|
|
|
11337
11337
|
}
|
|
11338
11338
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
11339
11339
|
const ctx = initializeContext({ ...params, processors });
|
|
11340
|
-
|
|
11340
|
+
process(schema, ctx);
|
|
11341
11341
|
extractDefs(ctx, schema);
|
|
11342
11342
|
return finalize(ctx, schema);
|
|
11343
11343
|
};
|
|
11344
11344
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
11345
11345
|
const { libraryOptions, target } = params ?? {};
|
|
11346
11346
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
11347
|
-
|
|
11347
|
+
process(schema, ctx);
|
|
11348
11348
|
extractDefs(ctx, schema);
|
|
11349
11349
|
return finalize(ctx, schema);
|
|
11350
11350
|
};
|
|
@@ -11584,7 +11584,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
11584
11584
|
if (typeof maximum === "number")
|
|
11585
11585
|
json.maxItems = maximum;
|
|
11586
11586
|
json.type = "array";
|
|
11587
|
-
json.items =
|
|
11587
|
+
json.items = process(def.element, ctx, {
|
|
11588
11588
|
...params,
|
|
11589
11589
|
path: [...params.path, "items"]
|
|
11590
11590
|
});
|
|
@@ -11596,7 +11596,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
11596
11596
|
json.properties = {};
|
|
11597
11597
|
const shape = def.shape;
|
|
11598
11598
|
for (const key in shape) {
|
|
11599
|
-
json.properties[key] =
|
|
11599
|
+
json.properties[key] = process(shape[key], ctx, {
|
|
11600
11600
|
...params,
|
|
11601
11601
|
path: [...params.path, "properties", key]
|
|
11602
11602
|
});
|
|
@@ -11619,7 +11619,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
11619
11619
|
if (ctx.io === "output")
|
|
11620
11620
|
json.additionalProperties = false;
|
|
11621
11621
|
} else if (def.catchall) {
|
|
11622
|
-
json.additionalProperties =
|
|
11622
|
+
json.additionalProperties = process(def.catchall, ctx, {
|
|
11623
11623
|
...params,
|
|
11624
11624
|
path: [...params.path, "additionalProperties"]
|
|
11625
11625
|
});
|
|
@@ -11628,7 +11628,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
11628
11628
|
var unionProcessor = (schema, ctx, json, params) => {
|
|
11629
11629
|
const def = schema._zod.def;
|
|
11630
11630
|
const isExclusive = def.inclusive === false;
|
|
11631
|
-
const options = def.options.map((x, i) =>
|
|
11631
|
+
const options = def.options.map((x, i) => process(x, ctx, {
|
|
11632
11632
|
...params,
|
|
11633
11633
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
11634
11634
|
}));
|
|
@@ -11640,11 +11640,11 @@ var unionProcessor = (schema, ctx, json, params) => {
|
|
|
11640
11640
|
};
|
|
11641
11641
|
var intersectionProcessor = (schema, ctx, json, params) => {
|
|
11642
11642
|
const def = schema._zod.def;
|
|
11643
|
-
const a =
|
|
11643
|
+
const a = process(def.left, ctx, {
|
|
11644
11644
|
...params,
|
|
11645
11645
|
path: [...params.path, "allOf", 0]
|
|
11646
11646
|
});
|
|
11647
|
-
const b =
|
|
11647
|
+
const b = process(def.right, ctx, {
|
|
11648
11648
|
...params,
|
|
11649
11649
|
path: [...params.path, "allOf", 1]
|
|
11650
11650
|
});
|
|
@@ -11661,11 +11661,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
11661
11661
|
json.type = "array";
|
|
11662
11662
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
11663
11663
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
11664
|
-
const prefixItems = def.items.map((x, i) =>
|
|
11664
|
+
const prefixItems = def.items.map((x, i) => process(x, ctx, {
|
|
11665
11665
|
...params,
|
|
11666
11666
|
path: [...params.path, prefixPath, i]
|
|
11667
11667
|
}));
|
|
11668
|
-
const rest = def.rest ?
|
|
11668
|
+
const rest = def.rest ? process(def.rest, ctx, {
|
|
11669
11669
|
...params,
|
|
11670
11670
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
11671
11671
|
}) : null;
|
|
@@ -11705,7 +11705,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
11705
11705
|
const keyBag = keyType._zod.bag;
|
|
11706
11706
|
const patterns = keyBag?.patterns;
|
|
11707
11707
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
11708
|
-
const valueSchema =
|
|
11708
|
+
const valueSchema = process(def.valueType, ctx, {
|
|
11709
11709
|
...params,
|
|
11710
11710
|
path: [...params.path, "patternProperties", "*"]
|
|
11711
11711
|
});
|
|
@@ -11715,12 +11715,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
11715
11715
|
}
|
|
11716
11716
|
} else {
|
|
11717
11717
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
11718
|
-
json.propertyNames =
|
|
11718
|
+
json.propertyNames = process(def.keyType, ctx, {
|
|
11719
11719
|
...params,
|
|
11720
11720
|
path: [...params.path, "propertyNames"]
|
|
11721
11721
|
});
|
|
11722
11722
|
}
|
|
11723
|
-
json.additionalProperties =
|
|
11723
|
+
json.additionalProperties = process(def.valueType, ctx, {
|
|
11724
11724
|
...params,
|
|
11725
11725
|
path: [...params.path, "additionalProperties"]
|
|
11726
11726
|
});
|
|
@@ -11735,7 +11735,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
11735
11735
|
};
|
|
11736
11736
|
var nullableProcessor = (schema, ctx, json, params) => {
|
|
11737
11737
|
const def = schema._zod.def;
|
|
11738
|
-
const inner =
|
|
11738
|
+
const inner = process(def.innerType, ctx, params);
|
|
11739
11739
|
const seen = ctx.seen.get(schema);
|
|
11740
11740
|
if (ctx.target === "openapi-3.0") {
|
|
11741
11741
|
seen.ref = def.innerType;
|
|
@@ -11746,20 +11746,20 @@ var nullableProcessor = (schema, ctx, json, params) => {
|
|
|
11746
11746
|
};
|
|
11747
11747
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
11748
11748
|
const def = schema._zod.def;
|
|
11749
|
-
|
|
11749
|
+
process(def.innerType, ctx, params);
|
|
11750
11750
|
const seen = ctx.seen.get(schema);
|
|
11751
11751
|
seen.ref = def.innerType;
|
|
11752
11752
|
};
|
|
11753
11753
|
var defaultProcessor = (schema, ctx, json, params) => {
|
|
11754
11754
|
const def = schema._zod.def;
|
|
11755
|
-
|
|
11755
|
+
process(def.innerType, ctx, params);
|
|
11756
11756
|
const seen = ctx.seen.get(schema);
|
|
11757
11757
|
seen.ref = def.innerType;
|
|
11758
11758
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
11759
11759
|
};
|
|
11760
11760
|
var prefaultProcessor = (schema, ctx, json, params) => {
|
|
11761
11761
|
const def = schema._zod.def;
|
|
11762
|
-
|
|
11762
|
+
process(def.innerType, ctx, params);
|
|
11763
11763
|
const seen = ctx.seen.get(schema);
|
|
11764
11764
|
seen.ref = def.innerType;
|
|
11765
11765
|
if (ctx.io === "input")
|
|
@@ -11767,7 +11767,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
|
|
|
11767
11767
|
};
|
|
11768
11768
|
var catchProcessor = (schema, ctx, json, params) => {
|
|
11769
11769
|
const def = schema._zod.def;
|
|
11770
|
-
|
|
11770
|
+
process(def.innerType, ctx, params);
|
|
11771
11771
|
const seen = ctx.seen.get(schema);
|
|
11772
11772
|
seen.ref = def.innerType;
|
|
11773
11773
|
let catchValue;
|
|
@@ -11782,32 +11782,32 @@ var pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
11782
11782
|
const def = schema._zod.def;
|
|
11783
11783
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
11784
11784
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
11785
|
-
|
|
11785
|
+
process(innerType, ctx, params);
|
|
11786
11786
|
const seen = ctx.seen.get(schema);
|
|
11787
11787
|
seen.ref = innerType;
|
|
11788
11788
|
};
|
|
11789
11789
|
var readonlyProcessor = (schema, ctx, json, params) => {
|
|
11790
11790
|
const def = schema._zod.def;
|
|
11791
|
-
|
|
11791
|
+
process(def.innerType, ctx, params);
|
|
11792
11792
|
const seen = ctx.seen.get(schema);
|
|
11793
11793
|
seen.ref = def.innerType;
|
|
11794
11794
|
json.readOnly = true;
|
|
11795
11795
|
};
|
|
11796
11796
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
11797
11797
|
const def = schema._zod.def;
|
|
11798
|
-
|
|
11798
|
+
process(def.innerType, ctx, params);
|
|
11799
11799
|
const seen = ctx.seen.get(schema);
|
|
11800
11800
|
seen.ref = def.innerType;
|
|
11801
11801
|
};
|
|
11802
11802
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
11803
11803
|
const def = schema._zod.def;
|
|
11804
|
-
|
|
11804
|
+
process(def.innerType, ctx, params);
|
|
11805
11805
|
const seen = ctx.seen.get(schema);
|
|
11806
11806
|
seen.ref = def.innerType;
|
|
11807
11807
|
};
|
|
11808
11808
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
11809
11809
|
const innerType = schema._zod.innerType;
|
|
11810
|
-
|
|
11810
|
+
process(innerType, ctx, params);
|
|
11811
11811
|
const seen = ctx.seen.get(schema);
|
|
11812
11812
|
seen.ref = innerType;
|
|
11813
11813
|
};
|
|
@@ -11859,7 +11859,7 @@ function toJSONSchema(input, params) {
|
|
|
11859
11859
|
const defs = {};
|
|
11860
11860
|
for (const entry of registry2._idmap.entries()) {
|
|
11861
11861
|
const [_, schema] = entry;
|
|
11862
|
-
|
|
11862
|
+
process(schema, ctx2);
|
|
11863
11863
|
}
|
|
11864
11864
|
const schemas = {};
|
|
11865
11865
|
const external = {
|
|
@@ -11882,7 +11882,7 @@ function toJSONSchema(input, params) {
|
|
|
11882
11882
|
return { schemas };
|
|
11883
11883
|
}
|
|
11884
11884
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
11885
|
-
|
|
11885
|
+
process(input, ctx);
|
|
11886
11886
|
extractDefs(ctx, input);
|
|
11887
11887
|
return finalize(ctx, input);
|
|
11888
11888
|
}
|
|
@@ -11928,7 +11928,7 @@ class JSONSchemaGenerator {
|
|
|
11928
11928
|
});
|
|
11929
11929
|
}
|
|
11930
11930
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
11931
|
-
return
|
|
11931
|
+
return process(schema, this.ctx, _params);
|
|
11932
11932
|
}
|
|
11933
11933
|
emit(schema, _params) {
|
|
11934
11934
|
if (_params) {
|
|
@@ -13731,7 +13731,7 @@ var buildStepDefinitionsClient = (stepDefinitions) => {
|
|
|
13731
13731
|
key: spec.key,
|
|
13732
13732
|
name: spec.name,
|
|
13733
13733
|
description: spec.description,
|
|
13734
|
-
prompt: spec.prompt ??
|
|
13734
|
+
prompt: spec.prompt ?? null,
|
|
13735
13735
|
version: spec.version,
|
|
13736
13736
|
kind: spec.kind,
|
|
13737
13737
|
entrypointJson: spec.entrypointJson ?? null,
|
|
@@ -18104,13 +18104,14 @@ var INTERNAL_SCRIPT_NAMES = new Set([
|
|
|
18104
18104
|
"push.js",
|
|
18105
18105
|
".boboddy-studio-collect.mjs"
|
|
18106
18106
|
]);
|
|
18107
|
+
var PIPELINE_BUILDER_DIR = ".boboddy/pipeline-builder";
|
|
18107
18108
|
function isStepDefinitionSpec(value) {
|
|
18108
18109
|
if (typeof value !== "object" || value === null)
|
|
18109
18110
|
return false;
|
|
18110
18111
|
const obj = value;
|
|
18111
18112
|
return typeof obj["key"] === "string" && typeof obj["name"] === "string" && typeof obj["version"] === "number" && (obj["kind"] === "user_defined" || obj["kind"] === "code");
|
|
18112
18113
|
}
|
|
18113
|
-
function resolveCodeStepEntrypoint(spec, mod, absoluteFilePath) {
|
|
18114
|
+
function resolveCodeStepEntrypoint(spec, mod, absoluteFilePath, absDir) {
|
|
18114
18115
|
if (spec.kind !== "code")
|
|
18115
18116
|
return spec;
|
|
18116
18117
|
const fn = spec.entrypoint?.fn;
|
|
@@ -18124,7 +18125,7 @@ function resolveCodeStepEntrypoint(spec, mod, absoluteFilePath) {
|
|
|
18124
18125
|
const resolved = { ...spec };
|
|
18125
18126
|
delete resolved.entrypoint;
|
|
18126
18127
|
resolved.entrypointJson = {
|
|
18127
|
-
sourceFile: relative(
|
|
18128
|
+
sourceFile: join(PIPELINE_BUILDER_DIR, relative(absDir, absoluteFilePath)),
|
|
18128
18129
|
exportName
|
|
18129
18130
|
};
|
|
18130
18131
|
return resolved;
|
|
@@ -18145,7 +18146,7 @@ function listSourceFiles(absDir) {
|
|
|
18145
18146
|
function fileNameWithoutExtension(file2) {
|
|
18146
18147
|
return file2.replace(/\.(ts|js)$/, "");
|
|
18147
18148
|
}
|
|
18148
|
-
async function collectFile(absoluteFilePath, pipelines, stepMap) {
|
|
18149
|
+
async function collectFile(absoluteFilePath, absDir, pipelines, stepMap) {
|
|
18149
18150
|
const mod = await importModule(absoluteFilePath);
|
|
18150
18151
|
for (const [exportName, value] of Object.entries(mod)) {
|
|
18151
18152
|
if (exportName === "default") {
|
|
@@ -18154,7 +18155,7 @@ async function collectFile(absoluteFilePath, pipelines, stepMap) {
|
|
|
18154
18155
|
continue;
|
|
18155
18156
|
}
|
|
18156
18157
|
if (isStepDefinitionSpec(value)) {
|
|
18157
|
-
const resolved = resolveCodeStepEntrypoint(value, mod, absoluteFilePath);
|
|
18158
|
+
const resolved = resolveCodeStepEntrypoint(value, mod, absoluteFilePath, absDir);
|
|
18158
18159
|
stepMap.set(`${resolved.key}@v${String(resolved.version)}`, resolved);
|
|
18159
18160
|
}
|
|
18160
18161
|
}
|
|
@@ -18176,7 +18177,7 @@ async function collectDefinitionsFromDirectory(dir) {
|
|
|
18176
18177
|
const pipelines = [];
|
|
18177
18178
|
const stepMap = new Map;
|
|
18178
18179
|
for (const file2 of sourceFiles) {
|
|
18179
|
-
await collectFile(join(absDir, file2), pipelines, stepMap);
|
|
18180
|
+
await collectFile(join(absDir, file2), absDir, pipelines, stepMap);
|
|
18180
18181
|
}
|
|
18181
18182
|
for (const spec of pipelines) {
|
|
18182
18183
|
foldEmbeddedSteps(dir, spec, stepMap);
|
|
@@ -18195,7 +18196,7 @@ async function collectDefinitionsFromDirectoryTolerant(dir) {
|
|
|
18195
18196
|
const brokenPipelines = [];
|
|
18196
18197
|
for (const file2 of sourceFiles) {
|
|
18197
18198
|
try {
|
|
18198
|
-
await collectFile(join(absDir, file2), pipelines, stepMap);
|
|
18199
|
+
await collectFile(join(absDir, file2), absDir, pipelines, stepMap);
|
|
18199
18200
|
} catch (error51) {
|
|
18200
18201
|
brokenPipelines.push({
|
|
18201
18202
|
key: fileNameWithoutExtension(file2),
|
|
@@ -18350,6 +18351,7 @@ async function syncDefaultPipelineAssignment(spec, opts, headers, pipelinesClien
|
|
|
18350
18351
|
return true;
|
|
18351
18352
|
}
|
|
18352
18353
|
export {
|
|
18354
|
+
PIPELINE_BUILDER_DIR,
|
|
18353
18355
|
collectDefinitionsFromDirectory,
|
|
18354
18356
|
collectDefinitionsFromDirectoryTolerant,
|
|
18355
18357
|
pushFromDirectory
|