@superblocksteam/vite-plugin-file-sync 2.0.43-next.14 → 2.0.43-next.15

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 (138) hide show
  1. package/dist/ai-service/agent/subagents/apis/api-executor.d.ts +57 -0
  2. package/dist/ai-service/agent/subagents/apis/api-executor.d.ts.map +1 -0
  3. package/dist/ai-service/agent/subagents/apis/api-executor.js +284 -0
  4. package/dist/ai-service/agent/subagents/apis/api-executor.js.map +1 -0
  5. package/dist/ai-service/agent/subagents/apis/context.d.ts +12 -0
  6. package/dist/ai-service/agent/subagents/apis/context.d.ts.map +1 -0
  7. package/dist/ai-service/agent/subagents/apis/context.js +18 -0
  8. package/dist/ai-service/agent/subagents/apis/context.js.map +1 -0
  9. package/dist/ai-service/agent/subagents/apis/generate-api-source.d.ts +37 -31
  10. package/dist/ai-service/agent/subagents/apis/generate-api-source.d.ts.map +1 -1
  11. package/dist/ai-service/agent/subagents/apis/generate-api-source.js +106 -250
  12. package/dist/ai-service/agent/subagents/apis/generate-api-source.js.map +1 -1
  13. package/dist/ai-service/agent/subagents/apis/state.d.ts +40 -0
  14. package/dist/ai-service/agent/subagents/apis/state.d.ts.map +1 -0
  15. package/dist/ai-service/agent/subagents/apis/state.js +25 -0
  16. package/dist/ai-service/agent/subagents/apis/state.js.map +1 -0
  17. package/dist/ai-service/agent/subagents/apis/types.d.ts +5 -0
  18. package/dist/ai-service/agent/subagents/apis/types.d.ts.map +1 -0
  19. package/dist/ai-service/agent/subagents/apis/types.js +2 -0
  20. package/dist/ai-service/agent/subagents/apis/types.js.map +1 -0
  21. package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
  22. package/dist/ai-service/agent/tool-message-utils.js +8 -24
  23. package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
  24. package/dist/ai-service/agent/tools/apis/build-api.d.ts +20 -0
  25. package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -0
  26. package/dist/ai-service/agent/tools/apis/build-api.js +168 -0
  27. package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -0
  28. package/dist/ai-service/agent/tools/apis/finalize-api.d.ts +15 -0
  29. package/dist/ai-service/agent/tools/apis/finalize-api.d.ts.map +1 -0
  30. package/dist/ai-service/agent/tools/apis/finalize-api.js +103 -0
  31. package/dist/ai-service/agent/tools/apis/finalize-api.js.map +1 -0
  32. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +1 -1
  33. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
  34. package/dist/ai-service/agent/tools/integrations/index.d.ts +1 -1
  35. package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
  36. package/dist/ai-service/agent/tools/integrations/index.js +1 -1
  37. package/dist/ai-service/agent/tools/integrations/index.js.map +1 -1
  38. package/dist/ai-service/agent/tools/integrations/internal.d.ts +1 -1
  39. package/dist/ai-service/agent/tools/integrations/internal.d.ts.map +1 -1
  40. package/dist/ai-service/agent/tools/integrations/internal.js +12 -1
  41. package/dist/ai-service/agent/tools/integrations/internal.js.map +1 -1
  42. package/dist/ai-service/agent/tools/integrations/metadata.d.ts +1 -1
  43. package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
  44. package/dist/ai-service/agent/tools/integrations/metadata.js +1 -1
  45. package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
  46. package/dist/ai-service/agent/tools/integrations/run-code.d.ts +1 -1
  47. package/dist/ai-service/agent/tools/integrations/run-code.d.ts.map +1 -1
  48. package/dist/ai-service/agent/tools/study-current-app-state.d.ts +1 -0
  49. package/dist/ai-service/agent/tools/study-current-app-state.d.ts.map +1 -1
  50. package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -1
  51. package/dist/ai-service/agent/tools2/access-control.js +5 -2
  52. package/dist/ai-service/agent/tools2/access-control.js.map +1 -1
  53. package/dist/ai-service/agent/tools2/registry.d.ts +2 -1
  54. package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
  55. package/dist/ai-service/agent/tools2/registry.js +4 -4
  56. package/dist/ai-service/agent/tools2/registry.js.map +1 -1
  57. package/dist/ai-service/agent/tools2/types.d.ts +5 -3
  58. package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
  59. package/dist/ai-service/agent/tools2/types.js +1 -0
  60. package/dist/ai-service/agent/tools2/types.js.map +1 -1
  61. package/dist/ai-service/agent/utils.d.ts +1 -0
  62. package/dist/ai-service/agent/utils.d.ts.map +1 -1
  63. package/dist/ai-service/agent/utils.js +1 -0
  64. package/dist/ai-service/agent/utils.js.map +1 -1
  65. package/dist/ai-service/integrations/metadata/database.d.ts.map +1 -1
  66. package/dist/ai-service/integrations/metadata/database.js +61 -20
  67. package/dist/ai-service/integrations/metadata/database.js.map +1 -1
  68. package/dist/ai-service/integrations/metadata/databricks.d.ts.map +1 -1
  69. package/dist/ai-service/integrations/metadata/databricks.js +5 -5
  70. package/dist/ai-service/integrations/metadata/databricks.js.map +1 -1
  71. package/dist/ai-service/integrations/metadata/graphql-based.d.ts +2 -0
  72. package/dist/ai-service/integrations/metadata/graphql-based.d.ts.map +1 -1
  73. package/dist/ai-service/integrations/metadata/graphql-based.js +95 -14
  74. package/dist/ai-service/integrations/metadata/graphql-based.js.map +1 -1
  75. package/dist/ai-service/integrations/metadata/llm-utils.d.ts +24 -0
  76. package/dist/ai-service/integrations/metadata/llm-utils.d.ts.map +1 -0
  77. package/dist/ai-service/integrations/metadata/llm-utils.js +45 -0
  78. package/dist/ai-service/integrations/metadata/llm-utils.js.map +1 -0
  79. package/dist/ai-service/integrations/store.d.ts +5 -5
  80. package/dist/ai-service/integrations/store.d.ts.map +1 -1
  81. package/dist/ai-service/integrations/store.js +52 -53
  82. package/dist/ai-service/integrations/store.js.map +1 -1
  83. package/dist/ai-service/llm/context/context.d.ts.map +1 -1
  84. package/dist/ai-service/llm/context/context.js +2 -2
  85. package/dist/ai-service/llm/context/context.js.map +1 -1
  86. package/dist/ai-service/llm/context/manager.d.ts.map +1 -1
  87. package/dist/ai-service/llm/context/manager.js +2 -2
  88. package/dist/ai-service/llm/context/manager.js.map +1 -1
  89. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ButtonPropsDocs.js +1 -1
  90. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/CheckboxPropsDocs.js +1 -1
  91. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ColumnPropsDocs.js +1 -1
  92. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ContainerPropsDocs.js +1 -1
  93. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/DatePickerPropsDocs.js +1 -1
  94. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/DropdownPropsDocs.js +1 -1
  95. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/IconPropsDocs.js +1 -1
  96. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ImagePropsDocs.js +1 -1
  97. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/InputPropsDocs.js +1 -1
  98. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ModalPropsDocs.js +1 -1
  99. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/PagePropsDocs.js +1 -1
  100. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SectionPropsDocs.js +1 -1
  101. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SlideoutPropsDocs.js +1 -1
  102. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SwitchPropsDocs.js +1 -1
  103. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/TablePropsDocs.js +1 -1
  104. package/dist/ai-service/prompt-builder-service/static-fragments/library-components/TextPropsDocs.js +1 -1
  105. package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/Dim.js +1 -1
  106. package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/EventFlow.js +1 -1
  107. package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/TextStyleWithVariant.js +1 -1
  108. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/full-examples.js +1 -1
  109. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-api.js +1 -1
  110. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-components-rules.js +1 -1
  111. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-custom-components.js +1 -1
  112. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-data-filtering.js +1 -1
  113. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-event-flow.js +1 -1
  114. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-forms.js +1 -1
  115. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-layouts.js +1 -1
  116. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-page.js +1 -1
  117. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-rbac.js +1 -1
  118. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-routes.js +1 -1
  119. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-state.js +1 -1
  120. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-theming-chakra-new.js +1 -1
  121. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/system-base.js +1 -1
  122. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/system-incremental.js +1 -1
  123. package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/system-specific-edit.js +1 -1
  124. package/dist/ai-service/state-machine/clark-fsm.d.ts +2 -0
  125. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  126. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  127. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  128. package/dist/ai-service/state-machine/handlers/llm-generating.js +12 -2
  129. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  130. package/dist/util/logger.d.ts +13 -0
  131. package/dist/util/logger.d.ts.map +1 -1
  132. package/dist/util/logger.js +21 -0
  133. package/dist/util/logger.js.map +1 -1
  134. package/package.json +8 -7
  135. package/dist/ai-service/llm/context/logger.d.ts +0 -17
  136. package/dist/ai-service/llm/context/logger.d.ts.map +0 -1
  137. package/dist/ai-service/llm/context/logger.js +0 -26
  138. package/dist/ai-service/llm/context/logger.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ /**
2
+ * API Executor Service - Handles API execution with enhanced error handling.
3
+ *
4
+ * This service provides a wrapper around aiExecuteV2Api with proto validation
5
+ * and comprehensive error reporting for the AI model.
6
+ */
7
+ import type { IntegrationStore } from "../../../integrations/store.js";
8
+ import type { EditorClient } from "../../../types.js";
9
+ import type { Api } from "@superblocksteam/library-shared/types";
10
+ export interface ApiExecutionResult {
11
+ success: boolean;
12
+ outputs?: Record<string, any>;
13
+ error?: string;
14
+ errorDetails?: {
15
+ type: "validation" | "execution" | "proto" | "unknown";
16
+ message: string;
17
+ suggestion?: string;
18
+ originalError?: any;
19
+ };
20
+ executionTime?: number;
21
+ }
22
+ export type ApiExecutionInputs = Record<string, any>;
23
+ export declare class ApiExecutor {
24
+ private editorClient;
25
+ private integrationStore;
26
+ constructor(editorClient: EditorClient, integrationStore: IntegrationStore);
27
+ /**
28
+ * Execute an API with comprehensive error handling.
29
+ *
30
+ * @param api - The API definition to execute
31
+ * @param inputs - Input variables for the API
32
+ * @returns Execution result with outputs or detailed error information
33
+ */
34
+ execute(api: Api, inputs?: ApiExecutionInputs): Promise<ApiExecutionResult>;
35
+ /**
36
+ * Validate that the API can roundtrip through protobuf.
37
+ * Throws an error if validation fails.
38
+ */
39
+ private validateProtoCompatibility;
40
+ /**
41
+ * Validate that blocks use the correct plugin field name matching the integration's plugin.id.
42
+ */
43
+ private validateBlockFieldNames;
44
+ /**
45
+ * Parse execution errors to provide helpful details.
46
+ */
47
+ private parseExecutionError;
48
+ /**
49
+ * Get suggestion for proto errors.
50
+ */
51
+ private getProtoErrorSuggestion;
52
+ /**
53
+ * Get suggestion for validation errors.
54
+ */
55
+ private getValidationErrorSuggestion;
56
+ }
57
+ //# sourceMappingURL=api-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-executor.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/api-executor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uCAAuC,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;QACvD,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,GAAG,CAAC;KACrB,CAAC;IACF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAErD,qBAAa,WAAW;IACtB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB;IAK1E;;;;;;OAMG;IAEG,OAAO,CACX,GAAG,EAAE,GAAG,EACR,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,kBAAkB,CAAC;IAuF9B;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAkClC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAkD/B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAqD3B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAa/B;;OAEG;IACH,OAAO,CAAC,4BAA4B;CASrC"}
@@ -0,0 +1,284 @@
1
+ /**
2
+ * API Executor Service - Handles API execution with enhanced error handling.
3
+ *
4
+ * This service provides a wrapper around aiExecuteV2Api with proto validation
5
+ * and comprehensive error reporting for the AI model.
6
+ */
7
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
8
+ var useValue = arguments.length > 2;
9
+ for (var i = 0; i < initializers.length; i++) {
10
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
11
+ }
12
+ return useValue ? value : void 0;
13
+ };
14
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
15
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
16
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
17
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
18
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
19
+ var _, done = false;
20
+ for (var i = decorators.length - 1; i >= 0; i--) {
21
+ var context = {};
22
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
23
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
24
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
25
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
26
+ if (kind === "accessor") {
27
+ if (result === void 0) continue;
28
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
29
+ if (_ = accept(result.get)) descriptor.get = _;
30
+ if (_ = accept(result.set)) descriptor.set = _;
31
+ if (_ = accept(result.init)) initializers.unshift(_);
32
+ }
33
+ else if (_ = accept(result)) {
34
+ if (kind === "field") initializers.unshift(_);
35
+ else descriptor[key] = _;
36
+ }
37
+ }
38
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
39
+ done = true;
40
+ };
41
+ import { Api as ProtoApi } from "@superblocksteam/types";
42
+ import { getLogger, getErrorMeta } from "../../../../util/logger.js";
43
+ import llmobs from "../../../llmobs/index.js";
44
+ import { safeJsonStringify } from "../../../util/safe-stringify.js";
45
+ let ApiExecutor = (() => {
46
+ let _instanceExtraInitializers = [];
47
+ let _execute_decorators;
48
+ return class ApiExecutor {
49
+ static {
50
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
51
+ _execute_decorators = [llmobs.decorate({ name: "ApiExecutor.execute", kind: "task" })];
52
+ __esDecorate(this, null, _execute_decorators, { kind: "method", name: "execute", static: false, private: false, access: { has: obj => "execute" in obj, get: obj => obj.execute }, metadata: _metadata }, null, _instanceExtraInitializers);
53
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
54
+ }
55
+ editorClient = __runInitializers(this, _instanceExtraInitializers);
56
+ integrationStore;
57
+ constructor(editorClient, integrationStore) {
58
+ this.editorClient = editorClient;
59
+ this.integrationStore = integrationStore;
60
+ }
61
+ /**
62
+ * Execute an API with comprehensive error handling.
63
+ *
64
+ * @param api - The API definition to execute
65
+ * @param inputs - Input variables for the API
66
+ * @returns Execution result with outputs or detailed error information
67
+ */
68
+ async execute(api, inputs = {}) {
69
+ const logger = getLogger();
70
+ const startTime = Date.now();
71
+ try {
72
+ // Validate proto compatibility before execution
73
+ this.validateProtoCompatibility(api);
74
+ logger.info(`Executing API ${api.metadata.name}:\n${safeJsonStringify(api, 2)}`);
75
+ // Step 3: Execute via aiExecuteV2Api
76
+ const result = await this.editorClient.call.aiExecuteV2Api({
77
+ api,
78
+ inputs,
79
+ });
80
+ // Step 4: Handle execution result
81
+ if (result.error) {
82
+ // Parse error for helpful details
83
+ const errorDetails = this.parseExecutionError(result.error);
84
+ return {
85
+ success: false,
86
+ error: result.error,
87
+ errorDetails,
88
+ executionTime: Date.now() - startTime,
89
+ };
90
+ }
91
+ return {
92
+ success: true,
93
+ outputs: result.outputs || {},
94
+ executionTime: Date.now() - startTime,
95
+ };
96
+ }
97
+ catch (error) {
98
+ logger.error(`API execution failed for ${api.metadata.name}:`, getErrorMeta(error));
99
+ // Handle different error types
100
+ if (error instanceof Error) {
101
+ if (error.message.includes("Proto")) {
102
+ return {
103
+ success: false,
104
+ error: error.message,
105
+ errorDetails: {
106
+ type: "proto",
107
+ message: error.message,
108
+ suggestion: this.getProtoErrorSuggestion(error.message),
109
+ originalError: error,
110
+ },
111
+ executionTime: Date.now() - startTime,
112
+ };
113
+ }
114
+ if (error.message.includes("ValidationError")) {
115
+ return {
116
+ success: false,
117
+ error: error.message,
118
+ errorDetails: {
119
+ type: "validation",
120
+ message: error.message,
121
+ suggestion: this.getValidationErrorSuggestion(error.message),
122
+ originalError: error,
123
+ },
124
+ executionTime: Date.now() - startTime,
125
+ };
126
+ }
127
+ }
128
+ // Generic error
129
+ return {
130
+ success: false,
131
+ error: error instanceof Error ? error.message : String(error),
132
+ errorDetails: {
133
+ type: "unknown",
134
+ message: error instanceof Error ? error.message : String(error),
135
+ originalError: error,
136
+ },
137
+ executionTime: Date.now() - startTime,
138
+ };
139
+ }
140
+ }
141
+ /**
142
+ * Validate that the API can roundtrip through protobuf.
143
+ * Throws an error if validation fails.
144
+ */
145
+ validateProtoCompatibility(api) {
146
+ const logger = getLogger();
147
+ // Check for incorrect generic field names
148
+ this.validateBlockFieldNames(api);
149
+ try {
150
+ // Convert to proto and back
151
+ const proto = ProtoApi.fromJson(api);
152
+ const roundtripped = proto.toJson();
153
+ // Basic validation that critical fields survived
154
+ if (!roundtripped.metadata?.name) {
155
+ throw new Error("Critical metadata fields lost in proto conversion");
156
+ }
157
+ logger.debug(`Proto validation passed for API ${api.metadata.name}`);
158
+ }
159
+ catch (error) {
160
+ const message = error instanceof Error ? error.message : String(error);
161
+ logger.error(`Proto validation failed for API ${api.metadata.name}: ${message}`);
162
+ throw new Error(`Proto validation failed: ${message}\n` +
163
+ `Common issues:\n` +
164
+ `- Boolean fields: Omit false values instead of including them\n` +
165
+ `- Enum values: Use exact string values from the schema\n` +
166
+ `- Required fields: Ensure all required fields are present\n` +
167
+ `- Field types: Ensure values match expected types`);
168
+ }
169
+ }
170
+ /**
171
+ * Validate that blocks use the correct plugin field name matching the integration's plugin.id.
172
+ */
173
+ validateBlockFieldNames(api) {
174
+ const logger = getLogger();
175
+ for (const block of api.blocks || []) {
176
+ if (!block.step)
177
+ continue;
178
+ const integrationId = block.step.integration;
179
+ if (!integrationId)
180
+ continue;
181
+ // Skip built-in plugins that don't have integrations in the store
182
+ if (integrationId === "javascript" || integrationId === "python") {
183
+ continue;
184
+ }
185
+ // Get the integration header to find the actual plugin type
186
+ const integrationHeader = this.integrationStore.getHeader(integrationId);
187
+ if (!integrationHeader) {
188
+ logger.warn(`Integration "${integrationId}" not found in store for block "${block.name}"`);
189
+ continue;
190
+ }
191
+ const expectedPluginId = integrationHeader.plugin.id;
192
+ // Check if the correct field name is used
193
+ if (!(expectedPluginId in block.step)) {
194
+ // Find what field they're actually using
195
+ const usedFields = Object.keys(block.step).filter((key) => key !== "integration" &&
196
+ typeof block.step[key] === "object");
197
+ throw new Error(`Block "${block.name}" uses incorrect field name. ` +
198
+ `The field name must match the integration's plugin ID.\n\n` +
199
+ `Expected field name: "${expectedPluginId}"\n` +
200
+ (usedFields.length > 0
201
+ ? `Used field name: "${usedFields[0]}"\n\n`
202
+ : `No plugin configuration field found\n\n`) +
203
+ `The integration "${integrationId}" is of type "${expectedPluginId}", ` +
204
+ `so your step configuration must use:\n` +
205
+ `${expectedPluginId}: { ... }\n\n` +
206
+ `This ensures proper routing and validation of your API calls.`);
207
+ }
208
+ }
209
+ }
210
+ /**
211
+ * Parse execution errors to provide helpful details.
212
+ */
213
+ parseExecutionError(errorMessage) {
214
+ // Check for common error patterns
215
+ if (errorMessage.includes("ReferenceError")) {
216
+ const match = errorMessage.match(/ReferenceError: (\w+) is not defined/);
217
+ const variable = match?.[1];
218
+ return {
219
+ type: "execution",
220
+ message: errorMessage,
221
+ suggestion: variable
222
+ ? `Variable "${variable}" is not defined. If this is in a Variables block, remember that values are JavaScript expressions - strings must be quoted like '"${variable}"'`
223
+ : "Check that all variables are properly defined and string values in Variables blocks are quoted",
224
+ };
225
+ }
226
+ if (errorMessage.includes("Integration") &&
227
+ errorMessage.includes("not found")) {
228
+ return {
229
+ type: "validation",
230
+ message: errorMessage,
231
+ suggestion: "Check that the integration ID exists and is accessible. Use listIntegrations to see available integrations.",
232
+ };
233
+ }
234
+ if (errorMessage.includes("UUID")) {
235
+ return {
236
+ type: "validation",
237
+ message: errorMessage,
238
+ suggestion: 'Organization ID must be a valid UUID. Use "00000000-0000-0000-0000-000000000000" for testing.',
239
+ };
240
+ }
241
+ if (errorMessage.includes("type must not be in list [0]")) {
242
+ return {
243
+ type: "validation",
244
+ message: errorMessage,
245
+ suggestion: "Variables block 'type' field must be a non-zero value. Use 1 for TYPE_SIMPLE.",
246
+ };
247
+ }
248
+ // Generic execution error
249
+ return {
250
+ type: "execution",
251
+ message: errorMessage,
252
+ };
253
+ }
254
+ /**
255
+ * Get suggestion for proto errors.
256
+ */
257
+ getProtoErrorSuggestion(errorMessage) {
258
+ if (errorMessage.includes("boolean")) {
259
+ return "Omit boolean fields that are false. Only include them when true.";
260
+ }
261
+ if (errorMessage.includes("enum")) {
262
+ return "Check that enum values use the exact string constants from the schema.";
263
+ }
264
+ if (errorMessage.includes("required")) {
265
+ return "Ensure all required fields are present: metadata.id, metadata.name, metadata.organization";
266
+ }
267
+ return "Review the API structure against the schema. Common issues: false booleans should be omitted, enums need exact values.";
268
+ }
269
+ /**
270
+ * Get suggestion for validation errors.
271
+ */
272
+ getValidationErrorSuggestion(errorMessage) {
273
+ if (errorMessage.includes("integration")) {
274
+ return "Check that all integration IDs referenced in blocks actually exist";
275
+ }
276
+ if (errorMessage.includes("Variables")) {
277
+ return "Variables block values are JavaScript expressions - strings need quotes";
278
+ }
279
+ return "Review the API against the validation requirements";
280
+ }
281
+ };
282
+ })();
283
+ export { ApiExecutor };
284
+ //# sourceMappingURL=api-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-executor.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/api-executor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,GAAG,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;IAoBvD,WAAW;;;iBAAX,WAAW;;;mCAgBrB,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;YAC/D,wKAAM,OAAO,6DAwFZ;;;QAxGO,YAAY,GADT,mDAAW,CACa;QAC3B,gBAAgB,CAAmB;QAE3C,YAAY,YAA0B,EAAE,gBAAkC;YACxE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;YACjC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAC3C,CAAC;QAED;;;;;;WAMG;QAEH,KAAK,CAAC,OAAO,CACX,GAAQ,EACR,SAA6B,EAAE;YAE/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;YAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAE7B,IAAI,CAAC;gBACH,gDAAgD;gBAChD,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC;gBAErC,MAAM,CAAC,IAAI,CACT,iBAAiB,GAAG,CAAC,QAAQ,CA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AC,YAAoB;YACvD,IAAI,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,OAAO,oEAAoE,CAAC;YAC9E,CAAC;YACD,IAAI,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;gBACvC,OAAO,yEAAyE,CAAC;YACnF,CAAC;YACD,OAAO,oDAAoD,CAAC;QAC9D,CAAC;;;SAzRU,WAAW"}
@@ -0,0 +1,12 @@
1
+ import type { ApiIdentifier } from "./types.js";
2
+ /**
3
+ * Context for API generation tasks.
4
+ *
5
+ * This context gets passed into tool calls made by the subagent
6
+ */
7
+ export declare class ApiGenerationContext {
8
+ id: ApiIdentifier;
9
+ constructor(id: ApiIdentifier);
10
+ static from(input: unknown): ApiGenerationContext | null;
11
+ }
12
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,qBAAa,oBAAoB;IAC/B,EAAE,EAAE,aAAa,CAAC;gBAEN,EAAE,EAAE,aAAa;IAI7B,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,GAAG,IAAI;CAMzD"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Context for API generation tasks.
3
+ *
4
+ * This context gets passed into tool calls made by the subagent
5
+ */
6
+ export class ApiGenerationContext {
7
+ id;
8
+ constructor(id) {
9
+ this.id = id;
10
+ }
11
+ static from(input) {
12
+ if (input instanceof ApiGenerationContext) {
13
+ return input;
14
+ }
15
+ return null;
16
+ }
17
+ }
18
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/context.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IAC/B,EAAE,CAAgB;IAElB,YAAY,EAAiB;QAC3B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,KAAc;QACxB,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;YAC1C,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -1,18 +1,10 @@
1
1
  import type { OperationQueue } from "../../../../util/operation-queue.js";
