@base44-preview/cli 0.0.25-pr.151.12d57cf → 0.0.25-pr.151.1ef8126

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 (2) hide show
  1. package/dist/index.js +37 -133
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5747,77 +5747,6 @@ function handleIntersectionResults(result, left, right) {
5747
5747
  result.value = merged.data;
5748
5748
  return result;
5749
5749
  }
5750
- const $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
5751
- $ZodType.init(inst, def);
5752
- const items = def.items;
5753
- inst._zod.parse = (payload, ctx) => {
5754
- const input = payload.value;
5755
- if (!Array.isArray(input)) {
5756
- payload.issues.push({
5757
- input,
5758
- inst,
5759
- expected: "tuple",
5760
- code: "invalid_type"
5761
- });
5762
- return payload;
5763
- }
5764
- payload.value = [];
5765
- const proms = [];
5766
- const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
5767
- const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
5768
- if (!def.rest) {
5769
- const tooBig = input.length > items.length;
5770
- const tooSmall = input.length < optStart - 1;
5771
- if (tooBig || tooSmall) {
5772
- payload.issues.push({
5773
- ...tooBig ? {
5774
- code: "too_big",
5775
- maximum: items.length,
5776
- inclusive: true
5777
- } : {
5778
- code: "too_small",
5779
- minimum: items.length
5780
- },
5781
- input,
5782
- inst,
5783
- origin: "array"
5784
- });
5785
- return payload;
5786
- }
5787
- }
5788
- let i$1 = -1;
5789
- for (const item of items) {
5790
- i$1++;
5791
- if (i$1 >= input.length) {
5792
- if (i$1 >= optStart) continue;
5793
- }
5794
- const result = item._zod.run({
5795
- value: input[i$1],
5796
- issues: []
5797
- }, ctx);
5798
- if (result instanceof Promise) proms.push(result.then((result$1) => handleTupleResult(result$1, payload, i$1)));
5799
- else handleTupleResult(result, payload, i$1);
5800
- }
5801
- if (def.rest) {
5802
- const rest = input.slice(items.length);
5803
- for (const el of rest) {
5804
- i$1++;
5805
- const result = def.rest._zod.run({
5806
- value: el,
5807
- issues: []
5808
- }, ctx);
5809
- if (result instanceof Promise) proms.push(result.then((result$1) => handleTupleResult(result$1, payload, i$1)));
5810
- else handleTupleResult(result, payload, i$1);
5811
- }
5812
- }
5813
- if (proms.length) return Promise.all(proms).then(() => payload);
5814
- return payload;
5815
- };
5816
- });
5817
- function handleTupleResult(result, final, index) {
5818
- if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
5819
- final.value[index] = result.value;
5820
- }
5821
5750
  const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
5822
5751
  $ZodType.init(inst, def);
5823
5752
  inst._zod.parse = (payload, ctx) => {
@@ -7200,44 +7129,6 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7200
7129
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
7201
7130
  json.allOf = [...isSimpleIntersection(a$1) ? a$1.allOf : [a$1], ...isSimpleIntersection(b$2) ? b$2.allOf : [b$2]];
7202
7131
  };
7203
- const tupleProcessor = (schema, ctx, _json, params) => {
7204
- const json = _json;
7205
- const def = schema._zod.def;
7206
- json.type = "array";
7207
- const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7208
- const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7209
- const prefixItems = def.items.map((x$2, i$1) => process$3(x$2, ctx, {
7210
- ...params,
7211
- path: [
7212
- ...params.path,
7213
- prefixPath$1,
7214
- i$1
7215
- ]
7216
- }));
7217
- const rest = def.rest ? process$3(def.rest, ctx, {
7218
- ...params,
7219
- path: [
7220
- ...params.path,
7221
- restPath,
7222
- ...ctx.target === "openapi-3.0" ? [def.items.length] : []
7223
- ]
7224
- }) : null;
7225
- if (ctx.target === "draft-2020-12") {
7226
- json.prefixItems = prefixItems;
7227
- if (rest) json.items = rest;
7228
- } else if (ctx.target === "openapi-3.0") {
7229
- json.items = { anyOf: prefixItems };
7230
- if (rest) json.items.anyOf.push(rest);
7231
- json.minItems = prefixItems.length;
7232
- if (!rest) json.maxItems = prefixItems.length;
7233
- } else {
7234
- json.items = prefixItems;
7235
- if (rest) json.additionalItems = rest;
7236
- }
7237
- const { minimum, maximum } = schema._zod.bag;
7238
- if (typeof minimum === "number") json.minItems = minimum;
7239
- if (typeof maximum === "number") json.maxItems = maximum;
7240
- };
7241
7132
  const recordProcessor = (schema, ctx, _json, params) => {
7242
7133
  const json = _json;
7243
7134
  const def = schema._zod.def;
@@ -7789,25 +7680,6 @@ function intersection(left, right) {
7789
7680
  right
7790
7681
  });
