@superblocksteam/vite-plugin-file-sync 2.0.105 → 2.0.106-next.0
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/ai-service/agent/middleware.d.ts.map +1 -1
- package/dist/ai-service/agent/middleware.js +33 -0
- package/dist/ai-service/agent/middleware.js.map +1 -1
- package/dist/ai-service/agent/prompts/api-prompts.d.ts +3 -3
- package/dist/ai-service/agent/prompts/api-prompts.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/api-prompts.js +256 -62
- package/dist/ai-service/agent/prompts/api-prompts.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +17 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +3 -0
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/analysis.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/analysis.js +7 -1
- package/dist/ai-service/agent/tools/apis/analysis.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-testing-state.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-testing-state.js +1 -2
- package/dist/ai-service/agent/tools/apis/api-testing-state.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/sdk-registry.d.ts +11 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/sdk-registry.js +41 -1
- package/dist/ai-service/agent/tools/apis/sdk-registry.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.js +49 -4
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.js +11 -13
- package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.js +22 -2
- package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.js +12 -0
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/index.d.ts +1 -0
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +1 -0
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +9 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.js +66 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/index.d.ts +1 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/index.js +1 -0
- package/dist/ai-service/agent/tools/integrations/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts +86 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.js +353 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.js.map +1 -0
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +19 -2
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.js +5 -2
- package/dist/ai-service/agent/tools2/access-control.js.map +1 -1
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/registry.js +7 -4
- package/dist/ai-service/agent/tools2/registry.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +2 -2
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts +18 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js +82 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +0 -8
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js +5 -6
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -1
- package/dist/ai-service/agent/tools2/types.d.ts +13 -1
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/types.js +12 -0
- package/dist/ai-service/agent/tools2/types.js.map +1 -1
- package/dist/ai-service/chat/chat-session-store.d.ts +3 -1
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store.js +57 -0
- package/dist/ai-service/chat/chat-session-store.js.map +1 -1
- package/dist/ai-service/features.d.ts +14 -1
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +12 -2
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/index.d.ts +5 -1
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +45 -49
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integrations/store.d.ts +21 -0
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js +50 -0
- package/dist/ai-service/integrations/store.js.map +1 -1
- package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context.js +7 -3
- package/dist/ai-service/llm/context-v2/context.js.map +1 -1
- package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts +15 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.js +91 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.js.map +1 -0
- package/dist/ai-service/llm/error.d.ts +11 -1
- package/dist/ai-service/llm/error.d.ts.map +1 -1
- package/dist/ai-service/llm/error.js +9 -0
- package/dist/ai-service/llm/error.js.map +1 -1
- package/dist/ai-service/llm/stream/config.d.ts +2 -0
- package/dist/ai-service/llm/stream/config.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/config.js +2 -1
- package/dist/ai-service/llm/stream/config.js.map +1 -1
- package/dist/ai-service/llm/stream/errors.d.ts +13 -1
- package/dist/ai-service/llm/stream/errors.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/errors.js +17 -1
- package/dist/ai-service/llm/stream/errors.js.map +1 -1
- package/dist/ai-service/llm/stream/idle-monitor.d.ts +63 -0
- package/dist/ai-service/llm/stream/idle-monitor.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/idle-monitor.js +106 -0
- package/dist/ai-service/llm/stream/idle-monitor.js.map +1 -0
- package/dist/ai-service/llm/stream/managed-stream.d.ts +4 -1
- package/dist/ai-service/llm/stream/managed-stream.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/managed-stream.js +14 -2
- package/dist/ai-service/llm/stream/managed-stream.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts +1 -0
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/llmobs.js +47 -6
- package/dist/ai-service/llm/stream/observers/llmobs.js.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.js +23 -2
- package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.js +4 -11
- package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.js +10 -3
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +171 -19
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.d.ts +4 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +3 -0
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +105 -5
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.js +8 -24
- package/dist/ai-service/state-machine/handlers/awaiting-user.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +84 -8
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +9 -0
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/git-service/azure-devops-workflow.d.ts +6 -0
- package/dist/git-service/azure-devops-workflow.d.ts.map +1 -0
- package/dist/git-service/azure-devops-workflow.js +12 -0
- package/dist/git-service/azure-devops-workflow.js.map +1 -0
- package/dist/parsing/index.d.ts +1 -1
- package/dist/parsing/index.d.ts.map +1 -1
- package/dist/parsing/index.js +1 -1
- package/dist/parsing/index.js.map +1 -1
- package/dist/parsing/sdk-registry.d.ts +12 -0
- package/dist/parsing/sdk-registry.d.ts.map +1 -1
- package/dist/parsing/sdk-registry.js +78 -22
- package/dist/parsing/sdk-registry.js.map +1 -1
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +23 -4
- package/dist/socket-manager.js.map +1 -1
- package/package.json +7 -7
package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const content = "# SQL Database Integrations\n\nReference documentation for working with SQL databases in Superblocks APIs.\n\n## Supported Databases\n\n- PostgreSQL, MySQL, MariaDB, MSSQL\n- Snowflake, Redshift, BigQuery, Athena\n- Databricks, SingleStore, Lakebase\n- CockroachDB, YugabyteDB, OracleDB\n\n## SQL Block Classes\n\n```typescript\n// Available SQL integrations\nimport {\n PostgreSQL,\n MySQL,\n MariaDB,\n MSSQL,\n Snowflake,\n Redshift,\n BigQuery,\n Athena,\n Databricks,\n SingleStore,\n OracleDB,\n} from \"@superblocksteam/library\";\n```\n\n## Basic Usage\n\n```typescript\nnew PostgreSQL(\"get_users\", \"postgres-integration-id\", {\n statement: \"SELECT * FROM users WHERE active = true LIMIT 100\",\n});\n```\n\n## Parameterized Queries\n\n### SQL Security Priority\n\n**ALWAYS prefer parameterized queries over string interpolation for user input values.**\n\nUse `parameters: \"[var1, var2]\"` with the database-specific SQL placeholders:\n\n| Database | Placeholder Syntax | Example |\n| ------------------------------------------- | ---------------------- | ------------------------------------------- |\n| PostgreSQL, Redshift, CockroachDB | `$1`, `$2`, `$3` | `WHERE id = $1 AND status = $2` |\n| MySQL, MariaDB, Snowflake, BigQuery, Athena | `?`, `?`, `?` | `WHERE id = ? AND status = ?` |\n| MSSQL | `@PARAM_1`, `@PARAM_2` | `WHERE id = @PARAM_1 AND status = @PARAM_2` |\n| Databricks | `:PARAM_1`, `:PARAM_2` | `WHERE id = :PARAM_1 AND status = :PARAM_2` |\n| OracleDB | `:1`, `:2`, `:3` | `WHERE id = :1 AND status = :2` |\n\nOnly use binding functions for truly dynamic SQL elements like table/column names.\n\n### Parameters Syntax vs Statement Syntax\n\n**Important:** `parameters` is a JavaScript expression string that gets evaluated directly. Do NOT use `${}` interpolation or binding functions.\n\n```typescript\n// \u274C WRONG - Don't use ${} interpolation in parameters\nparameters: \"[${build_query.output.userId}, ${searchTerm}]\";\n\n// \u274C WRONG - Don't use binding functions for parameters\nparameters: ({ build_query }) => JSON.stringify(build_query.output.params);\n\n// \u2705 CORRECT - Write expressions directly (they get evaluated as JS)\nparameters: \"[build_query.output.userId, searchTerm, limit]\";\n\n// \u2705 CORRECT - Reference block output array directly\nparameters: \"build_query.output.params\";\n```\n\nThis is different from `statement`, where binding functions with `${}` ARE used to interpolate values into SQL.\n\n### String Interpolation (Alternative)\n\nFor simpler cases, string interpolation also works:\n\n```typescript\n// \u2705 CORRECT - String interpolation for WHERE clauses\nnew PostgreSQL(\"search\", \"postgres-id\", {\n statement: ({ searchTerm, limit }: { searchTerm: string; limit: number }) =>\n `SELECT * FROM users WHERE name ILIKE '%${searchTerm}%' LIMIT ${limit}`,\n});\n\n// \u2705 CORRECT - For INSERT statements\nnew PostgreSQL(\"insert_user\", \"postgres-id\", {\n statement: ({ name, email }: { name: string; email: string }) =>\n `INSERT INTO users (name, email) VALUES ('${name}', '${email}') RETURNING *`,\n});\n```\n\n### Dynamic SQL with Optional Filters\n\nUse the `parameters` array with the \"OR NULL\" pattern for optional filters:\n\n- `WHERE (column = $1 OR $1::type IS NULL)` makes the condition a no-op when parameter is null\n- Cast parameters to their type when checking for NULL (PostgreSQL can't infer types from NULL values)\n- Always pass all parameters, using null for unused filters\n- NEVER interpolate user values directly into SQL strings\n\n## Best Practices\n\n### 1. ONE Query Per Block Rule\n\nEach SQL block (PostgreSQL, Snowflake, MySQL, MicrosoftSql, Databricks) can execute **ONLY ONE SQL query**.\n\n\u274C **WRONG - Multiple queries in one block:**\n\n```sql\nUPDATE users SET status = 'active';\nDELETE FROM logs WHERE created < '2023-01-01';\nINSERT INTO audit VALUES ('done');\n```\n\n\u2705 **CORRECT - One query per block:**\n\n```typescript\n(new PostgreSQL(\"update_status\", \"postgres-id\", {\n statement: \"UPDATE users SET status = 'active'\",\n}),\n new PostgreSQL(\"clean_logs\", \"postgres-id\", {\n statement: \"DELETE FROM logs WHERE created < '2023-01-01'\",\n }));\n```\n\n### 2. Use Meaningful Block Names\n\n```typescript\n// \u2705 GOOD\nnew PostgreSQL(\"fetch_active_users\", \"pg-id\", { ... })\nnew PostgreSQL(\"insert_order_item\", \"pg-id\", { ... })\n\n// \u274C BAD\nnew PostgreSQL(\"query1\", \"pg-id\", { ... })\nnew PostgreSQL(\"sql\", \"pg-id\", { ... })\n```\n\n### 3. Always Specify Columns\n\n```typescript\n// \u2705 PREFERRED - Explicit columns\nSELECT id, name, email, created_at FROM users\n\n// \u26A0\uFE0F AVOID - Select all\nSELECT * FROM users\n```\n\n### 4. Always Add Defensive Row Limits\n\nAlways include a row limit clause to prevent runaway queries. Use 100 as the default unless user specifies otherwise.\n\nDifferent SQL dialects have different syntax:\n\n- **MySQL/PostgreSQL/SQLite**: `LIMIT N`\n- **SQL Server**: `SELECT TOP N`\n- **ANSI SQL (SQL Server, Oracle, DB2)**: `OFFSET 0 ROWS FETCH NEXT N ROWS ONLY`\n\n```sql\n-- \u2705 PostgreSQL/MySQL\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 100;\n\n-- \u2705 SQL Server\nSELECT TOP 100 * FROM orders ORDER BY created_at DESC;\n\n-- \u2705 ANSI SQL (SQL Server with ORDER BY)\nSELECT * FROM orders ORDER BY created_at DESC OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY;\n\n-- \u274C Avoid unlimited queries\nSELECT * FROM orders ORDER BY created_at DESC; -- Can timeout or crash\n```\n\n### 5. Sort, Don't Filter by Date (Default)\n\nDo NOT add automatic date filters (e.g., \"last 90 days\") unless the user explicitly requests them. This is a common cause of unexpected empty SQL results.\n\n```sql\n-- \u2705 Default approach\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 100;\n\n-- \u274C Avoid automatic filtering\nSELECT * FROM orders WHERE created_at >= CURRENT_DATE - INTERVAL '90 days'; -- Can return empty results\n```\n\nOnly add date WHERE clauses when users explicitly ask for time-based filtering.\n\n### 6. Handle NULL Values\n\n```typescript\n// \u2705 Use COALESCE for default values\nSELECT COALESCE(description, 'No description') as description FROM products\n\n// \u2705 Use IS NULL / IS NOT NULL\nSELECT * FROM users WHERE deleted_at IS NULL\n```\n\n## Database-Specific Notes\n\n### PostgreSQL\n\n```typescript\n// Array operations\nnew PostgreSQL(\"array_query\", \"pg-id\", {\n statement: ({ tags }: { tags: string[] }) =>\n `SELECT * FROM posts WHERE tags && ARRAY[${tags.map((t) => `'${t}'`).join(\",\")}]`,\n});\n\n// JSON operations\nnew PostgreSQL(\"json_query\", \"pg-id\", {\n statement: \"SELECT data->>'name' as name FROM json_data\",\n});\n```\n\n- Use schema-qualified names: `schema.table` or `\"schema\".\"table\"`\n- Case sensitivity: Unquoted identifiers are lowercase\n- Use `::type` for type casting\n\n#### Custom Type Casts (Enums, Composite Types)\n\n**When casting parameters, always use the actual column type \u2014 not `text` or other generic types.**\n\nPostgreSQL columns can use custom types such as enums (`billing_plan_enum`, `order_status_enum`) or composite types. When `grepMetadata` reports a column type that is not a built-in type, you **must** use that exact type in SQL casts. Casting to `text` or `text[]` will fail with an `operator does not exist` error.\n\n**Rule:** Before writing any `::type` cast, check the actual column type via `grepMetadata`. If the column type is a custom type (e.g., `billing_plan_enum`), cast to that type, not `text`.\n\n```sql\n-- grepMetadata shows: billing.plan has type \"billing_plan_enum\"\n\n-- \u2705 CORRECT - Cast to the actual column type\nWHERE bf.plan = ANY($3::billing_plan_enum[])\n\n-- \u274C WRONG - Casting to text[] for an enum column\nWHERE bf.plan = ANY($3::text[])\n-- ERROR: operator does not exist: billing_plan_enum = text\n```\n\nThis applies to all custom types, not just enums:\n\n```sql\n-- Column type is \"order_status_enum\"\nWHERE o.status = ANY($1::order_status_enum[]) -- \u2705\nWHERE o.status = ANY($1::text[]) -- \u274C\n\n-- Column type is \"priority_level\" (custom enum)\nWHERE t.priority = $2::priority_level -- \u2705\nWHERE t.priority = $2::text -- \u274C\n```\n\n**Why this matters:** PostgreSQL does not implicitly cast between custom types and `text`. Even though enum values look like strings and `SELECT DISTINCT` returns them as plain strings, the column's actual type must be used in parameter casts. The `grepMetadata` tool returns the real type name \u2014 always use it.\n\n### Snowflake\n\n```typescript\n// Use QUALIFY for window function filtering\nnew Snowflake(\"ranked_query\", \"snowflake-id\", {\n statement: `\n SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY sales DESC) as rank\n FROM products\n QUALIFY rank <= 3\n `,\n});\n```\n\n**Snowflake Two-Part Naming:** Snowflake uses `schema.table`\n\nWhen you see Snowflake metadata where tables have a `schema` property, **you MUST qualify table names**:\n\n```sql\n-- If table has schema property \"MASTERDATA\"\nSELECT * FROM MASTERDATA.PRODUCTLINE -- \u2705 Fully qualified\nSELECT * FROM PRODUCTLINE -- \u274C Will fail if no default schema\n```\n\n**Rule**: If a table object has a non-empty `schema` property, use `{schema}.{name}` format in your SQL queries.\n\n### Databricks\n\n**Databricks Three-Part Naming:** Databricks uses `catalog.schema.table`\n\nWhen you see Databricks metadata like:\n\n- `uber.default.orders` - Use the FULL path: `uber.default.orders`\n- `production.analytics.users` - Use: `production.analytics.users`\n\n```sql\n-- Metadata shows: uber.default.orders\nSELECT * FROM uber.default.orders -- \u2705 Full path\nSELECT * FROM uber.orders -- \u274C Missing schema part\nSELECT * FROM orders -- \u274C Missing catalog and schema\n```\n\n**Note:** The word \"default\" in Databricks paths is NOT optional - it's the actual schema name. Always include all three parts exactly as shown in the metadata.\n\n### BigQuery\n\n```typescript\n// Use backticks for table names\nnew BigQuery(\"query\", \"bq-id\", {\n statement: \"SELECT * FROM \\`project.dataset.table\\` LIMIT 100\",\n});\n```\n\n## Common Patterns\n\n### Pagination\n\n```typescript\nnew PostgreSQL(\"paginated_fetch\", \"pg-id\", {\n statement: ({ page, pageSize }: { page: number; pageSize: number }) =>\n `SELECT * FROM orders ORDER BY created_at DESC LIMIT ${pageSize} OFFSET ${(page - 1) * pageSize}`,\n});\n```\n\n### Search with Multiple Conditions\n\n```typescript\nnew PostgreSQL(\"advanced_search\", \"pg-id\", {\n statement: ({\n name,\n status,\n minAmount,\n }: {\n name?: string;\n status?: string;\n minAmount?: number;\n }) => {\n const conditions = [\"1=1\"];\n if (name) conditions.push(`name ILIKE '%${name}%'`);\n if (status) conditions.push(`status = '${status}'`);\n if (minAmount !== undefined) conditions.push(`amount >= ${minAmount}`);\n return `SELECT * FROM orders WHERE ${conditions.join(\" AND \")} LIMIT 100`;\n },\n});\n```\n\n### Batch Insert\n\n```typescript\nnew PostgreSQL(\"batch_insert\", \"pg-id\", {\n statement: ({ items }: { items: Array<{ name: string; value: number }> }) => {\n const values = items\n .map((item) => `('${item.name}', ${item.value})`)\n .join(\", \");\n return `INSERT INTO items (name, value) VALUES ${values} RETURNING *`;\n },\n});\n```\n\n### Upsert (Insert or Update)\n\n```typescript\n// PostgreSQL\nnew PostgreSQL(\"upsert_user\", \"pg-id\", {\n statement: ({\n id,\n name,\n email,\n }: {\n id: string;\n name: string;\n email: string;\n }) =>\n `INSERT INTO users (id, name, email) \n VALUES ('${id}', '${name}', '${email}')\n ON CONFLICT (id) DO UPDATE SET name = EXCLUDED.name, email = EXCLUDED.email\n RETURNING *`,\n});\n```\n\n## Error Handling\n\nSQL errors are returned in the block's output. Common errors:\n\n- Syntax errors in SQL\n- Table/column doesn't exist\n- Constraint violations\n- Connection timeouts\n\nFor critical operations, wrap in TryCatch:\n\n```typescript\nnew TryCatch(\"safe_delete\", {\n try: [\n new PostgreSQL(\"delete_record\", \"pg-id\", {\n statement: ({ id }: { id: string }) =>\n `DELETE FROM sensitive_data WHERE id = '${id}'`,\n }),\n ],\n catch: [\n new JavaScript(\"log_error\", {\n fn: ({ deleteError }) => ({\n success: false,\n error: deleteError.value.message,\n }),\n }),\n ],\n variables: { error: \"deleteError\" },\n});\n```\n";
|
|
1
|
+
export declare const content = "# SQL Database Integrations\n\nReference documentation for working with SQL databases in Superblocks APIs.\n\n## Supported Databases\n\n- PostgreSQL, MySQL, MariaDB, MSSQL\n- Snowflake, Redshift, BigQuery, Athena\n- Databricks, SingleStore, Lakebase\n- CockroachDB, YugabyteDB, OracleDB\n\n## SQL Block Classes\n\n```typescript\n// Available SQL integrations\nimport {\n PostgreSQL,\n MySQL,\n MariaDB,\n MSSQL,\n Snowflake,\n Redshift,\n BigQuery,\n Athena,\n Databricks,\n SingleStore,\n OracleDB,\n} from \"@superblocksteam/library\";\n```\n\n## Basic Usage\n\n```typescript\nnew PostgreSQL(\"get_users\", \"postgres-integration-id\", {\n statement: \"SELECT * FROM users WHERE active = true LIMIT 100\",\n});\n```\n\n## Parameterized Queries\n\n### SQL Security Priority\n\n**ALWAYS prefer parameterized queries over string interpolation for user input values.**\n\nUse `parameters: \"[var1, var2]\"` with the database-specific SQL placeholders:\n\n| Database | Placeholder Syntax | Example |\n| ------------------------------------------- | ---------------------- | ------------------------------------------- |\n| PostgreSQL, Redshift, CockroachDB | `$1`, `$2`, `$3` | `WHERE id = $1 AND status = $2` |\n| MySQL, MariaDB, Snowflake, BigQuery, Athena | `?`, `?`, `?` | `WHERE id = ? AND status = ?` |\n| MSSQL | `@PARAM_1`, `@PARAM_2` | `WHERE id = @PARAM_1 AND status = @PARAM_2` |\n| Databricks | `:PARAM_1`, `:PARAM_2` | `WHERE id = :PARAM_1 AND status = :PARAM_2` |\n| OracleDB | `:1`, `:2`, `:3` | `WHERE id = :1 AND status = :2` |\n\nOnly use binding functions for truly dynamic SQL elements like table/column names.\n\n### Parameters Syntax vs Statement Syntax\n\n**Important:** `parameters` is a JavaScript expression string that gets evaluated directly. Do NOT use `${}` interpolation or binding functions.\n\n```typescript\n// \u274C WRONG - Don't use ${} interpolation in parameters\nparameters: \"[${build_query.output.userId}, ${searchTerm}]\";\n\n// \u274C WRONG - Don't use binding functions for parameters\nparameters: ({ build_query }) => JSON.stringify(build_query.output.params);\n\n// \u2705 CORRECT - Write expressions directly (they get evaluated as JS)\nparameters: \"[build_query.output.userId, searchTerm, limit]\";\n\n// \u2705 CORRECT - Reference block output array directly\nparameters: \"build_query.output.params\";\n```\n\nThis is different from `statement`, where binding functions with `${}` ARE used to interpolate values into SQL.\n\n### String Interpolation (Alternative)\n\nFor simpler cases, string interpolation also works:\n\n```typescript\n// \u2705 CORRECT - String interpolation for WHERE clauses\nnew PostgreSQL(\"search\", \"postgres-id\", {\n statement: ({ searchTerm, limit }: { searchTerm: string; limit: number }) =>\n `SELECT * FROM users WHERE name ILIKE '%${searchTerm}%' LIMIT ${limit}`,\n});\n\n// \u2705 CORRECT - For INSERT statements\nnew PostgreSQL(\"insert_user\", \"postgres-id\", {\n statement: ({ name, email }: { name: string; email: string }) =>\n `INSERT INTO users (name, email) VALUES ('${name}', '${email}') RETURNING *`,\n});\n```\n\n### Dynamic SQL with Optional Filters\n\nUse the `parameters` array with the \"OR NULL\" pattern for optional filters:\n\n- `WHERE (column = $1 OR $1::type IS NULL)` makes the condition a no-op when parameter is null\n- Cast parameters to their type when checking for NULL (PostgreSQL can't infer types from NULL values)\n- Always pass all parameters, using null for unused filters\n- NEVER interpolate user values directly into SQL strings\n\n## Best Practices\n\n### 1. ONE Query Per Block Rule\n\nEach SQL block (PostgreSQL, Snowflake, MySQL, MicrosoftSql, Databricks) can execute **ONLY ONE SQL query**.\n\n\u274C **WRONG - Multiple queries in one block:**\n\n```sql\nUPDATE users SET status = 'active';\nDELETE FROM logs WHERE created < '2023-01-01';\nINSERT INTO audit VALUES ('done');\n```\n\n\u2705 **CORRECT - One query per block:**\n\n```typescript\n(new PostgreSQL(\"update_status\", \"postgres-id\", {\n statement: \"UPDATE users SET status = 'active'\",\n}),\n new PostgreSQL(\"clean_logs\", \"postgres-id\", {\n statement: \"DELETE FROM logs WHERE created < '2023-01-01'\",\n }));\n```\n\n### 2. Use Meaningful Block Names\n\n```typescript\n// \u2705 GOOD\nnew PostgreSQL(\"fetch_active_users\", \"pg-id\", { ... })\nnew PostgreSQL(\"insert_order_item\", \"pg-id\", { ... })\n\n// \u274C BAD\nnew PostgreSQL(\"query1\", \"pg-id\", { ... })\nnew PostgreSQL(\"sql\", \"pg-id\", { ... })\n```\n\n### 3. Always Specify Columns\n\n```typescript\n// \u2705 PREFERRED - Explicit columns\nSELECT id, name, email, created_at FROM users\n\n// \u26A0\uFE0F AVOID - Select all\nSELECT * FROM users\n```\n\n### 4. Always Add Defensive Row Limits\n\nAlways include a row limit clause to prevent runaway queries. Use 100 as the default unless user specifies otherwise.\n\nDifferent SQL dialects have different syntax:\n\n- **MySQL/PostgreSQL/SQLite**: `LIMIT N`\n- **SQL Server**: `SELECT TOP N`\n- **ANSI SQL (SQL Server, Oracle, DB2)**: `OFFSET 0 ROWS FETCH NEXT N ROWS ONLY`\n\n```sql\n-- \u2705 PostgreSQL/MySQL\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 100;\n\n-- \u2705 SQL Server\nSELECT TOP 100 * FROM orders ORDER BY created_at DESC;\n\n-- \u2705 ANSI SQL (SQL Server with ORDER BY)\nSELECT * FROM orders ORDER BY created_at DESC OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY;\n\n-- \u274C Avoid unlimited queries\nSELECT * FROM orders ORDER BY created_at DESC; -- Can timeout or crash\n```\n\n### 5. Sort, Don't Filter by Date (Default)\n\nDo NOT add automatic date filters (e.g., \"last 90 days\") unless the user explicitly requests them. This is a common cause of unexpected empty SQL results.\n\n```sql\n-- \u2705 Default approach\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 100;\n\n-- \u274C Avoid automatic filtering\nSELECT * FROM orders WHERE created_at >= CURRENT_DATE - INTERVAL '90 days'; -- Can return empty results\n```\n\nOnly add date WHERE clauses when users explicitly ask for time-based filtering.\n\n### 6. Handle NULL Values\n\n```typescript\n// \u2705 Use COALESCE for default values\nSELECT COALESCE(description, 'No description') as description FROM products\n\n// \u2705 Use IS NULL / IS NOT NULL\nSELECT * FROM users WHERE deleted_at IS NULL\n```\n\n## Database-Specific Notes\n\n### PostgreSQL\n\n```typescript\n// Array operations\nnew PostgreSQL(\"array_query\", \"pg-id\", {\n statement: ({ tags }: { tags: string[] }) =>\n `SELECT * FROM posts WHERE tags && ARRAY[${tags.map((t) => `'${t}'`).join(\",\")}]`,\n});\n\n// JSON operations\nnew PostgreSQL(\"json_query\", \"pg-id\", {\n statement: \"SELECT data->>'name' as name FROM json_data\",\n});\n```\n\n- Use schema-qualified names: `schema.table` or `\"schema\".\"table\"`\n- Case sensitivity: Unquoted identifiers are lowercase\n- Use `::type` for type casting\n\n#### Custom Type Casts (Enums, Composite Types)\n\n**When casting parameters, always use the actual column type \u2014 not `text` or other generic types.**\n\nPostgreSQL columns can use custom types such as enums (`billing_plan_enum`, `order_status_enum`) or composite types. When `grepMetadata` reports a column type that is not a built-in type, you **must** use that exact type in SQL casts. Casting to `text` or `text[]` will fail with an `operator does not exist` error.\n\n**Rule:** Before writing any `::type` cast, check the actual column type via `grepMetadata`. If the column type is a custom type (e.g., `billing_plan_enum`), cast to that type, not `text`.\n\n```sql\n-- grepMetadata shows: billing.plan has type \"billing_plan_enum\"\n\n-- \u2705 CORRECT - Cast to the actual column type\nWHERE bf.plan = ANY($3::billing_plan_enum[])\n\n-- \u274C WRONG - Casting to text[] for an enum column\nWHERE bf.plan = ANY($3::text[])\n-- ERROR: operator does not exist: billing_plan_enum = text\n```\n\nThis applies to all custom types, not just enums:\n\n```sql\n-- Column type is \"order_status_enum\"\nWHERE o.status = ANY($1::order_status_enum[]) -- \u2705\nWHERE o.status = ANY($1::text[]) -- \u274C\n\n-- Column type is \"priority_level\" (custom enum)\nWHERE t.priority = $2::priority_level -- \u2705\nWHERE t.priority = $2::text -- \u274C\n```\n\n**Why this matters:** PostgreSQL does not implicitly cast between custom types and `text`. Even though enum values look like strings and `SELECT DISTINCT` returns them as plain strings, the column's actual type must be used in parameter casts. The `grepMetadata` tool returns the real type name \u2014 always use it.\n\n### Snowflake\n\n```typescript\n// Use QUALIFY for window function filtering\nnew Snowflake(\"ranked_query\", \"snowflake-id\", {\n statement: `\n SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY sales DESC) as rank\n FROM products\n QUALIFY rank <= 3\n `,\n});\n```\n\n**Snowflake Two-Part Naming:** Snowflake uses `schema.table`\n\nWhen you see Snowflake metadata where tables have a `schema` property, **you MUST qualify table names**:\n\n```sql\n-- If table has schema property \"MASTERDATA\"\nSELECT * FROM MASTERDATA.PRODUCTLINE -- \u2705 Fully qualified\nSELECT * FROM PRODUCTLINE -- \u274C Will fail if no default schema\n```\n\n**Rule**: If a table object has a non-empty `schema` property, use `{schema}.{name}` format in your SQL queries.\n\n### Databricks\n\n**Databricks Three-Part Naming:** Databricks uses `catalog.schema.table`\n\nWhen you see Databricks metadata like:\n\n- `uber.default.orders` - Use the FULL path: `uber.default.orders`\n- `production.analytics.users` - Use: `production.analytics.users`\n\n```sql\n-- Metadata shows: uber.default.orders\nSELECT * FROM uber.default.orders -- \u2705 Full path\nSELECT * FROM uber.orders -- \u274C Missing schema part\nSELECT * FROM orders -- \u274C Missing catalog and schema\n```\n\n**Note:** The word \"default\" in Databricks paths is NOT optional - it's the actual schema name. Always include all three parts exactly as shown in the metadata.\n\n### BigQuery\n\n```typescript\n// Use backticks for table names, ? placeholders for parameters\nnew BigQuery(\"get_events\", \"bq-id\", {\n sqlBody:\n \"SELECT * FROM \\`project.dataset.events\\` WHERE status = ? LIMIT 100\",\n parameters: \"[statusFilter]\",\n});\n\n// Without parameters\nnew BigQuery(\"get_all\", \"bq-id\", {\n sqlBody: \"SELECT * FROM \\`project.dataset.table\\` LIMIT 100\",\n});\n```\n\n## Common Patterns\n\n### Pagination\n\n```typescript\nnew PostgreSQL(\"paginated_fetch\", \"pg-id\", {\n statement: ({ page, pageSize }: { page: number; pageSize: number }) =>\n `SELECT * FROM orders ORDER BY created_at DESC LIMIT ${pageSize} OFFSET ${(page - 1) * pageSize}`,\n});\n```\n\n### Search with Multiple Conditions\n\n```typescript\nnew PostgreSQL(\"advanced_search\", \"pg-id\", {\n statement: ({\n name,\n status,\n minAmount,\n }: {\n name?: string;\n status?: string;\n minAmount?: number;\n }) => {\n const conditions = [\"1=1\"];\n if (name) conditions.push(`name ILIKE '%${name}%'`);\n if (status) conditions.push(`status = '${status}'`);\n if (minAmount !== undefined) conditions.push(`amount >= ${minAmount}`);\n return `SELECT * FROM orders WHERE ${conditions.join(\" AND \")} LIMIT 100`;\n },\n});\n```\n\n### Batch Insert\n\n```typescript\nnew PostgreSQL(\"batch_insert\", \"pg-id\", {\n statement: ({ items }: { items: Array<{ name: string; value: number }> }) => {\n const values = items\n .map((item) => `('${item.name}', ${item.value})`)\n .join(\", \");\n return `INSERT INTO items (name, value) VALUES ${values} RETURNING *`;\n },\n});\n```\n\n### Upsert (Insert or Update)\n\n```typescript\n// PostgreSQL\nnew PostgreSQL(\"upsert_user\", \"pg-id\", {\n statement: ({\n id,\n name,\n email,\n }: {\n id: string;\n name: string;\n email: string;\n }) =>\n `INSERT INTO users (id, name, email) \n VALUES ('${id}', '${name}', '${email}')\n ON CONFLICT (id) DO UPDATE SET name = EXCLUDED.name, email = EXCLUDED.email\n RETURNING *`,\n});\n```\n\n## Error Handling\n\nSQL errors are returned in the block's output. Common errors:\n\n- Syntax errors in SQL\n- Table/column doesn't exist\n- Constraint violations\n- Connection timeouts\n\nFor critical operations, wrap in TryCatch:\n\n```typescript\nnew TryCatch(\"safe_delete\", {\n try: [\n new PostgreSQL(\"delete_record\", \"pg-id\", {\n statement: ({ id }: { id: string }) =>\n `DELETE FROM sensitive_data WHERE id = '${id}'`,\n }),\n ],\n catch: [\n new JavaScript(\"log_error\", {\n fn: ({ deleteError }) => ({\n success: false,\n error: deleteError.value.message,\n }),\n }),\n ],\n variables: { error: \"deleteError\" },\n});\n```\n";
|
|
2
2
|
//# sourceMappingURL=sql-databases.generated.d.ts.map
|
package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql-databases.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/ai-service/skills/system/superblocks-api/references/sql-databases.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"sql-databases.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/ai-service/skills/system/superblocks-api/references/sql-databases.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,g2ZAwZnB,CAAC"}
|
|
@@ -298,9 +298,16 @@ SELECT * FROM orders -- ❌ Missing catalog and schema
|
|
|
298
298
|
### BigQuery
|
|
299
299
|
|
|
300
300
|
\`\`\`typescript
|
|
301
|
-
// Use backticks for table names
|
|
302
|
-
new BigQuery("
|
|
303
|
-
|
|
301
|
+
// Use backticks for table names, ? placeholders for parameters
|
|
302
|
+
new BigQuery("get_events", "bq-id", {
|
|
303
|
+
sqlBody:
|
|
304
|
+
"SELECT * FROM \\\`project.dataset.events\\\` WHERE status = ? LIMIT 100",
|
|
305
|
+
parameters: "[statusFilter]",
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// Without parameters
|
|
309
|
+
new BigQuery("get_all", "bq-id", {
|
|
310
|
+
sqlBody: "SELECT * FROM \\\`project.dataset.table\\\` LIMIT 100",
|
|
304
311
|
});
|
|
305
312
|
\`\`\`
|
|
306
313
|
|
package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sql-databases.generated.js","sourceRoot":"","sources":["../../../../../../src/ai-service/skills/system/superblocks-api/references/sql-databases.generated.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"sql-databases.generated.js","sourceRoot":"","sources":["../../../../../../src/ai-service/skills/system/superblocks-api/references/sql-databases.generated.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwZtB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const content = "---\nname: superblocks-frontend\ndescription: |\n Build frontend UI using React, Tailwind CSS, and Superblocks components. Essential for connecting Superblocks UIs with APIs.\n Use when creating pages, components, handling user interactions, or working with the design system.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# Superblocks Frontend Development\n\nThis skill covers building frontend UI for Superblocks applications using React, Tailwind CSS v4, and the Superblocks component library.\n\n## Platform Overview\n\nThis is a React-based web application platform. Use standard React patterns:\n\n- `useState`, `useEffect`, `useCallback`, `useMemo`\n- Event handlers and controlled components\n- JSX with Tailwind CSS classes\n\n## Using APIs from Frontend\n\nYou **must** use the `useApi` hook for calling backend APIs. It supports two modes:\n\n**Declarative** \u2014 auto-fetches on mount and when inputs change (preferred for data fetching):\n\n```typescript\nimport { useApi } from \"@superblocksteam/library\";\n\n// Auto-fetches when email or name changes. No useEffect, no loading state, no HMR guards needed.\nconst { loading, data } = useApi(\"GetUsers\", { email, name });\n```\n\n**Imperative** \u2014 call `run()` manually (for event-driven actions like form submissions):\n\n```typescript\nimport { useApi } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { run: createOrder, loading } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder]);\n```\n\nBoth modes return `{ run, cancel, loading, data, error }`. `data` persists across re-runs (shows previous result while loading). `error` holds the most recent failure, or `undefined` on success. HMR double-fetch prevention is built in \u2014 no `useRef` guard needed.\n\n### Critical API Rules\n\n1. **MUST call API by exact name**: Format is `<ApiName>` matching folder `apis/<ApiName>/api.yaml`\n2. **Prefer declarative mode**: For data fetching, pass inputs directly: `useApi(\"GetUsers\", { email })`. Only use imperative mode for event-driven actions (button clicks, form submissions).\n3. **Use `loading` and `data` from useApi**: Do NOT create separate `useState` for loading or response data \u2014 useApi manages this for you\n4. **ALWAYS check API interfaces**: NEVER guess the response structure\n5. **Include all parameters**: Even optional ones should be passed as `null`\n6. **ALWAYS use try/catch**: In imperative mode, APIs throw errors when they fail - wrap ALL `run()` calls in try/catch blocks. In declarative mode, check the `error` field for failure details.\n\n### File Handling\n\n**CRITICAL: Files must be wrapped in `{ files: [...] }` format:**\n\n```tsx\n// \u2705 CORRECT - Frontend: wrap files in { files: [...] }\nconst response = await runUploadApi({ userFile: { files: selectedFiles } });\n\n// \u274C WRONG - backend cannot process unwrapped files\nconst response = await runUploadApi({ userFile: selectedFiles });\n```\n\n## Platform Hooks and Functions\n\nAvailable hooks and functions from `@superblocksteam/library`:\n\n### User and Group Context\n\n```typescript\nimport {\n useSuperblocksUser,\n useSuperblocksGroups,\n} from \"@superblocksteam/library\";\n\n// Get current user info\nconst user = useSuperblocksUser();\n// user.name, user.email, user.id, user.groups, user.username, user.metadata\n\n// Get organization groups\nconst groups = useSuperblocksGroups();\n```\n\n### Environments and Data Tags\n\nConcepts & terminology:\n\n- `Data tags` are labels for different data segments, such as `Staging`, `Production`, or `us-east`.\n- `Profiles` is the legacy term for the same concept. If a user asks about profiles, treat that as data tags.\n- `Environments` are `Edit`, `Preview`, and `Production`, and each data tag is allowed in one or more of those environments.\n- Clark operates in `Edit` mode, so the data tags visible in app context represent the tags available in `Edit`; do not assume this is the same set that will be available in `Preview` or `Production`.\n- When implementing app code, prefer `useSuperblocksDataTags()`, `dataTags`, and `setDataTag()`.\n\nRelevant hooks and functions:\n\n```typescript\nimport { useSuperblocksDataTags, getAppMode } from \"@superblocksteam/library\";\n\n// Manage data tags\nconst { dataTags, setDataTag } = useSuperblocksDataTags();\n\n// Read the current app mode when reasoning about environment-specific behavior\nconst appMode = getAppMode();\n```\n\n### Embedded Applications\n\n**For embedded applications**, see the `references/embedding.md` file for `useEmbedProperties`, `useEmbedEvent`, and `useEmitEmbedEvent` hooks.\n\n## Logging Out of Integrations\n\nWhen building a \"Log out\" or \"Sign out\" button for apps that use OAuth-like integrations, use `logoutIntegrations` from the library to clear OAuth tokens:\n\n```typescript\nimport { logoutIntegrations } from \"@superblocksteam/library\";\n\nconst handleLogout = async () => {\n await logoutIntegrations();\n // Optionally redirect or show confirmation\n};\n```\n\n## Application Architecture\n\n### App.tsx Layout Structure\n\n**For single-page applications:**\n\n- Put all content in `pages/<pageName>/index.tsx`\n- Use components to compose and build the page\n- Keep `App.tsx` minimal with just `<AppProvider>` and `<Outlet />`\n\n**For multi-page applications:**\n\n- Put shared navigation/layout in `App.tsx` (sidebars, headers, footers)\n- Always include `<Outlet />` for page content\n- Always include `<AppProvider />` wrapper\n- Individual pages focus on content, not layout\n\n```tsx\n// \u2705 CORRECT - Multi-page App.tsx layout\n<AppProvider>\n <div className=\"flex flex-row size-screen\">\n {/* Sidebar - persistent across all pages */}\n <div className=\"flex bg-sidebar border-r w-[250px]\">\n <Navigation />\n </div>\n\n {/* Main content area */}\n <div className=\"flex flex-1 h-full flex-col\">\n {/* Header - persistent across all pages */}\n <div className=\"flex bg-header border-b h-[60px]\">\n <Header />\n </div>\n\n {/* Page content area */}\n <div className=\"flex p-4 flex-1 overflow-auto\">\n <Outlet />\n </div>\n </div>\n </div>\n</AppProvider>\n```\n\n**PROTECTED: NEVER remove `<AppProvider>` or `<Outlet />` from App.tsx!**\n\n### Page Structure\n\n```tsx\n// \u2705 CORRECT - Page focuses on content only\n<div className=\"flex flex-col gap-4 size-screen overflow-auto\">\n <h1 className=\"text-3xl font-bold\">Dashboard Content</h1>\n <Card>{/* Page-specific content */}</Card>\n</div>\n```\n\n**IMPORTANT**: The first div on the page must have `overflow-auto` so the user's page can scroll.\n\n## Routing\n\nUse `react-router@7` in data mode. Standard patterns apply:\n\n- `useNavigate()` for programmatic navigation\n- `useParams()` for route parameters\n- `useSearchParams()` for query strings\n\n**If you add new pages or rename files, you MUST update the router.**\n\n## Design System (Tailwind CSS v4)\n\n**All design tokens are defined in `index.css`**. Apps come with a professional black-and-white theme by default.\n\n### Semantic Tokens Rule\n\n**ALWAYS use semantic tokens** \u2014 NEVER raw Tailwind utilities:\n\n```tsx\n// \u2705 CORRECT\n<Card className=\"bg-background text-foreground border border-border\" />\n\n// \u274C WRONG\n<Card className=\"bg-white text-black border-gray-200\" />\n```\n\n### When to Modify index.css\n\nOnly modify when:\n\n- User explicitly requests branding/theme changes\n- Replicating a specific brand look (e.g., Yelp, Instacart)\n- Feature requests (lists, filters, CRUD) do NOT require changes\n\n**Modification Rules:**\n\n- All colors must be in OKLCH format\n- Use semantic names (`--color-warning`, `--shadow-elevated`)\n- Do not remove or rename existing tokens\n- Limit color palette to 5 colors max\n- Avoid gradients unless explicitly requested\n- Minimal font sizes (3 max: body, section heading, main heading)\n\n### Component Variants\n\nUse or create variants instead of one-off styles:\n\n```tsx\n// \u274C WRONG - Hacky inline overrides\n<Button className=\"text-white border-white hover:bg-white\" />\n\n// \u2705 CORRECT - Use a variant\n<Button variant=\"secondary\" />\n```\n\n## Icons\n\nUse icons from Lucide React library:\n\n```tsx\nimport { Icon } from \"@/components/ui/icon\";\n<Icon icon=\"heart\" />;\n\nimport { Button } from \"@/components/ui/button\";\n<Button>\n <Icon icon=\"plus\" /> Add Item\n</Button>;\n```\n\n**Always use icons rather than emojis unless explicitly requested.**\n\n## Custom Components\n\n**CRITICAL: Component composition is MANDATORY. DO NOT create monolithic pages.**\n\n### The Composition Rule\n\nWhen building ANY feature:\n\n1. **First**, identify reusable parts (list items, cards, forms, filters, headers)\n2. **Then**, create separate component files\n3. **Finally**, compose them together in the page\n\n### When to Create Components\n\n- **Rendering any list** - Extract to a component\n- **Building cards/complex UI** - Each card type is a component\n- **Creating forms** - Form sections are components\n- **Adding filters/headers** - These are components\n- **Page has >50 lines JSX** - Break it down\n\n### Component Boundary Rules\n\n**Inside a custom component:**\n\n- \u2705 Use React hooks (useState, useReducer, useEffect, etc.)\n- \u2705 Use local React state\n- \u2705 Use internal helper components\n- \u2705 Use other registered components\n- \u274C CANNOT call APIs - must pass data into the component\n\n### Example: Proper Component Structure\n\n```tsx\n// components/ProductCard/index.tsx - Extract to component\nimport { Card } from \"@/components/ui/card\";\nimport { Button } from \"@/components/ui/button\";\n\ntype ProductCardProps = {\n product: {\n id: string;\n name: string;\n image: string;\n };\n};\n\nexport default function ProductCard(props: ProductCardProps) {\n return (\n <Card>\n <img src={props.product.image} />\n <h3 className=\"text-lg font-semibold\">{props.product.name}</h3>\n <Button>Add</Button>\n </Card>\n );\n}\n\n// pages/Products/index.tsx - Clean composition\nimport ProductCard from \"@/components/ProductCard\";\n\nconst ProductsPage = () => {\n const [products, setProducts] = useState([]);\n\n return (\n <div className=\"grid grid-cols-3 gap-4\">\n {products.map((p) => (\n <ProductCard key={p.id} product={p} />\n ))}\n </div>\n );\n};\n```\n\n## Visual Excellence\n\n**Prioritize visual excellence from the start:**\n\n1. **Design System Enhancement**: Start by enhancing `index.css` with app-specific colors that match the target aesthetic\n2. **Professional Layout Architecture**: Use sophisticated layouts with proper spacing, responsive design\n3. **Rich Interactive Components**: Leverage advanced components with proper variants and states\n4. **Visual Polish**: Add shadows, smooth transitions, skeleton loaders, hover effects, typography hierarchy\n5. **Real-World UI Patterns**: Create layouts that feel like professional applications\n\n**Make applications that look and feel like real, polished products - not basic wireframes.**\n\n### Loading States\n\n**Always represent loading with skeletons (shimmers), not spinners or empty screens.**\n\n### Efficient Loading Patterns\n\n1. **Default to Smart Loading**: Check for existing data before showing loading states\n2. **Loading State Hierarchy**:\n - Empty state \u2192 Full loading\n - Has data \u2192 Keep showing data during refetch\n - Error state \u2192 Show error with retry option\n3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession\n4. **Use hooks to encapsulate API logic**: Avoid repeating code\n\n## Performance Rules\n\n### 1. ALWAYS Paginate Tables and Lists\n\n**NEVER render more than 50 rows without pagination.** Always add client-side pagination:\n\n```tsx\nfunction PaginatedTable({ data }: { data: any[] }) {\n const PAGE_SIZE = 20;\n const [page, setPage] = useState(0);\n const totalPages = Math.ceil(data.length / PAGE_SIZE);\n const pageData = useMemo(\n () => data.slice(page * PAGE_SIZE, (page + 1) * PAGE_SIZE),\n [data, page],\n );\n\n useEffect(() => {\n setPage(0);\n }, [data.length]);\n\n return (\n <>\n <Table>{/* render pageData rows */}</Table>\n <span>\n Page {page + 1} of {totalPages} ({data.length} total rows)\n </span>\n <Button\n onClick={() => setPage((p) => Math.max(0, p - 1))}\n disabled={page === 0}\n >\n Previous\n </Button>\n <Button\n onClick={() => setPage((p) => Math.min(totalPages - 1, p + 1))}\n disabled={page >= totalPages - 1}\n >\n Next\n </Button>\n </>\n );\n}\n```\n\nFor 200+ rows, prefer **server-side pagination**; use cursor/keyset pagination for high offsets instead of `LIMIT`/`OFFSET`.\n\nFor 500+ item lists where pagination doesn't fit the UX (chat messages, infinite scroll feeds, large dropdowns), use **virtualization** (`react-virtuoso` or `@tanstack/react-virtual`) to render only the items visible in the viewport.\n\n### 2. ALWAYS Debounce Input-Driven API Calls\n\n**NEVER call an API directly from onChange.** Debounce search/filter inputs with a 300ms timer:\n\n```tsx\nfunction DebouncedSearch({ onSearch }: { onSearch: (query: string) => void }) {\n const [localValue, setLocalValue] = useState(\"\");\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setLocalValue(e.target.value);\n clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => onSearch(e.target.value), 300);\n },\n [onSearch],\n );\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n return (\n <Input value={localValue} onChange={handleChange} placeholder=\"Search...\" />\n );\n}\n```\n\n### 3. Memoize Expensive Renders\n\nUse memoization (`memo()`, `useMemo`, `useCallback`) when it prevents measurable re-renders or expensive recomputation:\n\n```tsx\nconst OrderRow = memo(function OrderRow({\n order,\n onSelect,\n}: {\n order: Order;\n onSelect: (id: string) => void;\n}) {\n return (\n <TableRow onClick={() => onSelect(order.id)}>\n <TableCell>{order.id}</TableCell>...\n </TableRow>\n );\n});\n\nconst handleSelect = useCallback((id: string) => {\n setSelectedId(id);\n}, []);\n\nconst filtered = useMemo(\n () =>\n orders.filter((o) => o.status === status).sort((a, b) => b.total - a.total),\n [orders, status],\n);\n```\n\n### 4. ALWAYS Clean Up Side Effects\n\nClean up timers, event listeners, and subscriptions in `useEffect` return functions:\n\n```tsx\nuseEffect(() => {\n const handler = (e: KeyboardEvent) => {\n /* ... */\n };\n window.addEventListener(\"keydown\", handler);\n return () => window.removeEventListener(\"keydown\", handler);\n}, []);\n```\n\n### 5. Cancel In-Flight API Requests on Unmount\n\nFor search/filter patterns, prefer declarative mode \u2014 it handles cancellation and cleanup automatically:\n\n```tsx\n// Declarative: auto-fetches and cancels on unmount/input change\nconst { loading, data } = useApi(\"SearchProducts\", { query });\n```\n\nFor imperative usage with manual cleanup, use the `cancel()` function:\n\n```tsx\nconst { run, cancel } = useApi(\"SearchProducts\");\n\nuseEffect(() => {\n if (!query) return;\n run({ query }).catch(console.error);\n return () => {\n void cancel().catch(() => {});\n };\n}, [query, run, cancel]);\n```\n";
|
|
1
|
+
export declare const content = "---\nname: superblocks-frontend\ndescription: |\n Build frontend UI using React, Tailwind CSS, and Superblocks components. Essential for connecting Superblocks UIs with APIs.\n Use when creating pages, components, handling user interactions, or working with the design system.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# Superblocks Frontend Development\n\nThis skill covers building frontend UI for Superblocks applications using React, Tailwind CSS v4, and the Superblocks component library.\n\n## Platform Overview\n\nThis is a React-based web application platform. Use standard React patterns:\n\n- `useState`, `useEffect`, `useCallback`, `useMemo`\n- Event handlers and controlled components\n- JSX with Tailwind CSS classes\n\n## Using APIs from Frontend\n\nThree primitives are available from `@superblocksteam/library`:\n\n- **`useApiData`** \u2014 declarative reads with SWR caching (preferred for data loading)\n- **`useApi`** \u2014 imperative mutations (for event-driven actions)\n- **`executeApi`** \u2014 plain Promise outside React (utility functions, event handlers without hooks)\n\n**Data loading** \u2014 auto-fetches on mount and when inputs change (preferred for reads):\n\n```typescript\nimport { useApiData } from \"@superblocksteam/library\";\n\n// Auto-fetches when email or name changes. No useEffect or HMR guards needed.\n// IMPORTANT: Always use `fetching` to show a loading indicator during refetches.\nconst { data, loading, fetching, isError, error } = useApiData(\"GetUsers\", {\n email,\n name,\n});\n```\n\n**Mutations** \u2014 call `run()` manually (for event-driven actions like form submissions):\n\n```typescript\nimport { useApi } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { run: createOrder, loading } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder]);\n```\n\n**Outside React** \u2014 call APIs as a plain Promise (utility functions, event handlers):\n\n```typescript\nimport { executeApi } from \"@superblocksteam/library\";\n\nconst result = await executeApi(\"GetUsers\", { email });\n```\n\n`useApiData` returns `{ data, loading, fetching, isError, isSuccess, isStale, error, status, fetchStatus, refetch, cancel }`. `data` persists across background refetches (stale-while-revalidate). `loading` is true on first fetch with no cached data. `fetching` is true during any fetch including background refetch. `status` is `\"pending\"` | `\"success\"` | `\"error\"`. `fetchStatus` is `\"idle\"` | `\"fetching\"`. `cancel()` is synchronous (returns `void`).\n\n`useApi` returns `{ run, cancel, reset, loading, data, error, status, variables }`. `data` persists across re-runs (shows previous result while loading). `error` holds the most recent failure, or `undefined` on success. `status` is `\"idle\"` | `\"pending\"` | `\"success\"` | `\"error\"`. `variables` holds the inputs from the most recent `run()`. `reset()` clears all state back to idle. HMR double-fetch prevention is built in \u2014 no `useRef` guard needed.\n\n### useApiData Options\n\n```typescript\nconst { data } = useApiData(\"GetUsers\", { email }, {\n enabled: true, // Skip fetching when false (conditional fetching)\n staleTime: 0, // Ms before cached data is considered stale (0 = always refetch)\n retry: 3, // Retry attempts on failure (false to disable)\n retryDelay: (n) => ..., // Custom delay strategy (default: exponential backoff, max 30s)\n refetchOnWindowFocus: false, // Refetch when tab regains focus\n refetchOnReconnect: true, // Refetch when network reconnects\n refetchInterval: false, // Polling interval in ms (false = disabled)\n structuralSharing: false, // Deep-compare to preserve object identity\n placeholderData: undefined, // Shown while the first fetch is in progress\n});\n```\n\n### Cache invalidation and optimistic updates\n\n**Same scope as the read**: After a mutation, prefer `refetch()` from the `useApiData` that loads the data (same component or wherever you can pass `refetch`).\n\n```typescript\nimport { useApi, useApiData } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { data: orders, refetch } = useApiData(\"GetOrders\", { status });\nconst { run: createOrder } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n await refetch();\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder, refetch]);\n```\n\n**Cross-scope or broad invalidation**: Use `queryClient.invalidateQueries` when you cannot call that `refetch` (mutation in a different place than the `useApiData`, or you need every cached variant of an API to refetch). For **`queryClient.invalidateQueries`, `buildCacheKey`, `setQueryData`, and any other `queryClient` usage, always import `queryClient` from `@superblocksteam/library`**.\n\n```typescript\nimport { queryClient, useApi } from \"@superblocksteam/library\";\nimport { toast } from \"sonner\";\n\nconst { run: createOrder } = useApi(\"CreateOrder\");\n\nconst handleSubmit = useCallback(async () => {\n try {\n await createOrder({ item, qty });\n await queryClient.invalidateQueries(\"GetOrders\");\n } catch (error) {\n const message =\n error && typeof error === \"object\" && \"message\" in error\n ? String((error as { message: unknown }).message)\n : String(error);\n toast.error(\"Error creating order: \" + message);\n }\n}, [item, qty, createOrder]);\n```\n\n```typescript\n// Optimistic update: set cached data without refetching\nimport { queryClient } from \"@superblocksteam/library\";\n\nconst cacheKey = queryClient.buildCacheKey(\"GetOrders\", { status: \"active\" });\nqueryClient.setQueryData(cacheKey, (old) => ({\n ...old,\n orders: [...old.orders, newOrder],\n}));\n```\n\n### Critical API Rules\n\n1. **MUST call API by exact name**: Format is `<ApiName>` matching folder `apis/<ApiName>/api.yaml`\n2. **Use `useApiData` for data loading, `useApi` for mutations**: For data fetching, use `useApiData(\"GetUsers\", { email })`. Only use `useApi` for event-driven actions (button clicks, form submissions). Use `executeApi` for API calls outside React components.\n3. **Use the hook's state fields**: Do NOT create separate `useState` for loading or response data \u2014 the hooks manage this for you\n4. **ALWAYS check API interfaces**: NEVER guess the response structure\n5. **Include all parameters**: Even optional ones should be passed as `null`\n6. **ALWAYS use try/catch**: In imperative mode, APIs throw errors when they fail - wrap ALL `run()` calls in try/catch blocks. In declarative mode, check the `error` field for failure details.\n\n### File Handling\n\n**CRITICAL: Files must be wrapped in `{ files: [...] }` format:**\n\n```tsx\n// \u2705 CORRECT - Frontend: wrap files in { files: [...] }\nconst response = await runUploadApi({ userFile: { files: selectedFiles } });\n\n// \u274C WRONG - backend cannot process unwrapped files\nconst response = await runUploadApi({ userFile: selectedFiles });\n```\n\n## Platform Hooks and Functions\n\nAvailable hooks and functions from `@superblocksteam/library`:\n\n### User and Group Context\n\n```typescript\nimport {\n useSuperblocksUser,\n useSuperblocksGroups,\n} from \"@superblocksteam/library\";\n\n// Get current user info\nconst user = useSuperblocksUser();\n// user.name, user.email, user.id, user.groups, user.username, user.metadata\n\n// Get organization groups\nconst groups = useSuperblocksGroups();\n```\n\n### Environments and Data Tags\n\nConcepts & terminology:\n\n- `Data tags` are labels for different data segments, such as `Staging`, `Production`, or `us-east`.\n- `Profiles` is the legacy term for the same concept. If a user asks about profiles, treat that as data tags.\n- `Environments` are `Edit`, `Preview`, and `Production`, and each data tag is allowed in one or more of those environments.\n- Clark operates in `Edit` mode, so the data tags visible in app context represent the tags available in `Edit`; do not assume this is the same set that will be available in `Preview` or `Production`.\n- When implementing app code, prefer `useSuperblocksDataTags()`, `dataTags`, and `setDataTag()`.\n\nThe `DataTag` type has these fields (it is an alias for `Profile` from `@superblocksteam/shared`):\n\n```typescript\ntype DataTag = {\n id: string;\n key: string;\n displayName: string; // human-readable label \u2014 use this for display, NOT \"name\"\n description: string;\n type: \"RESERVED\" | \"CUSTOM\";\n};\n```\n\nRelevant hooks and functions:\n\n```typescript\nimport { useSuperblocksDataTags, getAppMode } from \"@superblocksteam/library\";\nimport type { DataTag, DataTags } from \"@superblocksteam/library\";\n\n// Manage data tags\nconst { dataTags, setDataTag } = useSuperblocksDataTags();\n// dataTags.available: DataTag[] \u2014 all tags in the current environment\n// dataTags.selected: DataTag | undefined \u2014 currently active tag (may be undefined)\n// dataTags.default: DataTag \u2014 the default tag\n// setDataTag(dataTag.key) \u2014 switch the active tag by key\n\n// Read the current app mode when reasoning about environment-specific behavior\nconst appMode = getAppMode();\n```\n\nExample \u2014 data tag switcher using a Select:\n\n```tsx\nconst { dataTags, setDataTag } = useSuperblocksDataTags();\n\n<Select value={dataTags?.selected?.key} onValueChange={setDataTag}>\n {dataTags?.available.map((tag) => (\n <SelectItem key={tag.key} value={tag.key}>\n {tag.displayName}\n </SelectItem>\n ))}\n</Select>;\n```\n\n### Embedded Applications\n\n**For embedded applications**, see the `references/embedding.md` file for `useEmbedProperties`, `useEmbedEvent`, and `useEmitEmbedEvent` hooks.\n\n## Logging Out of Integrations\n\nWhen building a \"Log out\" or \"Sign out\" button for apps that use OAuth-like integrations, use `logoutIntegrations` from the library to clear OAuth tokens:\n\n```typescript\nimport { logoutIntegrations } from \"@superblocksteam/library\";\n\nconst handleLogout = async () => {\n await logoutIntegrations();\n // Optionally redirect or show confirmation\n};\n```\n\n## Application Architecture\n\n### App.tsx Layout Structure\n\n**For single-page applications:**\n\n- Put all content in `pages/<pageName>/index.tsx`\n- Use components to compose and build the page\n- Keep `App.tsx` minimal with just `<AppProvider>` and `<Outlet />`\n\n**For multi-page applications:**\n\n- Put shared navigation/layout in `App.tsx` (sidebars, headers, footers)\n- Always include `<Outlet />` for page content\n- Always include `<AppProvider />` wrapper\n- Individual pages focus on content, not layout\n\n```tsx\n// \u2705 CORRECT - Multi-page App.tsx layout\n<AppProvider>\n <div className=\"flex flex-row size-screen\">\n {/* Sidebar - persistent across all pages */}\n <div className=\"flex bg-sidebar border-r w-[250px]\">\n <Navigation />\n </div>\n\n {/* Main content area */}\n <div className=\"flex flex-1 h-full flex-col\">\n {/* Header - persistent across all pages */}\n <div className=\"flex bg-header border-b h-[60px]\">\n <Header />\n </div>\n\n {/* Page content area */}\n <div className=\"flex p-4 flex-1 overflow-auto\">\n <Outlet />\n </div>\n </div>\n </div>\n</AppProvider>\n```\n\n**PROTECTED: NEVER remove `<AppProvider>` or `<Outlet />` from App.tsx!**\n\n### Page Structure\n\n```tsx\n// \u2705 CORRECT - Page focuses on content only\n<div className=\"flex flex-col gap-4 size-screen overflow-auto\">\n <h1 className=\"text-3xl font-bold\">Dashboard Content</h1>\n <Card>{/* Page-specific content */}</Card>\n</div>\n```\n\n**IMPORTANT**: The first div on the page must have `overflow-auto` so the user's page can scroll.\n\n## Routing\n\nUse `react-router@7` in data mode. Standard patterns apply:\n\n- `useNavigate()` for programmatic navigation\n- `useParams()` for route parameters\n- `useSearchParams()` for query strings\n\n**If you add new pages or rename files, you MUST update the router.**\n\n## Design System (Tailwind CSS v4)\n\n**All design tokens are defined in `index.css`**. Apps come with a professional black-and-white theme by default.\n\n### Semantic Tokens Rule\n\n**ALWAYS use semantic tokens** \u2014 NEVER raw Tailwind utilities:\n\n```tsx\n// \u2705 CORRECT\n<Card className=\"bg-background text-foreground border border-border\" />\n\n// \u274C WRONG\n<Card className=\"bg-white text-black border-gray-200\" />\n```\n\n### When to Modify index.css\n\nOnly modify when:\n\n- User explicitly requests branding/theme changes\n- Replicating a specific brand look (e.g., Yelp, Instacart)\n- Feature requests (lists, filters, CRUD) do NOT require changes\n\n**Modification Rules:**\n\n- All colors must be in OKLCH format\n- Use semantic names (`--color-warning`, `--shadow-elevated`)\n- Do not remove or rename existing tokens\n- Limit color palette to 5 colors max\n- Avoid gradients unless explicitly requested\n- Minimal font sizes (3 max: body, section heading, main heading)\n\n### Component Variants\n\nUse or create variants instead of one-off styles:\n\n```tsx\n// \u274C WRONG - Hacky inline overrides\n<Button className=\"text-white border-white hover:bg-white\" />\n\n// \u2705 CORRECT - Use a variant\n<Button variant=\"secondary\" />\n```\n\n## Icons\n\nUse icons from Lucide React library:\n\n```tsx\nimport { Icon } from \"@/components/ui/icon\";\n<Icon icon=\"heart\" />;\n\nimport { Button } from \"@/components/ui/button\";\n<Button>\n <Icon icon=\"plus\" /> Add Item\n</Button>;\n```\n\n**Always use icons rather than emojis unless explicitly requested.**\n\n## Custom Components\n\n**CRITICAL: Component composition is MANDATORY. DO NOT create monolithic pages.**\n\n### The Composition Rule\n\nWhen building ANY feature:\n\n1. **First**, identify reusable parts (list items, cards, forms, filters, headers)\n2. **Then**, create separate component files\n3. **Finally**, compose them together in the page\n\n### When to Create Components\n\n- **Rendering any list** - Extract to a component\n- **Building cards/complex UI** - Each card type is a component\n- **Creating forms** - Form sections are components\n- **Adding filters/headers** - These are components\n- **Page has >50 lines JSX** - Break it down\n\n### Component Boundary Rules\n\n**Inside a custom component:**\n\n- \u2705 Use React hooks (useState, useReducer, useEffect, etc.)\n- \u2705 Use local React state\n- \u2705 Use internal helper components\n- \u2705 Use other registered components\n- \u274C CANNOT call APIs - must pass data into the component\n\n### Example: Proper Component Structure\n\n```tsx\n// components/ProductCard/index.tsx - Extract to component\nimport { Card } from \"@/components/ui/card\";\nimport { Button } from \"@/components/ui/button\";\n\ntype ProductCardProps = {\n product: {\n id: string;\n name: string;\n image: string;\n };\n};\n\nexport default function ProductCard(props: ProductCardProps) {\n return (\n <Card>\n <img src={props.product.image} />\n <h3 className=\"text-lg font-semibold\">{props.product.name}</h3>\n <Button>Add</Button>\n </Card>\n );\n}\n\n// pages/Products/index.tsx - Clean composition\nimport ProductCard from \"@/components/ProductCard\";\n\nconst ProductsPage = () => {\n const [products, setProducts] = useState([]);\n\n return (\n <div className=\"grid grid-cols-3 gap-4\">\n {products.map((p) => (\n <ProductCard key={p.id} product={p} />\n ))}\n </div>\n );\n};\n```\n\n## Visual Excellence\n\n**Prioritize visual excellence from the start:**\n\n1. **Design System Enhancement**: Start by enhancing `index.css` with app-specific colors that match the target aesthetic\n2. **Professional Layout Architecture**: Use sophisticated layouts with proper spacing, responsive design\n3. **Rich Interactive Components**: Leverage advanced components with proper variants and states\n4. **Visual Polish**: Add shadows, smooth transitions, skeleton loaders, hover effects, typography hierarchy\n5. **Real-World UI Patterns**: Create layouts that feel like professional applications\n\n**Make applications that look and feel like real, polished products - not basic wireframes.**\n\n### Loading States\n\n**Always represent initial loading with skeletons (shimmers), not spinners or empty screens.**\n\n**Always show a loading indicator when refetching data** (e.g. after filter/search changes). Use `fetching` from `useApiData` to visually indicate that fresh data is being fetched while keeping the current data visible.\n\n```tsx\n// \u2705 CORRECT \u2014 skeleton for first load, overlay for refetch\nconst { data, loading, fetching, isError, error } = useApiData(\"GetOrders\", {\n status: statusFilter,\n search,\n});\n\nif (loading) return <Skeleton />;\nif (isError) return <ErrorBanner error={error} />;\nreturn (\n <div className={fetching ? \"opacity-50 pointer-events-none\" : \"\"}>\n <OrderTable orders={data.orders} />\n </div>\n);\n```\n\n```tsx\n// \u274C WRONG \u2014 no loading feedback when filters change\nconst { data, loading } = useApiData(\"GetOrders\", {\n status: statusFilter,\n search,\n});\n\nif (loading) return <Skeleton />;\nreturn <OrderTable orders={data.orders} />;\n```\n\n### Efficient Loading Patterns\n\n1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a visual loading indicator while new data loads. Use `fetching` from useApiData.\n2. **Loading State Hierarchy**:\n - No data yet (`loading`) \u2192 Full skeleton placeholder\n - Has data, refetching (`fetching` && !`loading`) \u2192 Keep showing current data with a loading overlay (e.g. reduced opacity, inline spinner)\n - Error state (`isError`) \u2192 Show error with retry option, optionally keep stale data visible\n3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession\n4. **Use useApiData for automatic refetching**: `useApiData` auto-refetches when inputs change and supports `staleTime`, `refetchOnWindowFocus`, `refetchOnReconnect`, `refetchInterval`, and `retry` options.\n\n## Performance Rules\n\n### 1. ALWAYS Paginate Tables and Lists\n\n**NEVER render more than 50 rows without pagination.** Always add client-side pagination:\n\n```tsx\nfunction PaginatedTable({ data }: { data: any[] }) {\n const PAGE_SIZE = 20;\n const [page, setPage] = useState(0);\n const totalPages = Math.ceil(data.length / PAGE_SIZE);\n const pageData = useMemo(\n () => data.slice(page * PAGE_SIZE, (page + 1) * PAGE_SIZE),\n [data, page],\n );\n\n useEffect(() => {\n setPage(0);\n }, [data.length]);\n\n return (\n <>\n <Table>{/* render pageData rows */}</Table>\n <span>\n Page {page + 1} of {totalPages} ({data.length} total rows)\n </span>\n <Button\n onClick={() => setPage((p) => Math.max(0, p - 1))}\n disabled={page === 0}\n >\n Previous\n </Button>\n <Button\n onClick={() => setPage((p) => Math.min(totalPages - 1, p + 1))}\n disabled={page >= totalPages - 1}\n >\n Next\n </Button>\n </>\n );\n}\n```\n\nFor 200+ rows, prefer **server-side pagination**; use cursor/keyset pagination for high offsets instead of `LIMIT`/`OFFSET`.\n\nFor 500+ item lists where pagination doesn't fit the UX (chat messages, infinite scroll feeds, large dropdowns), use **virtualization** (`react-virtuoso` or `@tanstack/react-virtual`) to render only the items visible in the viewport.\n\n### 2. ALWAYS Debounce Input-Driven API Calls\n\n**NEVER call an API directly from onChange.** Debounce search/filter inputs with a 300ms timer:\n\n```tsx\nfunction DebouncedSearch({ onSearch }: { onSearch: (query: string) => void }) {\n const [localValue, setLocalValue] = useState(\"\");\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setLocalValue(e.target.value);\n clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => onSearch(e.target.value), 300);\n },\n [onSearch],\n );\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n return (\n <Input value={localValue} onChange={handleChange} placeholder=\"Search...\" />\n );\n}\n```\n\n### 3. Memoize Expensive Renders\n\nUse memoization (`memo()`, `useMemo`, `useCallback`) when it prevents measurable re-renders or expensive recomputation:\n\n```tsx\nconst OrderRow = memo(function OrderRow({\n order,\n onSelect,\n}: {\n order: Order;\n onSelect: (id: string) => void;\n}) {\n return (\n <TableRow onClick={() => onSelect(order.id)}>\n <TableCell>{order.id}</TableCell>...\n </TableRow>\n );\n});\n\nconst handleSelect = useCallback((id: string) => {\n setSelectedId(id);\n}, []);\n\nconst filtered = useMemo(\n () =>\n orders.filter((o) => o.status === status).sort((a, b) => b.total - a.total),\n [orders, status],\n);\n```\n\n### 4. ALWAYS Clean Up Side Effects\n\nClean up timers, event listeners, and subscriptions in `useEffect` return functions:\n\n```tsx\nuseEffect(() => {\n const handler = (e: KeyboardEvent) => {\n /* ... */\n };\n window.addEventListener(\"keydown\", handler);\n return () => window.removeEventListener(\"keydown\", handler);\n}, []);\n```\n\n### 5. Cancel In-Flight API Requests on Unmount\n\nFor search/filter patterns, prefer `useApiData` \u2014 it handles cancellation and cleanup automatically:\n\n```tsx\n// useApiData: auto-fetches and cancels on unmount/input change\nconst { data, fetching } = useApiData(\"SearchProducts\", { query });\n```\n\nFor imperative usage with manual cleanup, use the `cancel()` function:\n\n```tsx\nconst { run, cancel } = useApi(\"SearchProducts\");\n\nuseEffect(() => {\n if (!query) return;\n run({ query }).catch(console.error);\n return () => {\n cancel().catch(() => {});\n };\n}, [query, run, cancel]);\n```\n";
|
|
2
2
|
//# sourceMappingURL=skill.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,mpsBA4oBnB,CAAC"}
|
|
@@ -25,18 +25,26 @@ This is a React-based web application platform. Use standard React patterns:
|
|
|
25
25
|
|
|
26
26
|
## Using APIs from Frontend
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Three primitives are available from \`@superblocksteam/library\`:
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
- **\`useApiData\`** — declarative reads with SWR caching (preferred for data loading)
|
|
31
|
+
- **\`useApi\`** — imperative mutations (for event-driven actions)
|
|
32
|
+
- **\`executeApi\`** — plain Promise outside React (utility functions, event handlers without hooks)
|
|
33
|
+
|
|
34
|
+
**Data loading** — auto-fetches on mount and when inputs change (preferred for reads):
|
|
31
35
|
|
|
32
36
|
\`\`\`typescript
|
|
33
|
-
import {
|
|
37
|
+
import { useApiData } from "@superblocksteam/library";
|
|
34
38
|
|
|
35
|
-
// Auto-fetches when email or name changes. No useEffect
|
|
36
|
-
|
|
39
|
+
// Auto-fetches when email or name changes. No useEffect or HMR guards needed.
|
|
40
|
+
// IMPORTANT: Always use \`fetching\` to show a loading indicator during refetches.
|
|
41
|
+
const { data, loading, fetching, isError, error } = useApiData("GetUsers", {
|
|
42
|
+
email,
|
|
43
|
+
name,
|
|
44
|
+
});
|
|
37
45
|
\`\`\`
|
|
38
46
|
|
|
39
|
-
**
|
|
47
|
+
**Mutations** — call \`run()\` manually (for event-driven actions like form submissions):
|
|
40
48
|
|
|
41
49
|
\`\`\`typescript
|
|
42
50
|
import { useApi } from "@superblocksteam/library";
|
|
@@ -57,13 +65,97 @@ const handleSubmit = useCallback(async () => {
|
|
|
57
65
|
}, [item, qty, createOrder]);
|
|
58
66
|
\`\`\`
|
|
59
67
|
|
|
60
|
-
|
|
68
|
+
**Outside React** — call APIs as a plain Promise (utility functions, event handlers):
|
|
69
|
+
|
|
70
|
+
\`\`\`typescript
|
|
71
|
+
import { executeApi } from "@superblocksteam/library";
|
|
72
|
+
|
|
73
|
+
const result = await executeApi("GetUsers", { email });
|
|
74
|
+
\`\`\`
|
|
75
|
+
|
|
76
|
+
\`useApiData\` returns \`{ data, loading, fetching, isError, isSuccess, isStale, error, status, fetchStatus, refetch, cancel }\`. \`data\` persists across background refetches (stale-while-revalidate). \`loading\` is true on first fetch with no cached data. \`fetching\` is true during any fetch including background refetch. \`status\` is \`"pending"\` | \`"success"\` | \`"error"\`. \`fetchStatus\` is \`"idle"\` | \`"fetching"\`. \`cancel()\` is synchronous (returns \`void\`).
|
|
77
|
+
|
|
78
|
+
\`useApi\` returns \`{ run, cancel, reset, loading, data, error, status, variables }\`. \`data\` persists across re-runs (shows previous result while loading). \`error\` holds the most recent failure, or \`undefined\` on success. \`status\` is \`"idle"\` | \`"pending"\` | \`"success"\` | \`"error"\`. \`variables\` holds the inputs from the most recent \`run()\`. \`reset()\` clears all state back to idle. HMR double-fetch prevention is built in — no \`useRef\` guard needed.
|
|
79
|
+
|
|
80
|
+
### useApiData Options
|
|
81
|
+
|
|
82
|
+
\`\`\`typescript
|
|
83
|
+
const { data } = useApiData("GetUsers", { email }, {
|
|
84
|
+
enabled: true, // Skip fetching when false (conditional fetching)
|
|
85
|
+
staleTime: 0, // Ms before cached data is considered stale (0 = always refetch)
|
|
86
|
+
retry: 3, // Retry attempts on failure (false to disable)
|
|
87
|
+
retryDelay: (n) => ..., // Custom delay strategy (default: exponential backoff, max 30s)
|
|
88
|
+
refetchOnWindowFocus: false, // Refetch when tab regains focus
|
|
89
|
+
refetchOnReconnect: true, // Refetch when network reconnects
|
|
90
|
+
refetchInterval: false, // Polling interval in ms (false = disabled)
|
|
91
|
+
structuralSharing: false, // Deep-compare to preserve object identity
|
|
92
|
+
placeholderData: undefined, // Shown while the first fetch is in progress
|
|
93
|
+
});
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
### Cache invalidation and optimistic updates
|
|
97
|
+
|
|
98
|
+
**Same scope as the read**: After a mutation, prefer \`refetch()\` from the \`useApiData\` that loads the data (same component or wherever you can pass \`refetch\`).
|
|
99
|
+
|
|
100
|
+
\`\`\`typescript
|
|
101
|
+
import { useApi, useApiData } from "@superblocksteam/library";
|
|
102
|
+
import { toast } from "sonner";
|
|
103
|
+
|
|
104
|
+
const { data: orders, refetch } = useApiData("GetOrders", { status });
|
|
105
|
+
const { run: createOrder } = useApi("CreateOrder");
|
|
106
|
+
|
|
107
|
+
const handleSubmit = useCallback(async () => {
|
|
108
|
+
try {
|
|
109
|
+
await createOrder({ item, qty });
|
|
110
|
+
await refetch();
|
|
111
|
+
} catch (error) {
|
|
112
|
+
const message =
|
|
113
|
+
error && typeof error === "object" && "message" in error
|
|
114
|
+
? String((error as { message: unknown }).message)
|
|
115
|
+
: String(error);
|
|
116
|
+
toast.error("Error creating order: " + message);
|
|
117
|
+
}
|
|
118
|
+
}, [item, qty, createOrder, refetch]);
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
**Cross-scope or broad invalidation**: Use \`queryClient.invalidateQueries\` when you cannot call that \`refetch\` (mutation in a different place than the \`useApiData\`, or you need every cached variant of an API to refetch). For **\`queryClient.invalidateQueries\`, \`buildCacheKey\`, \`setQueryData\`, and any other \`queryClient\` usage, always import \`queryClient\` from \`@superblocksteam/library\`**.
|
|
122
|
+
|
|
123
|
+
\`\`\`typescript
|
|
124
|
+
import { queryClient, useApi } from "@superblocksteam/library";
|
|
125
|
+
import { toast } from "sonner";
|
|
126
|
+
|
|
127
|
+
const { run: createOrder } = useApi("CreateOrder");
|
|
128
|
+
|
|
129
|
+
const handleSubmit = useCallback(async () => {
|
|
130
|
+
try {
|
|
131
|
+
await createOrder({ item, qty });
|
|
132
|
+
await queryClient.invalidateQueries("GetOrders");
|
|
133
|
+
} catch (error) {
|
|
134
|
+
const message =
|
|
135
|
+
error && typeof error === "object" && "message" in error
|
|
136
|
+
? String((error as { message: unknown }).message)
|
|
137
|
+
: String(error);
|
|
138
|
+
toast.error("Error creating order: " + message);
|
|
139
|
+
}
|
|
140
|
+
}, [item, qty, createOrder]);
|
|
141
|
+
\`\`\`
|
|
142
|
+
|
|
143
|
+
\`\`\`typescript
|
|
144
|
+
// Optimistic update: set cached data without refetching
|
|
145
|
+
import { queryClient } from "@superblocksteam/library";
|
|
146
|
+
|
|
147
|
+
const cacheKey = queryClient.buildCacheKey("GetOrders", { status: "active" });
|
|
148
|
+
queryClient.setQueryData(cacheKey, (old) => ({
|
|
149
|
+
...old,
|
|
150
|
+
orders: [...old.orders, newOrder],
|
|
151
|
+
}));
|
|
152
|
+
\`\`\`
|
|
61
153
|
|
|
62
154
|
### Critical API Rules
|
|
63
155
|
|
|
64
156
|
1. **MUST call API by exact name**: Format is \`<ApiName>\` matching folder \`apis/<ApiName>/api.yaml\`
|
|
65
|
-
2. **
|
|
66
|
-
3. **Use
|
|
157
|
+
2. **Use \`useApiData\` for data loading, \`useApi\` for mutations**: For data fetching, use \`useApiData("GetUsers", { email })\`. Only use \`useApi\` for event-driven actions (button clicks, form submissions). Use \`executeApi\` for API calls outside React components.
|
|
158
|
+
3. **Use the hook's state fields**: Do NOT create separate \`useState\` for loading or response data — the hooks manage this for you
|
|
67
159
|
4. **ALWAYS check API interfaces**: NEVER guess the response structure
|
|
68
160
|
5. **Include all parameters**: Even optional ones should be passed as \`null\`
|
|
69
161
|
6. **ALWAYS use try/catch**: In imperative mode, APIs throw errors when they fail - wrap ALL \`run()\` calls in try/catch blocks. In declarative mode, check the \`error\` field for failure details.
|
|
@@ -110,18 +202,49 @@ Concepts & terminology:
|
|
|
110
202
|
- Clark operates in \`Edit\` mode, so the data tags visible in app context represent the tags available in \`Edit\`; do not assume this is the same set that will be available in \`Preview\` or \`Production\`.
|
|
111
203
|
- When implementing app code, prefer \`useSuperblocksDataTags()\`, \`dataTags\`, and \`setDataTag()\`.
|
|
112
204
|
|
|
205
|
+
The \`DataTag\` type has these fields (it is an alias for \`Profile\` from \`@superblocksteam/shared\`):
|
|
206
|
+
|
|
207
|
+
\`\`\`typescript
|
|
208
|
+
type DataTag = {
|
|
209
|
+
id: string;
|
|
210
|
+
key: string;
|
|
211
|
+
displayName: string; // human-readable label — use this for display, NOT "name"
|
|
212
|
+
description: string;
|
|
213
|
+
type: "RESERVED" | "CUSTOM";
|
|
214
|
+
};
|
|
215
|
+
\`\`\`
|
|
216
|
+
|
|
113
217
|
Relevant hooks and functions:
|
|
114
218
|
|
|
115
219
|
\`\`\`typescript
|
|
116
220
|
import { useSuperblocksDataTags, getAppMode } from "@superblocksteam/library";
|
|
221
|
+
import type { DataTag, DataTags } from "@superblocksteam/library";
|
|
117
222
|
|
|
118
223
|
// Manage data tags
|
|
119
224
|
const { dataTags, setDataTag } = useSuperblocksDataTags();
|
|
225
|
+
// dataTags.available: DataTag[] — all tags in the current environment
|
|
226
|
+
// dataTags.selected: DataTag | undefined — currently active tag (may be undefined)
|
|
227
|
+
// dataTags.default: DataTag — the default tag
|
|
228
|
+
// setDataTag(dataTag.key) — switch the active tag by key
|
|
120
229
|
|
|
121
230
|
// Read the current app mode when reasoning about environment-specific behavior
|
|
122
231
|
const appMode = getAppMode();
|
|
123
232
|
\`\`\`
|
|
124
233
|
|
|
234
|
+
Example — data tag switcher using a Select:
|
|
235
|
+
|
|
236
|
+
\`\`\`tsx
|
|
237
|
+
const { dataTags, setDataTag } = useSuperblocksDataTags();
|
|
238
|
+
|
|
239
|
+
<Select value={dataTags?.selected?.key} onValueChange={setDataTag}>
|
|
240
|
+
{dataTags?.available.map((tag) => (
|
|
241
|
+
<SelectItem key={tag.key} value={tag.key}>
|
|
242
|
+
{tag.displayName}
|
|
243
|
+
</SelectItem>
|
|
244
|
+
))}
|
|
245
|
+
</Select>;
|
|
246
|
+
\`\`\`
|
|
247
|
+
|
|
125
248
|
### Embedded Applications
|
|
126
249
|
|
|
127
250
|
**For embedded applications**, see the \`references/embedding.md\` file for \`useEmbedProperties\`, \`useEmbedEvent\`, and \`useEmitEmbedEvent\` hooks.
|
|
@@ -351,17 +474,46 @@ const ProductsPage = () => {
|
|
|
351
474
|
|
|
352
475
|
### Loading States
|
|
353
476
|
|
|
354
|
-
**Always represent loading with skeletons (shimmers), not spinners or empty screens.**
|
|
477
|
+
**Always represent initial loading with skeletons (shimmers), not spinners or empty screens.**
|
|
478
|
+
|
|
479
|
+
**Always show a loading indicator when refetching data** (e.g. after filter/search changes). Use \`fetching\` from \`useApiData\` to visually indicate that fresh data is being fetched while keeping the current data visible.
|
|
480
|
+
|
|
481
|
+
\`\`\`tsx
|
|
482
|
+
// ✅ CORRECT — skeleton for first load, overlay for refetch
|
|
483
|
+
const { data, loading, fetching, isError, error } = useApiData("GetOrders", {
|
|
484
|
+
status: statusFilter,
|
|
485
|
+
search,
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
if (loading) return <Skeleton />;
|
|
489
|
+
if (isError) return <ErrorBanner error={error} />;
|
|
490
|
+
return (
|
|
491
|
+
<div className={fetching ? "opacity-50 pointer-events-none" : ""}>
|
|
492
|
+
<OrderTable orders={data.orders} />
|
|
493
|
+
</div>
|
|
494
|
+
);
|
|
495
|
+
\`\`\`
|
|
496
|
+
|
|
497
|
+
\`\`\`tsx
|
|
498
|
+
// ❌ WRONG — no loading feedback when filters change
|
|
499
|
+
const { data, loading } = useApiData("GetOrders", {
|
|
500
|
+
status: statusFilter,
|
|
501
|
+
search,
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
if (loading) return <Skeleton />;
|
|
505
|
+
return <OrderTable orders={data.orders} />;
|
|
506
|
+
\`\`\`
|
|
355
507
|
|
|
356
508
|
### Efficient Loading Patterns
|
|
357
509
|
|
|
358
|
-
1. **
|
|
510
|
+
1. **Always show loading indicators on refetch**: When inputs change (e.g. filters, search), show a visual loading indicator while new data loads. Use \`fetching\` from useApiData.
|
|
359
511
|
2. **Loading State Hierarchy**:
|
|
360
|
-
-
|
|
361
|
-
- Has data → Keep showing data
|
|
362
|
-
- Error state → Show error with retry option
|
|
512
|
+
- No data yet (\`loading\`) → Full skeleton placeholder
|
|
513
|
+
- Has data, refetching (\`fetching\` && !\`loading\`) → Keep showing current data with a loading overlay (e.g. reduced opacity, inline spinner)
|
|
514
|
+
- Error state (\`isError\`) → Show error with retry option, optionally keep stale data visible
|
|
363
515
|
3. **Debounce Rapid Requests**: Prevent multiple API calls in short succession
|
|
364
|
-
4. **Use
|
|
516
|
+
4. **Use useApiData for automatic refetching**: \`useApiData\` auto-refetches when inputs change and supports \`staleTime\`, \`refetchOnWindowFocus\`, \`refetchOnReconnect\`, \`refetchInterval\`, and \`retry\` options.
|
|
365
517
|
|
|
366
518
|
## Performance Rules
|
|
367
519
|
|
|
@@ -480,11 +632,11 @@ useEffect(() => {
|
|
|
480
632
|
|
|
481
633
|
### 5. Cancel In-Flight API Requests on Unmount
|
|
482
634
|
|
|
483
|
-
For search/filter patterns, prefer
|
|
635
|
+
For search/filter patterns, prefer \`useApiData\` — it handles cancellation and cleanup automatically:
|
|
484
636
|
|
|
485
637
|
\`\`\`tsx
|
|
486
|
-
//
|
|
487
|
-
const {
|
|
638
|
+
// useApiData: auto-fetches and cancels on unmount/input change
|
|
639
|
+
const { data, fetching } = useApiData("SearchProducts", { query });
|
|
488
640
|
\`\`\`
|
|
489
641
|
|
|
490
642
|
For imperative usage with manual cleanup, use the \`cancel()\` function:
|
|
@@ -496,7 +648,7 @@ useEffect(() => {
|
|
|
496
648
|
if (!query) return;
|
|
497
649
|
run({ query }).catch(console.error);
|
|
498
650
|
return () => {
|
|
499
|
-
|
|
651
|
+
cancel().catch(() => {});
|
|
500
652
|
};
|
|
501
653
|
}, [query, run, cancel]);
|
|
502
654
|
\`\`\`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4oBtB,CAAC"}
|
|
@@ -375,6 +375,10 @@ export type ClarkContext = {
|
|
|
375
375
|
id: string;
|
|
376
376
|
payload: AiMessagePush;
|
|
377
377
|
};
|
|
378
|
+
/** Tracks integration action prompt sent after opening setup so responses can be handled deterministically */
|
|
379
|
+
pendingIntegrationActionPrompt?: {
|
|
380
|
+
messageId: string;
|
|
381
|
+
};
|
|
378
382
|
pendingToolPermissionRequest?: {
|
|
379
383
|
messageId: string;
|
|
380
384
|
toolName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clark-fsm.d.ts","sourceRoot":"","sources":["../../../src/ai-service/state-machine/clark-fsm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ID remains stable for truncation/retry operations
|
|
126
126
|
jwt: ctx.jwt,
|
|
127
|
+
// preserve current mode so subsequent prompts retain the correct mode
|
|
128
|
+
// (e.g. BUILD) instead of falling back to undefined and re-planning
|
|
129
|
+
currentMode: ctx.currentMode,
|
|
127
130
|
// clear debug-related state
|
|
128
131
|
debugToolCalled: undefined,
|
|
129
132
|
lastDebugTimestamp: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clark-fsm.js","sourceRoot":"","sources":["../../../src/ai-service/state-machine/clark-fsm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AA+BlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAe/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAsBjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAKhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EACL,SAAS,GAGV,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,GAAG;IACR,IAAI,EAAE,MAAM;IACZ,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;IAC5B,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAGjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AACjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AACvD,MAAM,CAAC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AAE,QAAQ,CAAC,aAAa;SACtC,CAAC,CAAC;QACH,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,UAAU,CAAC,WAAW,CAC1B,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,EACpC,KAAK,CAAC,iBAAiB,CACxB,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,eAAe,CAAC,KAAkC;QACxD,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QACzD,MAAM,WAAW,GACf,qBAAqB;YACrB,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,CAAC;YAC5B,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;QAE5B,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,YAAY,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAEtE,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI;aACzB,iBAAiB,CAAC,EAAE,WAAW,EAAE,CAAC;aAClC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,6BAA6B,EAC7B,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CACrC,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-planning.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/state-machine/handlers/agent-planning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-planning.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/state-machine/handlers/agent-planning.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAKV,KAAK,EACL,uBAAuB,EACvB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAkEzB,eAAO,MAAM,eAAe,GAC1B,OAAO,KAAK,EACZ,QAAQ,uBAAuB,MAqFjB,WAAW,eAAe,KAAG,OAAO,CAAC,IAAI,CAwsBxD,CAAC"}
|