2
2
  import type { Clark, ClarkStateHandlerParams } from "../../../state-machine/clark-fsm.js";
3
- import type { FileArtifact } from "../../../types.js";
4
- import type { PromptContext, PromptContextIntegration } from "@superblocksteam/library-shared/types";
5
- export declare const buildApiTools: (input: {
6
- apiName: string;
7
- pageName: string;
8
- prompt: string;
9
- }, isNewApi: boolean, promptContext: PromptContext | undefined, clark: Clark, services: ClarkStateHandlerParams, scopeUpdateQueue: OperationQueue, onFinalized: (message: string) => void) => {
10
- readIntegrationMetadata: import("ai").Tool<{
11
- integrationId: string;
12
- }, Record<string, any>>;
13
- fetchIntegration: import("ai").Tool<{
14
- integrationId: string;
15
- }, PromptContextIntegration | undefined>;
3
+ export declare const buildApiTools: (clark: Clark, services: ClarkStateHandlerParams, scopeUpdateQueue: OperationQueue) => {
4
+ readIntegrationMetadata: import("./../../tools2/types.js").Tool<{
5
+ integrationIds: string[];
6
+ prompt: string;
7
+ }, string>;
16
8
  searchIntegrations: import("./../../tools2/types.js").Tool<{
17
9
  type?: import("@superblocksteam/shared").PluginType;
18
10
  name?: string;
@@ -40,44 +32,58 @@ export declare const buildApiTools: (input: {
40
32
  type: "other";
41
33
  body: string;
42
34
  };
43
- }, string | undefined>;
44
- buildApi: import("ai").Tool<{
45
- apiName: string;
35
+ }, string>;
36
+ buildApi: import("./../../tools2/types.js").Tool<{
37
+ id: {
38
+ pageName: string;
39
+ apiName: string;
40
+ };
46
41
  apiSource: string;
47
42
  }, {
48
43
  message: string;
49
44
  apiName: string;
50
45
  pageName: string;
51
- }>;
52
- finalizeApi: import("ai").Tool<{
46
+ } | {
47
+ execution: {
48
+ message: string;
49
+ outputs: string;
50
+ };
51
+ message: string;
53
52
  apiName: string;
53
+ pageName: string;
54
+ }>;
55
+ finalizeApi: import("./../../tools2/types.js").Tool<{
56
+ id: {
57
+ pageName: string;
58
+ apiName: string;
59
+ };
54
60
  summary: string;
55
61
  responseInterface: string;
56
62
  inputInterface: string;
57
63
  givingUpDueToFatalError?: boolean | undefined;
58
64
  }, {
59
- message: string;
60
- apiName: string;
61
65
  pageName: string;
66
+ apiName: string;
67
+ message: string;
62
68
  }>;
63
69
  };
64
- export declare const readApiSource: (pageName: string, apiName: string, pageEntityNames: string[] | undefined, services: ClarkStateHandlerParams) => Promise<FileArtifact | undefined>;
70
+ export declare const readApiSource: (pageName: string, apiName: string, pageEntityNames: string[] | undefined, services: ClarkStateHandlerParams) => Promise<import("../../../types.js").FileArtifact | undefined>;
65
71
  export declare const generateApiSourceSubagentToolFactory: import("./../../tools2/types.js").ToolFactory<import("./../../tools2/types.js").Tool<{
72
+ id: {
73
+ pageName: string;
74
+ apiName: string;
75
+ };
66
76
  action: "create" | "edit";
67
- pageName: string;
68
- apiName: string;
69
77
  prompt: string;
70
78
  exampleHints?: ("databricks" | "snowflake" | "validation" | "conditional" | "loop" | "trycatch" | "nested-control-flow" | "scope-access" | "variable-access" | "error-handling" | "data-transformation" | "batch-processing" | "global-context" | "multi-integration" | "data-science" | "sql-query" | "aggregation" | "error-scope-violation" | "error-execution-order")[] | undefined;
71
79
  }, {
80
+ isNewApi: boolean;
81
+ } & {
82
+ status: "finalized";
72
83
  message: string;
73
- apiName: string;
74
- pageName: string;
75
- apiData: {
76
- apiName: string;
77
- summary: string;
78
- responseInterface: string;
79
- inputInterface: string;
80
- givingUpDueToFatalError?: boolean | undefined;
84
+ interface: {
85
+ input: string;
86
+ output: string;
81
87
  };
82
88
  }>>;
83
89
  //# sourceMappingURL=generate-api-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate-api-source.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/generate-api-source.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EACV,KAAK,EACL,uBAAuB,EACxB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EAIzB,MAAM,uCAAuC,CAAC;AAE/C,eAAO,MAAM,aAAa,GACxB,OAAO;IACL,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,EACD,UAAU,OAAO,EACjB,eAAe,aAAa,GAAG,SAAS,EACxC,OAAO,KAAK,EACZ,UAAU,uBAAuB,EACjC,kBAAkB,cAAc,EAEhC,aAAa,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;yBAmDJ,CAAC;uBAErB,CAAC;;;;;;uBAUS,CAAC;2BACyB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;CA6KpD,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,UAAU,MAAM,EAChB,SAAS,MAAM,EACf,iBAAiB,MAAM,EAAE,GAAG,SAAS,EACrC,UAAU,uBAAuB,sCA0ClC,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;GA6fhD,CAAC"}
1
+ {"version":3,"file":"generate-api-source.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/generate-api-source.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EACV,KAAK,EACL,uBAAuB,EACxB,MAAM,qCAAqC,CAAC;AAS7C,eAAO,MAAM,aAAa,GACxB,OAAO,KAAK,EACZ,UAAU,uBAAuB,EACjC,kBAAkB,cAAc;;;;;;;;;;;;;;;;;;yBAiFW,CAAC;uBAGX,CAAC;;;;;;uBAEvB,CAAC;2BAAsD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAnEnE,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,UAAU,MAAM,EAChB,SAAS,MAAM,EACf,iBAAiB,MAAM,EAAE,GAAG,SAAS,EACrC,UAAU,uBAAuB,kEA0ClC,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;GAshBhD,CAAC"}