7791
7682
  }
7792
- const ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
7793
- $ZodTuple.init(inst, def);
7794
- ZodType.init(inst, def);
7795
- inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
7796
- inst.rest = (rest) => inst.clone({
7797
- ...inst._zod.def,
7798
- rest
7799
- });
7800
- });
7801
- function tuple(items, _paramsOrRest, _params) {
7802
- const hasRest = _paramsOrRest instanceof $ZodType;
7803
- const params = hasRest ? _params : _paramsOrRest;
7804
- return new ZodTuple({
7805
- type: "tuple",
7806
- items,
7807
- rest: hasRest ? _paramsOrRest : null,
7808
- ...normalizeParams(params)
7809
- });
7810
- }
7811
7683
  const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
7812
7684
  $ZodRecord.init(inst, def);
7813
7685
  ZodType.init(inst, def);
@@ -16911,14 +16783,23 @@ const entityResource = {
16911
16783
 
16912
16784
  //#endregion
16913
16785
  //#region src/core/resources/function/schema.ts
16786
+ const FunctionNameSchema = string().trim().min(1, "Function name cannot be empty").regex(/^[^.]+$/, "Function name cannot contain dots");
16787
+ const FunctionFileSchema = object({
16788
+ path: string().min(1),
16789
+ content: string()
16790
+ });
16914
16791
  const FunctionConfigSchema = object({
16915
- name: string().min(1, "Function name cannot be empty").refine((name$1) => !name$1.includes("."), "Function name cannot contain dots"),
16916
- entry: string().min(1, "Entry point cannot be empty"),
16917
- triggers: tuple([]).optional()
16792
+ name: FunctionNameSchema,
16793
+ entry: string().min(1, "Entry point cannot be empty")
16918
16794
  });
16919
16795
  const FunctionSchema = FunctionConfigSchema.extend({
16920
16796
  entryPath: string().min(1, "Entry path cannot be empty"),
16921
- files: array(string()).min(1, "Files array cannot be empty")
16797
+ files: array(string()).min(1, "Function must have at least one file")
16798
+ });
16799
+ const FunctionDeploySchema = object({
16800
+ name: FunctionNameSchema,
16801
+ entry: string().min(1),
16802
+ files: array(FunctionFileSchema).min(1, "Function must have at least one file")
16922
16803
  });
16923
16804
  const DeployFunctionsResponseSchema = object({
16924
16805
  deployed: array(string()),
@@ -17022,7 +16903,30 @@ const functionResource = {
17022
16903
 
17023
16904
  //#endregion
17024
16905
  //#region src/core/resources/agent/schema.ts
17025
- const AgentConfigSchema = looseObject({ name: string().regex(/^[a-z0-9_]+$/, "Agent name must be lowercase alphanumeric with underscores").min(1).max(100) });
16906
+ const EntityOperationSchema = _enum([
16907
+ "create",
16908
+ "update",
16909
+ "delete",
16910
+ "read"
16911
+ ]);
16912
+ const EntityToolConfigSchema = object({
16913
+ entity_name: string().min(1),
16914
+ allowed_operations: array(EntityOperationSchema)
16915
+ });
16916
+ const BackendFunctionToolConfigSchema = object({
16917
+ function_name: string().min(1),
16918
+ description: string().default("agent backend function")
16919
+ });
16920
+ const ToolConfigSchema = union([EntityToolConfigSchema, BackendFunctionToolConfigSchema]);
16921
+ const ModelSchema = string().regex(/^(default|(anthropic|gemini|openai|vertex_ai)\/.+)$/, "Model must be \"default\" or start with: anthropic/, gemini/, openai/, vertex_ai/");
16922
+ const AgentConfigSchema = looseObject({
16923
+ name: string().regex(/^[a-z0-9_]+$/, "Agent name must be lowercase alphanumeric with underscores").min(1).max(100),
16924
+ description: string().trim().min(1, "Description is required"),
16925
+ instructions: string().trim().min(1, "Instructions are required"),
16926
+ tool_configs: array(ToolConfigSchema).optional().default([]),
16927
+ whatsapp_greeting: string().nullable().optional().default(null),
16928
+ model: ModelSchema.optional().default("default")
16929
+ });
17026
16930
  const SyncAgentsResponseSchema = object({
17027
16931
  created: array(string()),
17028
16932
  updated: array(string()),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.25-pr.151.12d57cf",
3
+ "version": "0.0.25-pr.151.1ef8126",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "bin": {