@runtypelabs/cli 2.16.6 → 2.16.8

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 +678 -30
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -544,6 +544,363 @@ import { RuntypeApiError } from "@runtypelabs/sdk";
544
544
  // src/lib/sdk-client.ts
545
545
  import { createClient } from "@runtypelabs/sdk";
546
546
 
547
+ // ../shared/dist/chunk-MYXAZOFG.mjs
548
+ var travrseConfig = {
549
+ name: "Travrse",
550
+ nameLower: "travrse",
551
+ tagline: "AI ambition, meet reality",
552
+ description: "Fast-track AI implementation for every team. API for developers, dashboard for business users. From idea to production in minutes, with or without code.",
553
+ url: "https://www.travrse.ai",
554
+ website: "https://travrse.ai",
555
+ domain: "travrse.ai",
556
+ npmScope: "@travrse",
557
+ cliCommand: "travrse",
558
+ githubOrg: "travrse-io",
559
+ legalEntity: "Travrse Labs, Inc",
560
+ support: {
561
+ email: "support@travrse.ai"
562
+ },
563
+ dashboardUrl: "https://run.travrse.ai",
564
+ apiUrl: "https://api.travrse.ai",
565
+ docsUrl: "https://docs.travrse.ai"
566
+ };
567
+ var runtypeConfig = {
568
+ name: "Runtype",
569
+ nameLower: "runtype",
570
+ tagline: "Your AI Product Platform",
571
+ description: "Build and deploy AI experiences faster than ever. Powerful API for developers, intuitive dashboard for teams.",
572
+ url: "https://www.runtype.com",
573
+ website: "https://runtype.com",
574
+ domain: "runtype.com",
575
+ npmScope: "@runtypelabs",
576
+ cliCommand: "runtype",
577
+ githubOrg: "runtypelabs",
578
+ legalEntity: "Travrse Labs, Inc",
579
+ support: {
580
+ email: "support@runtype.com"
581
+ },
582
+ dashboardUrl: "https://use.runtype.com",
583
+ apiUrl: "https://api.runtype.com",
584
+ docsUrl: "https://docs.runtype.com"
585
+ };
586
+ var BRAND_CONFIGS = {
587
+ travrse: travrseConfig,
588
+ runtype: runtypeConfig
589
+ // Add more brand configs here:
590
+ // mybrand: myBrandConfig,
591
+ };
592
+ var DEFAULT_BRAND_NAME = "runtype";
593
+ function loadBrandConfig(env) {
594
+ let configName = DEFAULT_BRAND_NAME;
595
+ try {
596
+ if (env) {
597
+ configName = env.NEXT_PUBLIC_BRAND_CONFIG_NAME || env.BRAND_CONFIG_NAME || DEFAULT_BRAND_NAME;
598
+ } else {
599
+ configName = process.env.NEXT_PUBLIC_BRAND_CONFIG_NAME || process.env.BRAND_CONFIG_NAME || DEFAULT_BRAND_NAME;
600
+ }
601
+ } catch (error51) {
602
+ configName = DEFAULT_BRAND_NAME;
603
+ }
604
+ const config3 = BRAND_CONFIGS[configName];
605
+ if (!config3) {
606
+ if (process.env.NODE_ENV !== "production") {
607
+ console.warn(
608
+ `Brand config "${configName}" not found. Available configs: ${Object.keys(BRAND_CONFIGS).join(", ")}. Falling back to "${DEFAULT_BRAND_NAME}".`
609
+ );
610
+ }
611
+ return BRAND_CONFIGS[DEFAULT_BRAND_NAME];
612
+ }
613
+ return config3;
614
+ }
615
+ var BRAND = loadBrandConfig();
616
+ var DEFAULT_BRAND_CONFIG = BRAND_CONFIGS[DEFAULT_BRAND_NAME];
617
+
618
+ // ../shared/dist/chunk-3BMGMHHD.mjs
619
+ function getNestedValue(obj, path16) {
620
+ let normalizedPath = path16;
621
+ normalizedPath = normalizedPath.replace(/^\$\.?/, "");
622
+ normalizedPath = normalizedPath.replace(/\[(\d+)\]/g, ".$1");
623
+ normalizedPath = normalizedPath.replace(/\[['"]([^'"\]]+)['"]\]/g, ".$1");
624
+ normalizedPath = normalizedPath.replace(/\[([^'"\]]+)\]/g, ".$1");
625
+ normalizedPath = normalizedPath.replace(/^\./, "");
626
+ const keys = normalizedPath.split(".");
627
+ let current = obj;
628
+ for (let i = 0; i < keys.length; i++) {
629
+ const key = keys[i];
630
+ if (current === null || current === void 0 || key === void 0) {
631
+ return void 0;
632
+ }
633
+ if (Array.isArray(current)) {
634
+ if (/^\d+$/.test(key)) {
635
+ const index = parseInt(key, 10);
636
+ if (index >= 0 && index < current.length) {
637
+ current = current[index];
638
+ } else {
639
+ return void 0;
640
+ }
641
+ } else {
642
+ return void 0;
643
+ }
644
+ } else if (current && typeof current === "object") {
645
+ if (DANGEROUS_KEYS.has(key)) return void 0;
646
+ current = current[key];
647
+ } else {
648
+ return void 0;
649
+ }
650
+ }
651
+ return current;
652
+ }
653
+ var DANGEROUS_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
654
+ var TEMPLATE_EXPRESSION_PATTERN = /\{\{([^{}]+)\}\}/g;
655
+ function parseTemplateExpression(expr) {
656
+ const tokens = tokenizeFallbackExpression(expr);
657
+ if (tokens) {
658
+ return {
659
+ kind: "fallback",
660
+ operator: tokens.operator,
661
+ operands: tokens.rawOperands.map(parseOperand)
662
+ };
663
+ }
664
+ const trimmed = expr.trim();
665
+ const pipeIndex = trimmed.indexOf("|");
666
+ if (pipeIndex === -1) {
667
+ return { kind: "legacy", variable: trimmed };
668
+ }
669
+ return {
670
+ kind: "legacy",
671
+ variable: trimmed.slice(0, pipeIndex).trim(),
672
+ defaultValue: trimmed.slice(pipeIndex + 1).trim()
673
+ };
674
+ }
675
+ function tokenizeFallbackExpression(expr) {
676
+ const operands = [];
677
+ let current = "";
678
+ let quote = null;
679
+ let operator = null;
680
+ for (let i = 0; i < expr.length; i++) {
681
+ const ch = expr[i];
682
+ if (quote) {
683
+ current += ch;
684
+ if (ch === quote && countTrailingBackslashes(expr, i) % 2 === 0) {
685
+ quote = null;
686
+ }
687
+ continue;
688
+ }
689
+ if (ch === '"' || ch === "'") {
690
+ quote = ch;
691
+ current += ch;
692
+ continue;
693
+ }
694
+ if (ch === "|" && expr[i + 1] === "|") {
695
+ if (operator === "??") {
696
+ throw new Error(
697
+ `Cannot mix '||' and '??' in template expression: "${expr}". Use one operator or wrap branches in separate {{...}} blocks.`
698
+ );
699
+ }
700
+ operator = "||";
701
+ operands.push(current);
702
+ current = "";
703
+ i++;
704
+ continue;
705
+ }
706
+ if (ch === "?" && expr[i + 1] === "?") {
707
+ if (operator === "||") {
708
+ throw new Error(
709
+ `Cannot mix '||' and '??' in template expression: "${expr}". Use one operator or wrap branches in separate {{...}} blocks.`
710
+ );
711
+ }
712
+ operator = "??";
713
+ operands.push(current);
714
+ current = "";
715
+ i++;
716
+ continue;
717
+ }
718
+ current += ch;
719
+ }
720
+ if (operator === null) return null;
721
+ operands.push(current);
722
+ return { rawOperands: operands, operator };
723
+ }
724
+ function parseOperand(raw) {
725
+ const t = raw.trim();
726
+ if (t.startsWith('"') && t.endsWith('"') && t.length >= 2 || t.startsWith("'") && t.endsWith("'") && t.length >= 2) {
727
+ const inner = t.slice(1, -1);
728
+ return { kind: "literal", value: inner.replace(/\\(.)/g, "$1") };
729
+ }
730
+ if (/^-?\d+(\.\d+)?$/.test(t)) {
731
+ return { kind: "literal", value: Number(t) };
732
+ }
733
+ if (t === "true") return { kind: "literal", value: true };
734
+ if (t === "false") return { kind: "literal", value: false };
735
+ if (t === "null") return { kind: "literal", value: null };
736
+ return { kind: "path", path: t };
737
+ }
738
+ function evaluateOperand(operand, context) {
739
+ if (operand.kind === "literal") return operand.value;
740
+ return getNestedValue(context, operand.path);
741
+ }
742
+ function countTrailingBackslashes(s, i) {
743
+ let n = 0;
744
+ let j = i - 1;
745
+ while (j >= 0 && s[j] === "\\") {
746
+ n++;
747
+ j--;
748
+ }
749
+ return n;
750
+ }
751
+ function passesOperator(value, operator) {
752
+ if (operator === "||") return Boolean(value);
753
+ return value !== null && value !== void 0;
754
+ }
755
+ function stringifyValue(value) {
756
+ if (value === null || value === void 0) return "";
757
+ if (typeof value === "object") return JSON.stringify(value);
758
+ return String(value);
759
+ }
760
+ var _SimpleTemplateEngine = class _SimpleTemplateEngine2 {
761
+ substitute(template, context = {}) {
762
+ const usedVariables = [];
763
+ const usedDefaults = [];
764
+ const missingVariables = [];
765
+ const result = template.replace(_SimpleTemplateEngine2.EXPRESSION_PATTERN, (match, expr) => {
766
+ let parsed;
767
+ try {
768
+ parsed = parseTemplateExpression(expr);
769
+ } catch {
770
+ return match;
771
+ }
772
+ if (parsed.kind === "legacy") {
773
+ return resolveLegacy(parsed, context, {
774
+ usedVariables,
775
+ usedDefaults,
776
+ missingVariables,
777
+ match
778
+ });
779
+ }
780
+ return resolveFallback(parsed, context, {
781
+ usedVariables,
782
+ missingVariables,
783
+ match
784
+ });
785
+ });
786
+ return {
787
+ result,
788
+ usedVariables,
789
+ usedDefaults,
790
+ missingVariables
791
+ };
792
+ }
793
+ /**
794
+ * Extract all variable references from a template.
795
+ * Each `{{ ... }}` produces one entry; for fallback expressions the entry
796
+ * carries every path operand under `paths`, and `hasDefault: true` whenever
797
+ * the chain has any non-path terminal (literal) the user can fall back to.
798
+ */
799
+ extractVariables(template) {
800
+ const out = [];
801
+ const pattern = new RegExp(_SimpleTemplateEngine2.EXPRESSION_PATTERN.source, "g");
802
+ let match;
803
+ while (match = pattern.exec(template)) {
804
+ const expr = match[1];
805
+ if (!expr) continue;
806
+ let parsed;
807
+ try {
808
+ parsed = parseTemplateExpression(expr);
809
+ } catch {
810
+ continue;
811
+ }
812
+ if (parsed.kind === "legacy") {
813
+ if (!parsed.variable) continue;
814
+ out.push({
815
+ variable: parsed.variable,
816
+ hasDefault: parsed.defaultValue !== void 0,
817
+ defaultValue: parsed.defaultValue
818
+ });
819
+ continue;
820
+ }
821
+ const paths = parsed.operands.filter((o) => o.kind === "path").map((o) => o.path);
822
+ const hasLiteralFallback = parsed.operands.some((o) => o.kind === "literal");
823
+ const primary = paths[0] ?? "";
824
+ out.push({
825
+ variable: primary,
826
+ hasDefault: hasLiteralFallback,
827
+ paths
828
+ });
829
+ }
830
+ return out;
831
+ }
832
+ /**
833
+ * Validate that a template can be processed with given context.
834
+ * Returns warnings and errors.
835
+ */
836
+ validate(template, context = {}) {
837
+ const warnings = [];
838
+ const errors = [];
839
+ try {
840
+ const result = this.substitute(template, context);
841
+ if (result.usedDefaults.length > 0) {
842
+ warnings.push(
843
+ `Used ${result.usedDefaults.length} default values: ${result.usedDefaults.map((d) => d.variable).join(", ")}`
844
+ );
845
+ }
846
+ if (result.missingVariables.length > 0) {
847
+ errors.push(`Missing variables without defaults: ${result.missingVariables.join(", ")}`);
848
+ }
849
+ return {
850
+ isValid: errors.length === 0,
851
+ warnings,
852
+ errors
853
+ };
854
+ } catch (error51) {
855
+ return {
856
+ isValid: false,
857
+ warnings,
858
+ errors: [`Template parsing error: ${error51}`]
859
+ };
860
+ }
861
+ }
862
+ };
863
+ _SimpleTemplateEngine.EXPRESSION_PATTERN = TEMPLATE_EXPRESSION_PATTERN;
864
+ var SimpleTemplateEngine = _SimpleTemplateEngine;
865
+ function resolveLegacy(parsed, context, tracking) {
866
+ const value = getNestedValue(context, parsed.variable);
867
+ if (value !== void 0 && value !== null) {
868
+ tracking.usedVariables.push(parsed.variable);
869
+ return stringifyValue(value);
870
+ }
871
+ if (parsed.defaultValue !== void 0) {
872
+ tracking.usedDefaults.push({
873
+ variable: parsed.variable,
874
+ defaultValue: parsed.defaultValue
875
+ });
876
+ return parsed.defaultValue;
877
+ }
878
+ tracking.missingVariables.push(parsed.variable);
879
+ return tracking.match;
880
+ }
881
+ function resolveFallback(parsed, context, tracking) {
882
+ let chosen = null;
883
+ for (const operand of parsed.operands) {
884
+ const value = evaluateOperand(operand, context);
885
+ if (operand.kind === "path" && value !== void 0) {
886
+ tracking.usedVariables.push(operand.path);
887
+ }
888
+ if (chosen === null && passesOperator(value, parsed.operator)) {
889
+ chosen = { value, isPath: operand.kind === "path" };
890
+ }
891
+ }
892
+ if (chosen) return stringifyValue(chosen.value);
893
+ const last = parsed.operands[parsed.operands.length - 1];
894
+ if (last && last.kind === "literal") {
895
+ return stringifyValue(last.value);
896
+ }
897
+ for (const operand of parsed.operands) {
898
+ if (operand.kind === "path") tracking.missingVariables.push(operand.path);
899
+ }
900
+ return tracking.match;
901
+ }
902
+ var templateEngine = new SimpleTemplateEngine();
903
+
547
904
  // ../../node_modules/.pnpm/zod@4.4.2/node_modules/zod/v4/classic/external.js
548
905
  var external_exports = {};
549
906
  __export(external_exports, {
@@ -16591,6 +16948,173 @@ var promptConfigSchema = external_exports.object({
16591
16948
  mode: external_exports.string().optional()
16592
16949
  // UI mode (task, agent, etc.)
16593
16950
  });
16951
+ var conditionalConfigSchema = external_exports.object({
16952
+ condition: external_exports.string().min(1, "Condition is required"),
16953
+ trueSteps: external_exports.array(external_exports.lazy(() => contextStepSchema)),
16954
+ falseSteps: external_exports.array(external_exports.lazy(() => contextStepSchema)).optional()
16955
+ });
16956
+ var saveMemoryConfigSchema = external_exports.object({
16957
+ profileTemplate: external_exports.string().min(1, "Profile template is required"),
16958
+ contentVariable: external_exports.string().min(1, "Content variable is required"),
16959
+ sessionId: external_exports.string().nullable().optional(),
16960
+ outputVariable: external_exports.string().optional(),
16961
+ errorHandling: contextErrorHandlingConfigSchema.optional(),
16962
+ defaultValue: external_exports.any().optional()
16963
+ });
16964
+ var recallMemoryConfigSchema = external_exports.object({
16965
+ profileTemplate: external_exports.string().min(1, "Profile template is required"),
16966
+ queryTemplate: external_exports.string().min(1, "Query template is required"),
16967
+ thinkingLevel: external_exports.enum(["low", "medium", "high"]).optional(),
16968
+ responseLength: external_exports.enum(["short", "medium", "long"]).optional(),
16969
+ outputVariable: external_exports.string().min(1, "Output variable is required"),
16970
+ errorHandling: contextErrorHandlingConfigSchema.optional(),
16971
+ defaultValue: external_exports.any().optional()
16972
+ });
16973
+ var memorySummaryConfigSchema = external_exports.object({
16974
+ profileTemplate: external_exports.string().min(1, "Profile template is required"),
16975
+ sessionId: external_exports.string().nullable().optional(),
16976
+ outputVariable: external_exports.string().min(1, "Output variable is required"),
16977
+ errorHandling: contextErrorHandlingConfigSchema.optional(),
16978
+ defaultValue: external_exports.any().optional()
16979
+ });
16980
+ var sharedStepConfigSchemas = {
16981
+ "set-variable": setVariableConfigSchema,
16982
+ "send-stream": sendStreamConfigSchema,
16983
+ "fetch-github": fetchGithubConfigSchema,
16984
+ "api-call": apiCallConfigSchema,
16985
+ "execute-agent": executeAgentConfigSchema,
16986
+ "fetch-url": fetchUrlConfigSchema,
16987
+ crawl: crawlConfigSchema,
16988
+ search: searchConfigSchema,
16989
+ "send-text": sendTextConfigSchema,
16990
+ "send-event": sendEventConfigSchema,
16991
+ "store-asset": storeAssetConfigSchema,
16992
+ "generate-pdf": generatePdfConfigSchema,
16993
+ template: templateConfigSchema,
16994
+ "wait-until": waitUntilConfigSchema,
16995
+ "generate-embedding": generateEmbeddingConfigSchema,
16996
+ "vector-search": vectorSearchConfigSchema,
16997
+ "tool-call": toolCallConfigSchema,
16998
+ "store-vector": storeVectorConfigSchema,
16999
+ "upsert-record": upsertRecordConfigSchema,
17000
+ "send-email": sendEmailConfigSchema,
17001
+ "paginate-api": paginateApiConfigSchema,
17002
+ "retrieve-record": retrieveRecordConfigSchema,
17003
+ "update-record": updateRecordConfigSchema,
17004
+ "transform-data": transformDataConfigSchema,
17005
+ prompt: promptConfigSchema,
17006
+ conditional: conditionalConfigSchema,
17007
+ "save-memory": saveMemoryConfigSchema,
17008
+ "recall-memory": recallMemoryConfigSchema,
17009
+ "memory-summary": memorySummaryConfigSchema
17010
+ };
17011
+ var makeNestedStepEnvelope = (type, configSchema) => external_exports.object({
17012
+ type: external_exports.literal(type),
17013
+ config: configSchema,
17014
+ id: external_exports.string().optional(),
17015
+ name: external_exports.string().optional(),
17016
+ order: external_exports.number().optional(),
17017
+ enabled: external_exports.boolean().optional(),
17018
+ when: external_exports.string().optional()
17019
+ }).passthrough();
17020
+ var contextStepSchema = external_exports.discriminatedUnion(
17021
+ "type",
17022
+ Object.entries(sharedStepConfigSchemas).map(
17023
+ ([type, configSchema]) => makeNestedStepEnvelope(type, configSchema)
17024
+ )
17025
+ );
17026
+ var CONTEXT_STEP_TYPES = [
17027
+ "crawl",
17028
+ "fetch-url",
17029
+ "retrieve-record",
17030
+ "fetch-github",
17031
+ "api-call",
17032
+ "transform-data",
17033
+ "template",
17034
+ "conditional",
17035
+ "set-variable",
17036
+ "upsert-record",
17037
+ "send-email",
17038
+ "send-text",
17039
+ "send-event",
17040
+ "send-stream",
17041
+ "update-record",
17042
+ "search",
17043
+ "generate-embedding",
17044
+ "vector-search",
17045
+ "tool-call",
17046
+ "wait-until",
17047
+ "paginate-api",
17048
+ "store-vector",
17049
+ "execute-agent",
17050
+ "store-asset",
17051
+ "generate-pdf",
17052
+ "save-memory",
17053
+ "recall-memory",
17054
+ "memory-summary"
17055
+ ];
17056
+ var FLOW_STEP_TYPES = ["prompt", ...CONTEXT_STEP_TYPES];
17057
+ var flowStepValidationSchema = external_exports.object({
17058
+ // Optional stable client-supplied identifier. Preserved across saves so that
17059
+ // `flow_step_results.stepId` references stay valid and dashboard UI state
17060
+ // (test-step modal, deeplinks, in-flight requests) doesn't go stale after a
17061
+ // save. When omitted the server mints one.
17062
+ id: external_exports.string().min(1).max(128).regex(/^[A-Za-z0-9_\-:.]+$/, "Step id must be alphanumeric with _ - : . only").optional(),
17063
+ type: external_exports.enum(FLOW_STEP_TYPES),
17064
+ name: external_exports.string().min(1, "Step name is required"),
17065
+ order: external_exports.number().int().min(0).optional(),
17066
+ enabled: external_exports.boolean().default(true),
17067
+ when: external_exports.string().max(500).optional(),
17068
+ config: external_exports.any()
17069
+ });
17070
+ var createFlowValidationSchema = external_exports.object({
17071
+ name: external_exports.string().min(1, "Flow name is required"),
17072
+ flowSteps: external_exports.array(flowStepValidationSchema).optional(),
17073
+ // Backward compatibility: some clients still send `steps` instead of `flowSteps`.
17074
+ steps: external_exports.array(flowStepValidationSchema).optional()
17075
+ }).refine((data) => !(data.flowSteps && data.steps), {
17076
+ message: "Provide either 'flowSteps' or 'steps', not both.",
17077
+ path: ["flowSteps"]
17078
+ }).transform((data) => ({
17079
+ name: data.name,
17080
+ flowSteps: data.flowSteps ?? data.steps ?? []
17081
+ }));
17082
+ var updateFlowValidationSchema = external_exports.object({
17083
+ name: external_exports.string().min(1, "Flow name is required").optional(),
17084
+ flowSteps: external_exports.array(flowStepValidationSchema).optional()
17085
+ });
17086
+ var CAMEL_CASE_TOOL_KEYS = {
17087
+ toolIds: true,
17088
+ toolConfigs: true,
17089
+ runtimeTools: true,
17090
+ mcpServers: true,
17091
+ maxToolCalls: true,
17092
+ toolCallStrategy: true,
17093
+ parallelCalls: true,
17094
+ perToolLimits: true,
17095
+ approval: true,
17096
+ subagentConfig: true,
17097
+ codeModeConfig: true,
17098
+ toolSearch: true
17099
+ };
17100
+ var SNAKE_CASE_TOOL_KEYS = {
17101
+ tool_ids: true,
17102
+ tool_configs: true,
17103
+ runtime_tools: true,
17104
+ mcp_servers: true,
17105
+ max_tool_calls: true,
17106
+ tool_call_strategy: true,
17107
+ parallel_calls: true,
17108
+ per_tool_limits: true,
17109
+ approval: true,
17110
+ subagent_config: true,
17111
+ code_mode_config: true,
17112
+ tool_search: true
17113
+ };
17114
+ var KNOWN_TOOL_KEYS = /* @__PURE__ */ new Set([
17115
+ ...Object.keys(CAMEL_CASE_TOOL_KEYS),
17116
+ ...Object.keys(SNAKE_CASE_TOOL_KEYS)
17117
+ ]);
16594
17118
  var SERIALIZED_HELPERS_SOURCE = `
16595
17119
  // Transform helper functions (from packages/shared/src/transform-helpers.ts)
16596
17120
  const helpers = (function createHelpers() {
@@ -16860,34 +17384,6 @@ const helpers = (function createHelpers() {
16860
17384
  }
16861
17385
  })()
16862
17386
  `.trim();
16863
- var CONTEXT_STEP_TYPES = [
16864
- "crawl",
16865
- "fetch-url",
16866
- "retrieve-record",
16867
- "fetch-github",
16868
- "api-call",
16869
- "transform-data",
16870
- "template",
16871
- "conditional",
16872
- "set-variable",
16873
- "upsert-record",
16874
- "send-email",
16875
- "send-text",
16876
- "send-event",
16877
- "send-stream",
16878
- "update-record",
16879
- "search",
16880
- "generate-embedding",
16881
- "vector-search",
16882
- "tool-call",
16883
- "wait-until",
16884
- "paginate-api",
16885
- "store-vector",
16886
- "execute-agent",
16887
- "store-asset",
16888
- "generate-pdf"
16889
- ];
16890
- var FLOW_STEP_TYPES = ["prompt", ...CONTEXT_STEP_TYPES];
16891
17387
  var PROVIDER_SECRET_SPECS = [
16892
17388
  // ----- Explicit-prefix providers -----
16893
17389
  {
@@ -16930,6 +17426,15 @@ var PROVIDER_SECRET_SPECS = [
16930
17426
  matches: (m) => m.startsWith("generic-openai/") || m.startsWith("generic-openai:"),
16931
17427
  secretNames: ["GENERIC_OPENAI_API_KEY", "GENERIC_OPENAI_BASE_URL"]
16932
17428
  },
17429
+ {
17430
+ providerId: "general-compute",
17431
+ // General Compute (https://api.generalcompute.com/v1) is an OpenAI-compatible
17432
+ // host. Models are addressed only with the explicit `general-compute/` prefix
17433
+ // (e.g. `general-compute/minimax-m2.7`) so they never collide with the same
17434
+ // bare model id served by another gateway (Vercel already routes `minimax-m2.7`).
17435
+ matches: (m) => m.startsWith("general-compute/") || m.startsWith("general-compute:"),
17436
+ secretNames: ["GENERAL_COMPUTE_API_KEY"]
17437
+ },
16933
17438
  {
16934
17439
  providerId: "workers-ai",
16935
17440
  // Uses a CF platform binding, not a secret — secretNames is intentionally empty.
@@ -31165,6 +31670,87 @@ var CORE_BUILTIN_TOOLS_REGISTRY = [
31165
31670
  requiresApiKey: false,
31166
31671
  executionHint: "platform",
31167
31672
  platformKeySupport: true
31673
+ },
31674
+ // -----------------------------------------------------------------------
31675
+ // Memory tools — require agent.config.memory.enabled (resolved per turn by
31676
+ // the agent loop; absent until then, so these fail closed with
31677
+ // `memory_not_enabled`). Semantics mirror the non-destructive session API:
31678
+ // save, recall, and summary only — no destructive per-memory delete.
31679
+ // -----------------------------------------------------------------------
31680
+ {
31681
+ id: "save_memory",
31682
+ name: "Save to Memory",
31683
+ description: "Save a fact, preference, or observation to long-term memory. Use when the user tells you something worth remembering across sessions \u2014 preferences, names, decisions, rules they want enforced. Pass the information as a plain sentence. Returns { success, memoryId, type, summary }.",
31684
+ category: BuiltInToolCategory.DATA_MANAGEMENT,
31685
+ providers: [BuiltInToolProvider.MULTI],
31686
+ parametersSchema: {
31687
+ type: "object",
31688
+ properties: {
31689
+ content: {
31690
+ type: "string",
31691
+ description: 'Natural-language statement to remember. Example: "User prefers dark mode" or "Meeting with Acme is rescheduled to Friday."',
31692
+ minLength: 1
31693
+ },
31694
+ sessionId: {
31695
+ type: "string",
31696
+ description: "Optional session scope for the memory. Omit to store against the profile default."
31697
+ }
31698
+ },
31699
+ required: ["content"]
31700
+ },
31701
+ executionHint: "platform",
31702
+ requiresApiKey: false,
31703
+ platformKeySupport: false
31704
+ },
31705
+ {
31706
+ id: "recall_memory",
31707
+ name: "Recall from Memory",
31708
+ description: "Search long-term memory for information relevant to a query. Returns a synthesized answer plus scored candidate memories with IDs. Call this whenever the user refers to past conversations, prior decisions, or things you should already know. Returns { answer, count, candidates: [{ id, summary, score }] }.",
31709
+ category: BuiltInToolCategory.DATA_MANAGEMENT,
31710
+ providers: [BuiltInToolProvider.MULTI],
31711
+ parametersSchema: {
31712
+ type: "object",
31713
+ properties: {
31714
+ query: {
31715
+ type: "string",
31716
+ description: 'Natural-language query. Example: "What are the user preferences?"',
31717
+ minLength: 1
31718
+ },
31719
+ thinkingLevel: {
31720
+ type: "string",
31721
+ enum: ["low", "medium", "high"],
31722
+ description: 'Controls search breadth. Default "low" is usually sufficient; raise to "medium" or "high" for ambiguous questions.'
31723
+ },
31724
+ responseLength: {
31725
+ type: "string",
31726
+ enum: ["short", "medium", "long"],
31727
+ description: 'Controls how detailed the synthesized answer is. Default "medium"; use "short" for a quick fact lookup or "long" for a thorough recall.'
31728
+ }
31729
+ },
31730
+ required: ["query"]
31731
+ },
31732
+ executionHint: "platform",
31733
+ requiresApiKey: false,
31734
+ platformKeySupport: false
31735
+ },
31736
+ {
31737
+ id: "memory_summary",
31738
+ name: "Get Memory Summary",
31739
+ description: "Fetch a Markdown summary of what you know \u2014 key facts, recent events, active tasks, last session, and standing instructions. Useful at the start of a session to orient yourself. Returns { summary }.",
31740
+ category: BuiltInToolCategory.DATA_MANAGEMENT,
31741
+ providers: [BuiltInToolProvider.MULTI],
31742
+ parametersSchema: {
31743
+ type: "object",
31744
+ properties: {
31745
+ sessionId: {
31746
+ type: "string",
31747
+ description: "Optional session scope. When provided, the summary covers that session; omit for a profile-wide summary."
31748
+ }
31749
+ }
31750
+ },
31751
+ executionHint: "platform",
31752
+ requiresApiKey: false,
31753
+ platformKeySupport: false
31168
31754
  }
31169
31755
  ];
31170
31756
  var BUILTIN_TOOLS_REGISTRY = [
@@ -32566,6 +33152,8 @@ var DEFAULT_MODELS_FOR_NEW_ACCOUNTS = [
32566
33152
  // Mixlayer models
32567
33153
  { provider: "runtype", modelId: "qwen/qwen3.5-9b", isDefault: true },
32568
33154
  { provider: "runtype", modelId: "qwen3.5-plus", isDefault: false },
33155
+ // General Compute (platform key) - explicit provider prefix, single-provider model
33156
+ { provider: "runtype", modelId: "general-compute/minimax-m2.7", isDefault: false },
32569
33157
  // Routed models - benefit from automatic provider optimization
32570
33158
  // OpenAI models (routed via OpenAI direct, with Vercel fallback)
32571
33159
  { provider: "runtype", modelId: "gpt-5.4", isDefault: false },
@@ -33841,6 +34429,7 @@ var PLATFORM_KEY_PROVIDER_MAP = {
33841
34429
  "vertex-anthropic": false,
33842
34430
  "tinfoil": false,
33843
34431
  "generic-openai": false,
34432
+ "general-compute": true,
33844
34433
  "workers-ai": false,
33845
34434
  "mock": false
33846
34435
  };
@@ -33884,6 +34473,15 @@ var MANUAL_PROVIDER_MAP_OVERRIDES = {
33884
34473
  },
33885
34474
  "gpt-oss-120b": {
33886
34475
  "workers-ai": "@cf/openai/gpt-oss-120b"
34476
+ },
34477
+ // MiniMax M2.7: explicit provider IDs for the GC-primary / Vercel-fallback route.
34478
+ // `general-compute` is NOT in PROVIDERS_WITHOUT_PREFIX, so resolveRoutedFamily
34479
+ // prepends `general-compute/` itself — store the BARE id here to avoid a double
34480
+ // prefix (`general-compute/general-compute/...`). Vercel IS prefixless, so its
34481
+ // value is the gateway-form `minimax/minimax-m2.7` used as-is.
34482
+ "minimax-m2.7": {
34483
+ "general-compute": "minimax-m2.7",
34484
+ "vercel": "minimax/minimax-m2.7"
33887
34485
  }
33888
34486
  };
33889
34487
  var BASE_MODEL_PROVIDER_MAP = (() => {
@@ -34740,6 +35338,18 @@ var temporalConfigSchema = external_exports.object({
34740
35338
  groundNow: external_exports.boolean().optional(),
34741
35339
  timezone: external_exports.string().optional()
34742
35340
  });
35341
+ var memoryConfigSchema = external_exports.object({
35342
+ enabled: external_exports.boolean(),
35343
+ profileTemplate: external_exports.string().optional(),
35344
+ // When omitted and `enabled` is true, treated as `true` (smart default): a
35345
+ // Markdown memory summary is woven into the agent's system prompt on each
35346
+ // turn so the agent always has the user in context — without the model having
35347
+ // to call `recall_memory` first. (The summary is cached per profile so the
35348
+ // synthesis cost is paid once, not on every turn.) Set false to skip
35349
+ // injection (focused task agents that don't benefit from a profile overview).
35350
+ // Resolved via `shouldInjectMemorySummary` so the default lives in one place.
35351
+ injectSummary: external_exports.boolean().optional()
35352
+ });
34743
35353
  var agentRuntimeConfigSchema = external_exports.object({
34744
35354
  model: external_exports.string().optional(),
34745
35355
  systemPrompt: external_exports.string().optional(),
@@ -34854,7 +35464,12 @@ var agentRuntimeConfigSchema = external_exports.object({
34854
35464
  // `elapsedThresholdSeconds`). `groundNow` additionally surfaces the current
34855
35465
  // datetime in that block. `timezone` is the agent's DEFAULT IANA zone —
34856
35466
  // the layered tool/decorator resolution overrides it per-conversation.
34857
- temporal: temporalConfigSchema.optional()
35467
+ temporal: temporalConfigSchema.optional(),
35468
+ // Long-term memory (Cloudflare Agent Memory). Single-sourced as
35469
+ // `memoryConfigSchema` (below) and reused by the update-agent, dispatch
35470
+ // inline-agent, and FPO agent schemas so the four surfaces never drift —
35471
+ // mirroring how `temporalConfigSchema` is shared.
35472
+ memory: memoryConfigSchema.optional()
34858
35473
  });
34859
35474
  var SECRET_REF_PATTERN = /\{\{secret:([A-Z][A-Z0-9_]*[A-Z0-9])\}\}/g;
34860
35475
  function extractSecretReferences(template) {
@@ -35067,6 +35682,7 @@ var agentDefinitionSchema = external_exports.object({
35067
35682
  // External / managed agent configs
35068
35683
  externalConfig: agentExternalConfigSchema.optional(),
35069
35684
  claudeManagedConfig: agentClaudeManagedConfigSchema.optional(),
35685
+ memory: memoryConfigSchema.optional(),
35070
35686
  createPolicy: createPolicySchema
35071
35687
  });
35072
35688
  var agentDefinitionSchemaV2 = external_exports.object({
@@ -35277,6 +35893,18 @@ var fullProductObjectSchema = external_exports.object({
35277
35893
  }
35278
35894
  }
35279
35895
  });
35896
+ var FLAT_ADVANCED_CONFIG_KEYS = {
35897
+ loopConfig: true,
35898
+ reasoning: true,
35899
+ voice: true,
35900
+ errorHandling: true,
35901
+ artifacts: true,
35902
+ advisor: true,
35903
+ memory: true
35904
+ };
35905
+ var FLAT_ADVANCED_CONFIG_KEY_LIST = Object.keys(
35906
+ FLAT_ADVANCED_CONFIG_KEYS
35907
+ );
35280
35908
  function createIssue(severity, code, message, path16, suggestedFix) {
35281
35909
  return { code, message, path: path16, severity, ...suggestedFix ? { suggestedFix } : {} };
35282
35910
  }
@@ -36453,6 +37081,24 @@ var FLOW_STEP_TYPE_METADATA = {
36453
37081
  category: "document",
36454
37082
  isPrompt: false,
36455
37083
  configHints: "html OR markdown, filename, visibility (public|private), pdfOptions (format, landscape, margin), outputVariable"
37084
+ },
37085
+ "save-memory": {
37086
+ description: "Ingest text from a variable into a Cloudflare Agent Memory profile so future recall-memory / memory-summary steps can synthesize from it.",
37087
+ category: "integration",
37088
+ isPrompt: false,
37089
+ configHints: "profileTemplate (template), contentVariable (variable path), sessionId (optional), outputVariable (optional), errorHandling"
37090
+ },
37091
+ "recall-memory": {
37092
+ description: "Recall a synthesized natural-language answer from a Cloudflare Agent Memory profile, given a query.",
37093
+ category: "integration",
37094
+ isPrompt: false,
37095
+ configHints: "profileTemplate (template), queryTemplate (template), outputVariable, thinkingLevel (low|medium|high), responseLength (short|medium|long), errorHandling"
37096
+ },
37097
+ "memory-summary": {
37098
+ description: "Fetch a markdown summary (Key Facts / Recent Events / Active Tasks) of a Cloudflare Agent Memory profile.",
37099
+ category: "integration",
37100
+ isPrompt: false,
37101
+ configHints: "profileTemplate (template), outputVariable, sessionId (optional), errorHandling"
36456
37102
  }
36457
37103
  };
36458
37104
  var platformCatalogSchema = external_exports.object({
@@ -37063,6 +37709,7 @@ ${orthogonalLines.join("\n")}
37063
37709
  - **Speech-to-text** \u2192 \`builtin:elevenlabs-stt\`
37064
37710
  - **Emit rich content** \u2192 \`builtin:emit_artifact_markdown\`, \`builtin:emit_artifact_component\`
37065
37711
  - **Record CRUD** \u2192 \`builtin:runtype_record_upsert\`, \`builtin:runtype_record_get\`, \`builtin:runtype_record_list\`, \`builtin:runtype_record_delete\`
37712
+ - **Agent memory (persist facts and recall them across sessions)** \u2192 \`builtin:save_memory\`, \`builtin:recall_memory\`, \`builtin:memory_summary\` \u2014 the memory bundle, attached together when memory is enabled on the agent
37066
37713
  - **E-commerce checkout** \u2192 \`builtin:ucp_discover\`, \`builtin:ucp_search_catalog\`, \`builtin:ucp_create_checkout\`
37067
37714
 
37068
37715
  ### Custom MCP Servers (saved by the user)
@@ -37788,7 +38435,8 @@ var AgentInputSchema = external_exports.object({
37788
38435
  advisor: external_exports.object({
37789
38436
  model: external_exports.string(),
37790
38437
  systemPrompt: external_exports.string().optional()
37791
- }).optional().nullable()
38438
+ }).optional().nullable(),
38439
+ memory: memoryConfigSchema.optional()
37792
38440
  });
37793
38441
  var TextContentPartSchema = external_exports.object({
37794
38442
  type: external_exports.literal("text"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.16.6",
3
+ "version": "2.16.8",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "rosie-skills": "0.8.1",
23
23
  "yaml": "^2.9.0",
24
24
  "@runtypelabs/ink-components": "0.3.2",
25
- "@runtypelabs/sdk": "4.0.4",
25
+ "@runtypelabs/sdk": "4.2.0",
26
26
  "@runtypelabs/terminal-animations": "0.2.1"
27
27
  },
28
28
  "devDependencies": {
@@ -36,7 +36,7 @@
36
36
  "tsx": "^4.7.1",
37
37
  "typescript": "^5.3.3",
38
38
  "vitest": "^4.1.0",
39
- "@runtypelabs/shared": "1.10.2"
39
+ "@runtypelabs/shared": "1.13.2"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=22.0.0"