@nocobase/plugin-ai 2.0.0-alpha.52 → 2.0.0-alpha.54
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/build.config.ts +14 -0
- package/dist/client/adcb0e115e38e1a9.js +10 -0
- package/dist/client/ai-employees/admin/SystemPrompt.d.ts +10 -0
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +11 -11
- package/dist/locale/en-US.json +5 -0
- package/dist/locale/zh-CN.json +5 -0
- package/dist/node_modules/@langchain/anthropic/package.json +1 -1
- package/dist/node_modules/@langchain/core/package.json +1 -1
- package/dist/node_modules/@langchain/deepseek/package.json +1 -1
- package/dist/node_modules/@langchain/google-genai/package.json +1 -1
- package/dist/node_modules/@langchain/ollama/index.cjs +1 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/Options.js +0 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/Refs.js +0 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/index.js +0 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parseDef.js +11 -5
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/any.js +2 -16
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/effects.js +1 -2
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/map.js +2 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/never.js +4 -10
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/object.js +2 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/optional.js +2 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/record.js +1 -2
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/undefined.js +2 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/parsers/unknown.js +2 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/selectParser.js +4 -4
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/zodToJsonSchema.js +3 -24
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/Options.js +0 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/Refs.js +0 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/index.js +0 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parseDef.js +10 -4
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +2 -16
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +1 -2
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +2 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +4 -10
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +2 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +2 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +1 -2
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +2 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +2 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/selectParser.js +4 -4
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +3 -24
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/Options.d.ts +0 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/Refs.d.ts +0 -3
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/errorMessages.d.ts +1 -5
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/index.d.ts +0 -1
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/parsers/any.d.ts +2 -5
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/parsers/never.d.ts +2 -4
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/parsers/undefined.d.ts +2 -4
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/parsers/unknown.d.ts +2 -4
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/package.json +1 -1
- package/dist/node_modules/@langchain/ollama/package.json +1 -1
- package/dist/node_modules/@langchain/openai/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/node_modules/zod-to-json-schema/package.json +1 -1
- package/dist/server/ai-employees/ai-employee.js +1 -1
- package/dist/server/ai-employees/built-in/ai-coding/prompt.js +14 -140
- package/dist/server/ai-employees/built-in/ai-coding/prompt_en.md +232 -0
- package/dist/server/ai-employees/built-in/data-modeling/prompt.js +4 -0
- package/dist/server/ai-employees/built-in/data-visualization/prompt.js +1 -1
- package/dist/server/ai-employees/built-in/email-assistant/prompt.js +1 -1
- package/dist/server/ai-employees/built-in/insights-analyst/prompt.js +1 -1
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.js +11 -11
- package/dist/server/ai-employees/built-in/research-analyst/prompt.js +2 -4
- package/dist/server/ai-employees/built-in/translator/prompt.js +1 -1
- package/dist/server/llm-providers/anthropic.d.ts +2 -1
- package/dist/server/llm-providers/anthropic.js +2 -2
- package/dist/server/llm-providers/google-genai.d.ts +2 -1
- package/dist/server/llm-providers/google-genai.js +2 -2
- package/dist/server/llm-providers/provider.d.ts +2 -1
- package/dist/server/llm-providers/provider.js +2 -2
- package/dist/server/manager/ai-chat-conversation.js +1 -1
- package/dist/server/manager/built-in-manager.js +1 -1
- package/dist/server/resource/aiConversations.js +1 -1
- package/dist/server/resource/aiEmployees.d.ts +1 -0
- package/dist/server/resource/aiEmployees.js +15 -0
- package/dist/server/utils.d.ts +1 -1
- package/dist/server/utils.js +11 -2
- package/package.json +2 -2
- package/dist/client/bb7201dafbb7c875.js +0 -10
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/cjs/getRelativePath.js +0 -12
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +0 -8
- package/dist/node_modules/@langchain/ollama/node_modules/zod-to-json-schema/dist/types/getRelativePath.d.ts +0 -1
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Refs } from "../Refs.js";
|
|
2
|
-
import { JsonSchema7AnyType } from "./any.js";
|
|
3
1
|
export type JsonSchema7NeverType = {
|
|
4
|
-
not:
|
|
2
|
+
not: {};
|
|
5
3
|
};
|
|
6
|
-
export declare function parseNeverDef(
|
|
4
|
+
export declare function parseNeverDef(): JsonSchema7NeverType;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Refs } from "../Refs.js";
|
|
2
|
-
import { JsonSchema7AnyType } from "./any.js";
|
|
3
1
|
export type JsonSchema7UndefinedType = {
|
|
4
|
-
not:
|
|
2
|
+
not: {};
|
|
5
3
|
};
|
|
6
|
-
export declare function parseUndefinedDef(
|
|
4
|
+
export declare function parseUndefinedDef(): JsonSchema7UndefinedType;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type JsonSchema7UnknownType = JsonSchema7AnyType;
|
|
4
|
-
export declare function parseUnknownDef(refs: Refs): JsonSchema7UnknownType;
|
|
1
|
+
export type JsonSchema7UnknownType = {};
|
|
2
|
+
export declare function parseUnknownDef(): JsonSchema7UnknownType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@langchain/ollama","version":"0.1.6","description":"Ollama integration for LangChain.js","type":"module","engines":{"node":">=18"},"main":"./index.js","types":"./index.d.ts","repository":{"type":"git","url":"git@github.com:langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-ollama/","scripts":{"build":"yarn turbo:command build:internal --filter=@langchain/ollama","build:internal":"yarn lc_build --create-entrypoints --pre --tree-shaking","lint:eslint":"NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/","lint:dpdm":"dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts","lint":"yarn lint:eslint && yarn lint:dpdm","lint:fix":"yarn lint:eslint --fix && yarn lint:dpdm","clean":"rm -rf .turbo dist/","prepack":"yarn build","test":"NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%","test:watch":"NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts","test:single":"NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000","test:int":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%","format":"prettier --config .prettierrc --write \"src\"","format:check":"prettier --config .prettierrc --check \"src\""},"author":"LangChain","license":"MIT","dependencies":{"ollama":"^0.5.12","uuid":"^10.0.0","zod":"^3.24.1","zod-to-json-schema":"^3.24.1"},"peerDependencies":{"@langchain/core":">=0.2.21 <0.4.0"},"devDependencies":{"@jest/globals":"^29.5.0","@langchain/core":"workspace:*","@langchain/scripts":">=0.1.0 <0.2.0","@langchain/standard-tests":"0.0.0","@swc/core":"^1.3.90","@swc/jest":"^0.2.29","@tsconfig/recommended":"^1.0.3","@typescript-eslint/eslint-plugin":"^6.12.0","@typescript-eslint/parser":"^6.12.0","dotenv":"^16.3.1","dpdm":"^3.12.0","eslint":"^8.33.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.27.5","eslint-plugin-no-instanceof":"^1.0.1","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-environment-node":"^29.6.4","prettier":"^2.8.3","release-it":"^17.6.0","rollup":"^4.5.2","ts-jest":"^29.1.0","typescript":"<5.2.0"},"publishConfig":{"access":"public"},"exports":{".":{"types":{"import":"./index.d.ts","require":"./index.d.cts","default":"./index.d.ts"},"import":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"files":["dist/","index.cjs","index.js","index.d.ts","index.d.cts"],"_lastModified":"2025-12-
|
|
1
|
+
{"name":"@langchain/ollama","version":"0.1.6","description":"Ollama integration for LangChain.js","type":"module","engines":{"node":">=18"},"main":"./index.js","types":"./index.d.ts","repository":{"type":"git","url":"git@github.com:langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-ollama/","scripts":{"build":"yarn turbo:command build:internal --filter=@langchain/ollama","build:internal":"yarn lc_build --create-entrypoints --pre --tree-shaking","lint:eslint":"NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/","lint:dpdm":"dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts","lint":"yarn lint:eslint && yarn lint:dpdm","lint:fix":"yarn lint:eslint --fix && yarn lint:dpdm","clean":"rm -rf .turbo dist/","prepack":"yarn build","test":"NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%","test:watch":"NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts","test:single":"NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000","test:int":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%","format":"prettier --config .prettierrc --write \"src\"","format:check":"prettier --config .prettierrc --check \"src\""},"author":"LangChain","license":"MIT","dependencies":{"ollama":"^0.5.12","uuid":"^10.0.0","zod":"^3.24.1","zod-to-json-schema":"^3.24.1"},"peerDependencies":{"@langchain/core":">=0.2.21 <0.4.0"},"devDependencies":{"@jest/globals":"^29.5.0","@langchain/core":"workspace:*","@langchain/scripts":">=0.1.0 <0.2.0","@langchain/standard-tests":"0.0.0","@swc/core":"^1.3.90","@swc/jest":"^0.2.29","@tsconfig/recommended":"^1.0.3","@typescript-eslint/eslint-plugin":"^6.12.0","@typescript-eslint/parser":"^6.12.0","dotenv":"^16.3.1","dpdm":"^3.12.0","eslint":"^8.33.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.27.5","eslint-plugin-no-instanceof":"^1.0.1","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-environment-node":"^29.6.4","prettier":"^2.8.3","release-it":"^17.6.0","rollup":"^4.5.2","ts-jest":"^29.1.0","typescript":"<5.2.0"},"publishConfig":{"access":"public"},"exports":{".":{"types":{"import":"./index.d.ts","require":"./index.d.cts","default":"./index.d.ts"},"import":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"files":["dist/","index.cjs","index.js","index.d.ts","index.d.cts"],"_lastModified":"2025-12-17T02:00:12.675Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@langchain/openai","version":"0.6.13","description":"OpenAI integrations for LangChain.js","type":"module","engines":{"node":">=18"},"main":"./index.js","types":"./index.d.ts","repository":{"type":"git","url":"git@github.com:langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-openai/","scripts":{"build":"yarn turbo:command build:internal --filter=@langchain/openai","build:internal":"yarn lc_build --create-entrypoints --pre --tree-shaking","lint:eslint":"NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/","lint:dpdm":"dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts","lint":"yarn lint:eslint && yarn lint:dpdm","lint:fix":"yarn lint:eslint --fix && yarn lint:dpdm","clean":"rm -rf .turbo dist/","prepack":"yarn build","test":"NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%","test:watch":"NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts","test:single":"NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000","test:int":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%","test:standard:unit":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.standard\\.test.ts --testTimeout 100000 --maxWorkers=50%","test:standard:int":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.standard\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%","test:standard":"yarn test:standard:unit && yarn test:standard:int","format":"prettier --config .prettierrc --write \"src\"","format:check":"prettier --config .prettierrc --check \"src\""},"author":"LangChain","license":"MIT","dependencies":{"js-tiktoken":"^1.0.12","openai":"5.12.2","zod":"^3.25.32"},"peerDependencies":{"@langchain/core":">=0.3.68 <0.4.0"},"devDependencies":{"@azure/identity":"^4.2.1","@jest/globals":"^29.5.0","@langchain/core":"workspace:*","@langchain/scripts":">=0.1.0 <0.2.0","@langchain/standard-tests":"0.0.0","@swc/core":"^1.3.90","@swc/jest":"^0.2.29","dpdm":"^3.14.0","eslint":"^8.33.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"^27.6.0","eslint-plugin-no-instanceof":"^1.0.1","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-environment-node":"^29.6.4","prettier":"^2.8.3","release-it":"^18.1.2","rimraf":"^5.0.1","ts-jest":"^29.1.0","typescript":"~5.8.3"},"publishConfig":{"access":"public"},"keywords":["llm","ai","gpt3","chain","prompt","prompt engineering","chatgpt","machine learning","ml","openai","embeddings","vectorstores"],"exports":{".":{"types":{"import":"./index.d.ts","require":"./index.d.cts","default":"./index.d.ts"},"import":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"files":["dist/","index.cjs","index.js","index.d.ts","index.d.cts"],"_lastModified":"2025-12-
|
|
1
|
+
{"name":"@langchain/openai","version":"0.6.13","description":"OpenAI integrations for LangChain.js","type":"module","engines":{"node":">=18"},"main":"./index.js","types":"./index.d.ts","repository":{"type":"git","url":"git@github.com:langchain-ai/langchainjs.git"},"homepage":"https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-openai/","scripts":{"build":"yarn turbo:command build:internal --filter=@langchain/openai","build:internal":"yarn lc_build --create-entrypoints --pre --tree-shaking","lint:eslint":"NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/","lint:dpdm":"dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts","lint":"yarn lint:eslint && yarn lint:dpdm","lint:fix":"yarn lint:eslint --fix && yarn lint:dpdm","clean":"rm -rf .turbo dist/","prepack":"yarn build","test":"NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%","test:watch":"NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts","test:single":"NODE_OPTIONS=--experimental-vm-modules yarn run jest --config jest.config.cjs --testTimeout 100000","test:int":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%","test:standard:unit":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.standard\\.test.ts --testTimeout 100000 --maxWorkers=50%","test:standard:int":"NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.standard\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%","test:standard":"yarn test:standard:unit && yarn test:standard:int","format":"prettier --config .prettierrc --write \"src\"","format:check":"prettier --config .prettierrc --check \"src\""},"author":"LangChain","license":"MIT","dependencies":{"js-tiktoken":"^1.0.12","openai":"5.12.2","zod":"^3.25.32"},"peerDependencies":{"@langchain/core":">=0.3.68 <0.4.0"},"devDependencies":{"@azure/identity":"^4.2.1","@jest/globals":"^29.5.0","@langchain/core":"workspace:*","@langchain/scripts":">=0.1.0 <0.2.0","@langchain/standard-tests":"0.0.0","@swc/core":"^1.3.90","@swc/jest":"^0.2.29","dpdm":"^3.14.0","eslint":"^8.33.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.31.0","eslint-plugin-jest":"^27.6.0","eslint-plugin-no-instanceof":"^1.0.1","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","jest-environment-node":"^29.6.4","prettier":"^2.8.3","release-it":"^18.1.2","rimraf":"^5.0.1","ts-jest":"^29.1.0","typescript":"~5.8.3"},"publishConfig":{"access":"public"},"keywords":["llm","ai","gpt3","chain","prompt","prompt engineering","chatgpt","machine learning","ml","openai","embeddings","vectorstores"],"exports":{".":{"types":{"import":"./index.d.ts","require":"./index.d.cts","default":"./index.d.ts"},"import":"./index.js","require":"./index.cjs"},"./package.json":"./package.json"},"files":["dist/","index.cjs","index.js","index.d.ts","index.d.cts"],"_lastModified":"2025-12-17T02:00:00.447Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2025-12-
|
|
1
|
+
{"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2025-12-17T01:59:52.426Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"zod","version":"3.25.67","type":"module","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","files":["dist","v3","v4","v4-mini"],"funding":"https://github.com/sponsors/colinhacks","homepage":"https://zod.dev","keywords":["typescript","schema","validation","type","inference"],"license":"MIT","sideEffects":false,"main":"./dist/cjs/index.js","types":"./dist/types/index.d.ts","module":"./dist/esm/index.js","exports":{".":{"import":{"@zod/source":"./src/index.ts","types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"@zod/source":"./src/index.ts","types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}},"./v3":{"import":{"@zod/source":"./src/index.ts","types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"@zod/source":"./src/index.ts","types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}},"./v4":{"import":{"@zod/source":"./src/v4/index.ts","types":"./dist/types/v4/index.d.ts","default":"./dist/esm/v4/index.js"},"require":{"@zod/source":"./src/v4/index.ts","types":"./dist/types/v4/index.d.ts","default":"./dist/cjs/v4/index.js"}},"./v4-mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./dist/types/v4/mini/index.d.ts","import":"./dist/esm/v4/mini/index.js","require":"./dist/cjs/v4/mini/index.js"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./dist/types/v4/mini/index.d.ts","import":"./dist/esm/v4/mini/index.js","require":"./dist/cjs/v4/mini/index.js"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./dist/types/v4/core/index.d.ts","import":"./dist/esm/v4/core/index.js","require":"./dist/cjs/v4/core/index.js"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./dist/types/v4/locales/index.d.ts","import":"./dist/esm/v4/locales/index.js","require":"./dist/cjs/v4/locales/index.js"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./dist/types/v4/locales/*","import":"./dist/esm/v4/locales/*","require":"./dist/cjs/v4/locales/*"},"./package.json":"./package.json"},"tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"sourceDialects":["@zod/source"],"exclude":["./src/**/*.test.ts"]},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"rm -rf dist","build":"tsx ./build.mts","postbuild":"pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","bump:beta":"pnpm version \"v$(pnpm pkg get version | jq -r)-beta.$(date +%Y%m%dT%H%M%S)\"","pub:beta":"pnpm bump:beta && pnpm publish --tag next --publish-branch v4 --no-git-checks --dry-run"},"_lastModified":"2025-12-
|
|
1
|
+
{"name":"zod","version":"3.25.67","type":"module","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","files":["dist","v3","v4","v4-mini"],"funding":"https://github.com/sponsors/colinhacks","homepage":"https://zod.dev","keywords":["typescript","schema","validation","type","inference"],"license":"MIT","sideEffects":false,"main":"./dist/cjs/index.js","types":"./dist/types/index.d.ts","module":"./dist/esm/index.js","exports":{".":{"import":{"@zod/source":"./src/index.ts","types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"@zod/source":"./src/index.ts","types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}},"./v3":{"import":{"@zod/source":"./src/index.ts","types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"@zod/source":"./src/index.ts","types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}},"./v4":{"import":{"@zod/source":"./src/v4/index.ts","types":"./dist/types/v4/index.d.ts","default":"./dist/esm/v4/index.js"},"require":{"@zod/source":"./src/v4/index.ts","types":"./dist/types/v4/index.d.ts","default":"./dist/cjs/v4/index.js"}},"./v4-mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./dist/types/v4/mini/index.d.ts","import":"./dist/esm/v4/mini/index.js","require":"./dist/cjs/v4/mini/index.js"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./dist/types/v4/mini/index.d.ts","import":"./dist/esm/v4/mini/index.js","require":"./dist/cjs/v4/mini/index.js"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./dist/types/v4/core/index.d.ts","import":"./dist/esm/v4/core/index.js","require":"./dist/cjs/v4/core/index.js"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./dist/types/v4/locales/index.d.ts","import":"./dist/esm/v4/locales/index.js","require":"./dist/cjs/v4/locales/index.js"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./dist/types/v4/locales/*","import":"./dist/esm/v4/locales/*","require":"./dist/cjs/v4/locales/*"},"./package.json":"./package.json"},"tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"sourceDialects":["@zod/source"],"exclude":["./src/**/*.test.ts"]},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"rm -rf dist","build":"tsx ./build.mts","postbuild":"pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","bump:beta":"pnpm version \"v$(pnpm pkg get version | jq -r)-beta.$(date +%Y%m%dT%H%M%S)\"","pub:beta":"pnpm bump:beta && pnpm publish --tag next --publish-branch v4 --no-git-checks --dry-run"},"_lastModified":"2025-12-17T02:00:13.532Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"zod-to-json-schema","version":"3.24.3","description":"Converts Zod schemas to Json Schemas","types":"./dist/types/index.d.ts","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","exports":{"import":{"types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}},"scripts":{"build:test":"npm --prefix ./dist-test test","build:types":"tsc -p tsconfig.types.json","build:cjs":"tsc -p tsconfig.cjs.json && tsx postcjs.ts","build:esm":"tsc -p tsconfig.esm.json && tsx postesm.ts","build":"npm i && npm run gen && npm test && rimraf ./dist && npm run build:types && npm run build:cjs && npm run build:esm && npm run build:test","dry":"npm run build && npm pub --dry-run","test:watch":"tsx watch test/index.ts","test:gen":"tsx test/createIndex.ts","test":"tsx test/index.ts","gen":"tsx createIndex.ts"},"c8":{"exclude":["createIndex.ts","postcjs.ts","postesm.ts","test"]},"keywords":["zod","json","schema","open","api","conversion"],"author":"Stefan Terdell","contributors":["Hammad Asif (https://github.com/mrhammadasif)","Noah Rosenzweig (https://github.com/Noah2610)","John Wright (https://github.com/johngeorgewright)","Krzysztof Ciombor (https://github.com/krzysztofciombor)","Yuta Mombetsu (https://github.com/mokocm)","Tom Arad (https://github.com/tomarad)","Isaac Way (https://github.com/iway1)","Andreas Berger (https://github.com/Andy2003)","Jan Potoms (https://github.com/Janpot)","Santiago Cammi (https://github.com/scammi)","Philipp Burckhardt (https://github.com/Planeshifter)","Bram del Canho (https://github.com/Bram-dc)","Gilad Hecht (https://github.com/gthecht)","Colin McDonnell (https://github.com/colinhacks)","Spappz (https://github.com/Spappz)","Jacob Lee (https://github.com/jacoblee93)","Brett Zamir (https://github.com/brettz9)","Isaiah Marc Sanchez (https://github.com/imsanchez)","Mitchell Merry (https://github.com/mitchell-merry)","Enzo Monjardín (https://github.com/enzomonjardin)","Víctor Hernández (https://github.com/NanezX)"],"repository":{"type":"git","url":"https://github.com/StefanTerdell/zod-to-json-schema"},"license":"ISC","peerDependencies":{"zod":"^3.24.1"},"devDependencies":{"@types/json-schema":"^7.0.9","@types/node":"^20.9.0","ajv":"^8.6.3","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fast-diff":"^1.3.0","local-ref-resolver":"^0.2.0","rimraf":"^3.0.2","tsx":"^4.19.0","typescript":"^5.1.3","zod":"^3.24.1"},"_lastModified":"2025-12-
|
|
1
|
+
{"name":"zod-to-json-schema","version":"3.24.3","description":"Converts Zod schemas to Json Schemas","types":"./dist/types/index.d.ts","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","exports":{"import":{"types":"./dist/types/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/types/index.d.ts","default":"./dist/cjs/index.js"}},"scripts":{"build:test":"npm --prefix ./dist-test test","build:types":"tsc -p tsconfig.types.json","build:cjs":"tsc -p tsconfig.cjs.json && tsx postcjs.ts","build:esm":"tsc -p tsconfig.esm.json && tsx postesm.ts","build":"npm i && npm run gen && npm test && rimraf ./dist && npm run build:types && npm run build:cjs && npm run build:esm && npm run build:test","dry":"npm run build && npm pub --dry-run","test:watch":"tsx watch test/index.ts","test:gen":"tsx test/createIndex.ts","test":"tsx test/index.ts","gen":"tsx createIndex.ts"},"c8":{"exclude":["createIndex.ts","postcjs.ts","postesm.ts","test"]},"keywords":["zod","json","schema","open","api","conversion"],"author":"Stefan Terdell","contributors":["Hammad Asif (https://github.com/mrhammadasif)","Noah Rosenzweig (https://github.com/Noah2610)","John Wright (https://github.com/johngeorgewright)","Krzysztof Ciombor (https://github.com/krzysztofciombor)","Yuta Mombetsu (https://github.com/mokocm)","Tom Arad (https://github.com/tomarad)","Isaac Way (https://github.com/iway1)","Andreas Berger (https://github.com/Andy2003)","Jan Potoms (https://github.com/Janpot)","Santiago Cammi (https://github.com/scammi)","Philipp Burckhardt (https://github.com/Planeshifter)","Bram del Canho (https://github.com/Bram-dc)","Gilad Hecht (https://github.com/gthecht)","Colin McDonnell (https://github.com/colinhacks)","Spappz (https://github.com/Spappz)","Jacob Lee (https://github.com/jacoblee93)","Brett Zamir (https://github.com/brettz9)","Isaiah Marc Sanchez (https://github.com/imsanchez)","Mitchell Merry (https://github.com/mitchell-merry)","Enzo Monjardín (https://github.com/enzomonjardin)","Víctor Hernández (https://github.com/NanezX)"],"repository":{"type":"git","url":"https://github.com/StefanTerdell/zod-to-json-schema"},"license":"ISC","peerDependencies":{"zod":"^3.24.1"},"devDependencies":{"@types/json-schema":"^7.0.9","@types/node":"^20.9.0","ajv":"^8.6.3","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","fast-diff":"^1.3.0","local-ref-resolver":"^0.2.0","rimraf":"^3.0.2","tsx":"^4.19.0","typescript":"^5.1.3","zod":"^3.24.1"},"_lastModified":"2025-12-17T02:00:14.208Z"}
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,151 +25,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
27
|
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var prompt_exports = {};
|
|
28
38
|
__export(prompt_exports, {
|
|
29
39
|
default: () => prompt_default
|
|
30
40
|
});
|
|
31
41
|
module.exports = __toCommonJS(prompt_exports);
|
|
42
|
+
var import_fs = __toESM(require("fs"));
|
|
43
|
+
var import_path = __toESM(require("path"));
|
|
44
|
+
const promptEn = import_fs.default.readFileSync(import_path.default.join(__dirname, "prompt_en.md"), "utf-8");
|
|
32
45
|
var prompt_default = {
|
|
33
|
-
"en-US":
|
|
34
|
-
|
|
35
|
-
NocoBase is an AI-driven lightweight, extremely extensible open source no-code and low-code development platform.
|
|
36
|
-
|
|
37
|
-
You help users design or improve javascript code, html, css write in components which support 'runJS' lib,
|
|
38
|
-
like 'JSBlockModel', 'JSFieldModel', 'JSColumnModel', 'JSItemModel', 'JSFormActionModel', 'JSRecordActionModel', 'JSCollectionActionModel', 'Linkage rules', 'Eventflow'.
|
|
39
|
-
|
|
40
|
-
You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question. Each time the USER sends a message, we may automatically attach some information about their current state, This information may or may not be relevant to the coding task, it is up for you to decide.
|
|
41
|
-
|
|
42
|
-
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag. You should analyze the user's input carefully, think step by step, and determine whether an additional tool is required to complete the task or if you can respond directly. Set a flag accordingly, then propose effective solutions and either call a suitable tool with the input parameters or provide a response for the user.
|
|
43
|
-
|
|
44
|
-
<work_flow>
|
|
45
|
-
1. First, refer to the documentation related to the current component being written, and base the code writing on the examples in the documentation.
|
|
46
|
-
2. Extract key information such as Resource (REST API endpoints) or Collection (database table names, entity names) from the user's input text. Then, call the relevant tools to retrieve the corresponding metadata. Based on this metadata, assist the user in writing entirely new code or modifying existing code.
|
|
47
|
-
3. Collection (database table name, entity name) and Collection field are, in most cases, equivalent to the Resource (REST API endpoint) name, and can be used as API call endpoints.
|
|
48
|
-
4. Before writing any code, call listCodeSnippet to check which snippets are available.
|
|
49
|
-
5. Call getCodeSnippet to retrieve their content. Use these snippets as your main reference when implementing your solution. You may adapt or extend the snippets, but your implementation should stay consistent with them. Only write new code when the snippets are insufficient to cover the task.
|
|
50
|
-
6. Always output the complete code to the user; do not output partial code snippets. Note that this code runs in a frontend sandbox, so do not introduce any external dependencies. Output the code to implement the complete logic without splitting it into multiple files, modules, or libraries\u2014write all the code and implement all the logic in a single file. The code needs to include clear comments, and pay attention to the correctness of the code format, ensuring it does not contain any extra or illegal characters. Always output the code block last, and place it at the very end of your response text.
|
|
51
|
-
</work_flow>
|
|
52
|
-
|
|
53
|
-
<sandbox_code_rules>
|
|
54
|
-
All generated JavaScript, HTML, and CSS must be **syntactically correct** and **error-free**.
|
|
55
|
-
Follow ECMAScript, HTML5, and CSS3 syntax strictly.
|
|
56
|
-
Never produce malformed tags, unclosed quotes, or unbalanced brackets.
|
|
57
|
-
|
|
58
|
-
In addition to the general coding behavior described above, you are specifically designed to generate **self-contained JavaScript code** that runs **safely inside a SES(Secure EcmaScript) environment**. Follow these strict rules:
|
|
59
|
-
|
|
60
|
-
1. **Single-file constraint**
|
|
61
|
-
\u2014 The generated code must be contained entirely within one \`.js\` file.
|
|
62
|
-
- JavaScript, HTML, and CSS must all be included together in the same file.
|
|
63
|
-
2. **No external dependencies**
|
|
64
|
-
\u2014 Do not import, require, or reference any external packages, libraries, or CDN assets.
|
|
65
|
-
3. **HTML and CSS embedding**
|
|
66
|
-
- HTML and CSS must be defined within JavaScript using string concatenation or template literals.
|
|
67
|
-
- Inject them dynamically into the DOM (for example, using \`document.body.innerHTML = ...\` or by creating and appending DOM nodes).
|
|
68
|
-
4. **Security compliance**
|
|
69
|
-
- Never use \`eval\`, \`new Function()\`, or any form of dynamic code execution.
|
|
70
|
-
- Avoid inserting unsanitized user input into the DOM.
|
|
71
|
-
5. **Code quality** \u2014
|
|
72
|
-
- Use clear, descriptive variable and function names.
|
|
73
|
-
- Keep structure modular and logical within the single file.
|
|
74
|
-
- Include concise comments explaining purpose or behavior where needed.
|
|
75
|
-
6. **Inline styling only** \u2014
|
|
76
|
-
- All visual styles must be written as inline styles directly on elements (e.g., using style="..." attributes or element.style in JavaScript).
|
|
77
|
-
- Do not use CSS classes or external <style> blocks.
|
|
78
|
-
</sandbox_code_rules>
|
|
79
|
-
|
|
80
|
-
<communication>
|
|
81
|
-
- Be conversational but professional.
|
|
82
|
-
- Refer to the USER in the second person and yourself in the first person.
|
|
83
|
-
- Format your responses in markdown. Use backticks to format file, directory, function, and class names. Use \\( and \\) for inline math, \\[ and \\] for block math.
|
|
84
|
-
- Always ensure **only relevant sections** (code snippets, tables, commands, or structured data) are formatted in valid Markdown with proper fencing.
|
|
85
|
-
- Avoid wrapping the entire message in a single code block. Use Markdown **only where semantically correct** (e.g., \`inline code\`, \`\`\`code fences\`\`\`, lists, tables).
|
|
86
|
-
- Do not add narration comments inside code just to explain actions.
|
|
87
|
-
- When communicating with the user, optimize your writing for clarity and skimmability giving the user the option to read more or less.
|
|
88
|
-
- Ensure code snippets in any assistant message are properly formatted for markdown rendering if used to reference code.
|
|
89
|
-
- NEVER lie or make things up.
|
|
90
|
-
- Refrain from apologizing all the time when results are unexpected. Instead, just try your best to proceed or explain the circumstances to the user without apologizing.
|
|
91
|
-
</communication>
|
|
92
|
-
|
|
93
|
-
<summary_spec>
|
|
94
|
-
At the end of your turn, you should provide a summary.
|
|
95
|
-
|
|
96
|
-
Summarize any changes you made at a high-level and their impact. If the user asked for info, summarize the answer but don't explain your search process. If the user asked a basic query, skip the summary entirely.
|
|
97
|
-
Use concise bullet points for lists; short paragraphs if needed. Use markdown if you need headings.
|
|
98
|
-
Don't repeat the plan.
|
|
99
|
-
Include short code fences only when essential; never fence the entire message.
|
|
100
|
-
Use the <markdown_spec>, link and citation rules where relevant. You must use backticks when mentioning files, directories, functions, etc (e.g. app/components/Card.tsx).
|
|
101
|
-
It's very important that you keep the summary short, non-repetitive, and high-signal, or it will be too long to read. The user can view your full code changes in the editor, so only flag specific code changes that are very important to highlight to the user.
|
|
102
|
-
Don't add headings like "Summary:" or "Update:".
|
|
103
|
-
</summary_spec>
|
|
104
|
-
|
|
105
|
-
<tool_calling>
|
|
106
|
-
### Follow these guidelines regarding tool calls
|
|
107
|
-
- ALWAYS follow the tool call schema exactly as specified and make sure to provide all necessary parameters.
|
|
108
|
-
- The conversation history may refer to tools that are no longer available. NEVER call tools that are not explicitly provided.
|
|
109
|
-
- After you decide to call a tool, include the tool call information and parameters in your response, and I will run the tool for you and provide you with tool call results.
|
|
110
|
-
|
|
111
|
-
### Available Tools
|
|
112
|
-
|
|
113
|
-
- \`getCollectionNames\`: Lists all tables with their internal name and display title. Use this to disambiguate user references.
|
|
114
|
-
- \`getCollectionMetadata\`: Returns detailed field definitions and relationships for specified tables.\`,
|
|
115
|
-
- \`listCodeSnippet\`: list builtin code snippets which can be used to implement the task.\`,
|
|
116
|
-
- \`getCodeSnippet\`: use ref from "listCodeSnippet" to get code snippets content.\`,
|
|
117
|
-
</tool_calling>
|
|
118
|
-
|
|
119
|
-
<code_style>
|
|
120
|
-
IMPORTANT: The code you write will be reviewed by humans; optimize for clarity and readability. Write HIGH-VERBOSITY code, even if you have been asked to communicate concisely with the user.
|
|
121
|
-
|
|
122
|
-
### Naming
|
|
123
|
-
- Avoid short variable/symbol names. Never use 1-2 character names
|
|
124
|
-
- Functions should be verbs/verb-phrases, variables should be nouns/noun-phrases
|
|
125
|
-
- Use meaningful variable names as described in Martin's "Clean Code":
|
|
126
|
-
- Descriptive enough that comments are generally not needed
|
|
127
|
-
- Prefer full words over abbreviations
|
|
128
|
-
- Use variables to capture the meaning of complex conditions or operations
|
|
129
|
-
#### Examples (Bad \u2192 Good)
|
|
130
|
-
- genYmdStr \u2192 generateDateString
|
|
131
|
-
- n \u2192 numSuccessfulRequests
|
|
132
|
-
- [key, value] of map \u2192 [userId, user] of userIdToUser
|
|
133
|
-
- resMs \u2192 fetchUserDataResponseMs
|
|
134
|
-
### Static Typed Languages
|
|
135
|
-
- Explicitly annotate function signatures and exported/public APIs
|
|
136
|
-
- Don't annotate trivially inferred variables
|
|
137
|
-
- Avoid unsafe typecasts or types like any
|
|
138
|
-
- Control Flow
|
|
139
|
-
- Use guard clauses/early returns
|
|
140
|
-
- Handle error and edge cases first
|
|
141
|
-
- Avoid unnecessary try/catch blocks
|
|
142
|
-
- NEVER catch errors without meaningful handling
|
|
143
|
-
- Avoid deep nesting beyond 2-3 levels
|
|
144
|
-
### Comments
|
|
145
|
-
- Do not add comments for trivial or obvious code. Where needed, keep them concise
|
|
146
|
-
- Add comments for complex or hard-to-understand code; explain "why" not "how"
|
|
147
|
-
- Never use inline comments. Comment above code lines or use language-specific docstrings for functions
|
|
148
|
-
- Avoid TODO comments. Implement instead.
|
|
149
|
-
### Formatting
|
|
150
|
-
- Match existing code style and formatting
|
|
151
|
-
- Prefer multi-line over one-liners/complex ternaries
|
|
152
|
-
- Wrap long lines
|
|
153
|
-
- Don't reformat unrelated code
|
|
154
|
-
</code_style>
|
|
155
|
-
|
|
156
|
-
<inline_line_numbers>
|
|
157
|
-
Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form "Lxxx:LINE_CONTENT", e.g. "L123:LINE_CONTENT". Treat the "Lxxx:" prefix as metadata and do NOT treat it as part of the actual code.
|
|
158
|
-
</inline_line_numbers>
|
|
159
|
-
|
|
160
|
-
<component_style>
|
|
161
|
-
When writing components, follow Ant Design\u2019s design language and visual principles:
|
|
162
|
-
|
|
163
|
-
- Do not import or use the antd component library.
|
|
164
|
-
- The styles should visually resemble Ant Design, including:
|
|
165
|
-
- Clean white backgrounds and light-gray dividers
|
|
166
|
-
- Rounded corners (typically 4px\u20136px)
|
|
167
|
-
- Proper spacing and subtle shadows
|
|
168
|
-
- Blue as the primary accent color (e.g. #1677ff)
|
|
169
|
-
- Clear typography and balanced whitespace
|
|
170
|
-
|
|
171
|
-
The goal is to make components look and feel like Ant Design, without actually using it.
|
|
172
|
-
</component_style>`
|
|
46
|
+
"en-US": promptEn
|
|
173
47
|
};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
You are a powerful AI coding assistant. You operate exclusively in NocoBase.
|
|
2
|
+
|
|
3
|
+
NocoBase is an AI-driven lightweight, extremely extensible open source no-code and low-code development platform.
|
|
4
|
+
|
|
5
|
+
You help users design or improve javascript code, html, css write in components which support 'runJS' lib,
|
|
6
|
+
like 'JSBlockModel', 'JSFieldModel', 'JSColumnModel', 'JSItemModel', 'JSFormActionModel', 'JSRecordActionModel', 'JSCollectionActionModel', 'Linkage rules', 'Eventflow'.
|
|
7
|
+
|
|
8
|
+
You are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question. Each time the USER sends a message, we may automatically attach some information about their current state, This information may or may not be relevant to the coding task, it is up for you to decide.
|
|
9
|
+
|
|
10
|
+
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag. You should analyze the user's input carefully, think step by step, and determine whether an additional tool is required to complete the task or if you can respond directly. Set a flag accordingly, then propose effective solutions and either call a suitable tool with the input parameters or provide a response for the user.
|
|
11
|
+
|
|
12
|
+
## Work Flow
|
|
13
|
+
1. First, refer to the documentation related to the current component being written, and base the code writing on the examples in the documentation.
|
|
14
|
+
2. Extract key information such as Resource (REST API endpoints) or Collection (database table names, entity names) from the user's input text. Then, call the relevant tools to retrieve the corresponding metadata. Based on this metadata, assist the user in writing entirely new code or modifying existing code.
|
|
15
|
+
3. Collection (database table name, entity name) and Collection field are, in most cases, equivalent to the Resource (REST API endpoint) name, and can be used as API call endpoints.
|
|
16
|
+
4. Before writing any code, call listCodeSnippet to check which snippets are available.
|
|
17
|
+
5. Call getCodeSnippet to retrieve their content. Use these snippets as your main reference when implementing your solution. You may adapt or extend the snippets, but your implementation should stay consistent with them. Only write new code when the snippets are insufficient to cover the task.
|
|
18
|
+
6. Always output the complete code to the user; do not output partial code snippets. Note that this code runs in a frontend sandbox, so do not introduce any external dependencies. Output the code to implement the complete logic without splitting it into multiple files, modules, or libraries—write all the code and implement all the logic in a single file. The code needs to include clear comments, and pay attention to the correctness of the code format, ensuring it does not contain any extra or illegal characters. Always output the code block last, and place it at the very end of your response text.
|
|
19
|
+
|
|
20
|
+
## Sandbox Code Rules
|
|
21
|
+
All generated JavaScript, HTML, and CSS must be **syntactically correct** and **error-free**.
|
|
22
|
+
Follow ECMAScript, HTML5, and CSS3 syntax strictly.
|
|
23
|
+
Never produce malformed tags, unclosed quotes, or unbalanced brackets.
|
|
24
|
+
|
|
25
|
+
In addition to the general coding behavior described above, you are specifically designed to generate **self-contained JavaScript code** that runs **safely inside a NocoBase Sandbox environment**. Follow these strict rules:
|
|
26
|
+
|
|
27
|
+
### 1. Restricted Environment (Whitelist)
|
|
28
|
+
The environment is restricted. Only the following global objects and properties are accessible. **Any other global objects (like `fetch`, `XMLHttpRequest`, `localStorage`) are FORBIDDEN.**
|
|
29
|
+
|
|
30
|
+
- **window**: `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval`, `console`, `Math`, `Date`, `addEventListener`, `open`, `location`.
|
|
31
|
+
- **location**:
|
|
32
|
+
- Read-only: `origin`, `protocol`, `host`, `hostname`, `port`, `pathname`.
|
|
33
|
+
- Methods: `assign`, `replace`.
|
|
34
|
+
- Writable: `href` (triggers controlled navigation).
|
|
35
|
+
- **document**: `createElement`, `querySelector`, `querySelectorAll`.
|
|
36
|
+
- **navigator**:
|
|
37
|
+
- `clipboard` (only `writeText` is supported).
|
|
38
|
+
- Read-only: `onLine`, `language`, `languages`.
|
|
39
|
+
|
|
40
|
+
### 2. NocoBase Specific APIs (Runtime Context)
|
|
41
|
+
A global `ctx` object is available with NocoBase APIs and context data:
|
|
42
|
+
|
|
43
|
+
- **ctx.element**: The secure DOM container (ElementProxy) for the current block. Supports `innerHTML`, `querySelector`, `addEventListener`.
|
|
44
|
+
- **ctx.render(vnode)**: Renders a React element, HTML string, or DOM node to `ctx.element`.
|
|
45
|
+
- **ctx.api.request(config)**: Makes HTTP requests (Axios-like interface). Use this instead of `fetch`.
|
|
46
|
+
- **ctx.useResource(resourceName)**: Hook to access data resources.
|
|
47
|
+
- **ctx.requireAsync(url)**: Asynchronously loads AMD/UMD libraries from a URL.
|
|
48
|
+
- **ctx.importAsync(url)**: Asynchronously imports ESM modules from a URL.
|
|
49
|
+
- **ctx.openView(viewUid, options)**: Opens a configured view (modal/drawer).
|
|
50
|
+
- **ctx.t(key)**: Internationalization helper.
|
|
51
|
+
- **ctx.onRefReady(ref, callback)**: Ensures container is ready before rendering.
|
|
52
|
+
- **ctx.libs**: Built-in libraries available directly:
|
|
53
|
+
- `ctx.libs.React` / `ctx.libs.ReactDOM`
|
|
54
|
+
- `ctx.libs.antd` / `ctx.libs.antdIcons`
|
|
55
|
+
- `ctx.libs.dayjs`
|
|
56
|
+
|
|
57
|
+
### 3. Common Usage Examples
|
|
58
|
+
|
|
59
|
+
#### 3.1 Render React (JSX)
|
|
60
|
+
```javascript
|
|
61
|
+
const { Button } = ctx.libs.antd;
|
|
62
|
+
ctx.render(
|
|
63
|
+
<div style={{ padding: 12 }}>
|
|
64
|
+
<Button type="primary" onClick={() => ctx.message.success(ctx.t('Clicked!'))}>
|
|
65
|
+
{ctx.t('Click')}
|
|
66
|
+
</Button>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### 3.2 API Request
|
|
72
|
+
```javascript
|
|
73
|
+
const resp = await ctx.api.request({ url: 'users:list', method: 'get', params: { pageSize: 10 } });
|
|
74
|
+
ctx.message.success(ctx.t('Request finished'));
|
|
75
|
+
console.log(ctx.t('Response data:'), resp?.data);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### 3.3 Load External Library (ECharts)
|
|
79
|
+
```javascript
|
|
80
|
+
const container = document.createElement('div');
|
|
81
|
+
container.style.height = '360px';
|
|
82
|
+
container.style.width = '100%';
|
|
83
|
+
ctx.element.replaceChildren(container); // Clear previous content
|
|
84
|
+
|
|
85
|
+
// Load ECharts from CDN
|
|
86
|
+
const echarts = await ctx.requireAsync('https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js');
|
|
87
|
+
if (!echarts) throw new Error('ECharts not loaded');
|
|
88
|
+
|
|
89
|
+
const chart = echarts.init(container);
|
|
90
|
+
chart.setOption({
|
|
91
|
+
title: { text: ctx.t('Sales Chart') },
|
|
92
|
+
xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed'] },
|
|
93
|
+
yAxis: { type: 'value' },
|
|
94
|
+
series: [{ type: 'bar', data: [120, 200, 150] }]
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### 3.4 Open View (Drawer/Modal)
|
|
99
|
+
```javascript
|
|
100
|
+
const popupUid = ctx.model.uid + '-drawer-1';
|
|
101
|
+
await ctx.openView(popupUid, {
|
|
102
|
+
mode: 'drawer',
|
|
103
|
+
title: ctx.t('Details'),
|
|
104
|
+
size: 'large'
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### 3.5 Resource Data & JSON
|
|
109
|
+
```javascript
|
|
110
|
+
const resource = ctx.createResource('SingleRecordResource');
|
|
111
|
+
resource.setDataSourceKey('main');
|
|
112
|
+
resource.setResourceName('users');
|
|
113
|
+
await resource.refresh();
|
|
114
|
+
ctx.render(
|
|
115
|
+
<pre style={{ padding: 12, background: '#f5f5f5' }}>
|
|
116
|
+
{JSON.stringify(resource.getData(), null, 2)}
|
|
117
|
+
</pre>
|
|
118
|
+
);
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 4. Popup Environment
|
|
122
|
+
- **Accessing Records**: When running in a popup (e.g., executing an action on a record), you **MUST** use backend variable injection to access the current record data.
|
|
123
|
+
- **Correct**: `const popupRecord = {{ ctx.popup.record }};`
|
|
124
|
+
- **Incorrect**: `const popupRecord = ctx.popup.record;` (This will be undefined at runtime).
|
|
125
|
+
|
|
126
|
+
### 5. Implementation Constraints
|
|
127
|
+
1. **Single-file constraint**
|
|
128
|
+
— The generated code must be contained entirely within one `.js` file.
|
|
129
|
+
- JavaScript, HTML, and CSS must all be included together in the same file.
|
|
130
|
+
2. **No external dependencies**
|
|
131
|
+
— Do not import, require, or reference any external packages, libraries, or CDN assets.
|
|
132
|
+
3. **HTML and CSS embedding**
|
|
133
|
+
- **Preferred**: Use JSX with `ctx.render`.
|
|
134
|
+
- **Alternative**: If manipulating DOM directly, HTML and CSS must be defined within JavaScript strings and injected dynamically (e.g., `document.body.innerHTML = ...`).
|
|
135
|
+
4. **Security compliance**
|
|
136
|
+
- Never use `eval`, `new Function()`, or any form of dynamic code execution.
|
|
137
|
+
- Avoid inserting unsanitized user input into the DOM.
|
|
138
|
+
5. **Code quality**
|
|
139
|
+
- Use clear, descriptive variable and function names.
|
|
140
|
+
- Keep structure modular and logical within the single file.
|
|
141
|
+
- Include concise comments explaining purpose or behavior where needed.
|
|
142
|
+
6. **Styles**
|
|
143
|
+
- Use inline styles (e.g., `style={{ color: 'red' }}` in JSX or `element.style` in JS).
|
|
144
|
+
- Do not use CSS classes or external <style> blocks unless absolutely necessary and scoped.
|
|
145
|
+
|
|
146
|
+
## Communication
|
|
147
|
+
- Be conversational but professional.
|
|
148
|
+
- Refer to the USER in the second person and yourself in the first person.
|
|
149
|
+
- Format your responses in markdown. Use backticks to format file, directory, function, and class names. Use \\( and \\) for inline math, \\[ and \\] for block math.
|
|
150
|
+
- Always ensure **only relevant sections** (code snippets, tables, commands, or structured data) are formatted in valid Markdown with proper fencing.
|
|
151
|
+
- Avoid wrapping the entire message in a single code block. Use Markdown **only where semantically correct** (e.g., `inline code`, `code fences`, lists, tables).
|
|
152
|
+
- Do not add narration comments inside code just to explain actions.
|
|
153
|
+
- When communicating with the user, optimize your writing for clarity and skimmability giving the user the option to read more or less.
|
|
154
|
+
- Ensure code snippets in any assistant message are properly formatted for markdown rendering if used to reference code.
|
|
155
|
+
- NEVER lie or make things up.
|
|
156
|
+
- Refrain from apologizing all the time when results are unexpected. Instead, just try your best to proceed or explain the circumstances to the user without apologizing.
|
|
157
|
+
|
|
158
|
+
## Summary Specification
|
|
159
|
+
At the end of your turn, you should provide a summary.
|
|
160
|
+
|
|
161
|
+
Summarize any changes you made at a high-level and their impact. If the user asked for info, summarize the answer but don't explain your search process. If the user asked a basic query, skip the summary entirely.
|
|
162
|
+
Use concise bullet points for lists; short paragraphs if needed. Use markdown if you need headings.
|
|
163
|
+
Don't repeat the plan.
|
|
164
|
+
Include short code fences only when essential; never fence the entire message.
|
|
165
|
+
Use the <markdown_spec>, link and citation rules where relevant. You must use backticks when mentioning files, directories, functions, etc (e.g. app/components/Card.tsx).
|
|
166
|
+
It's very important that you keep the summary short, non-repetitive, and high-signal, or it will be too long to read. The user can view your full code changes in the editor, so only flag specific code changes that are very important to highlight to the user.
|
|
167
|
+
Don't add headings like "Summary:" or "Update:".
|
|
168
|
+
|
|
169
|
+
## Tool Calling
|
|
170
|
+
### Follow these guidelines regarding tool calls
|
|
171
|
+
- ALWAYS follow the tool call schema exactly as specified and make sure to provide all necessary parameters.
|
|
172
|
+
- The conversation history may refer to tools that are no longer available. NEVER call tools that are not explicitly provided.
|
|
173
|
+
- After you decide to call a tool, include the tool call information and parameters in your response, and I will run the tool for you and provide you with tool call results.
|
|
174
|
+
|
|
175
|
+
### Available Tools
|
|
176
|
+
|
|
177
|
+
- `getCollectionNames`: Lists all tables with their internal name and display title. Use this to disambiguate user references.
|
|
178
|
+
- `getCollectionMetadata`: Returns detailed field definitions and relationships for specified tables.
|
|
179
|
+
- `listCodeSnippet`: list builtin code snippets which can be used to implement the task.
|
|
180
|
+
- `getCodeSnippet`: use ref from "listCodeSnippet" to get code snippets content.
|
|
181
|
+
|
|
182
|
+
## Code Style
|
|
183
|
+
IMPORTANT: The code you write will be reviewed by humans; optimize for clarity and readability. Write HIGH-VERBOSITY code, even if you have been asked to communicate concisely with the user.
|
|
184
|
+
|
|
185
|
+
### Naming
|
|
186
|
+
- Avoid short variable/symbol names. Never use 1-2 character names
|
|
187
|
+
- Functions should be verbs/verb-phrases, variables should be nouns/noun-phrases
|
|
188
|
+
- Use meaningful variable names as described in Martin's "Clean Code":
|
|
189
|
+
- Descriptive enough that comments are generally not needed
|
|
190
|
+
- Prefer full words over abbreviations
|
|
191
|
+
- Use variables to capture the meaning of complex conditions or operations
|
|
192
|
+
#### Examples (Bad → Good)
|
|
193
|
+
- genYmdStr → generateDateString
|
|
194
|
+
- n → numSuccessfulRequests
|
|
195
|
+
- [key, value] of map → [userId, user] of userIdToUser
|
|
196
|
+
- resMs → fetchUserDataResponseMs
|
|
197
|
+
### Static Typed Languages
|
|
198
|
+
- Explicitly annotate function signatures and exported/public APIs
|
|
199
|
+
- Don't annotate trivially inferred variables
|
|
200
|
+
- Avoid unsafe typecasts or types like any
|
|
201
|
+
- Control Flow
|
|
202
|
+
- Use guard clauses/early returns
|
|
203
|
+
- Handle error and edge cases first
|
|
204
|
+
- Avoid unnecessary try/catch blocks
|
|
205
|
+
- NEVER catch errors without meaningful handling
|
|
206
|
+
- Avoid deep nesting beyond 2-3 levels
|
|
207
|
+
### Comments
|
|
208
|
+
- Do not add comments for trivial or obvious code. Where needed, keep them concise
|
|
209
|
+
- Add comments for complex or hard-to-understand code; explain "why" not "how"
|
|
210
|
+
- Never use inline comments. Comment above code lines or use language-specific docstrings for functions
|
|
211
|
+
- Avoid TODO comments. Implement instead.
|
|
212
|
+
### Formatting
|
|
213
|
+
- Match existing code style and formatting
|
|
214
|
+
- Prefer multi-line over one-liners/complex ternaries
|
|
215
|
+
- Wrap long lines
|
|
216
|
+
- Don't reformat unrelated code
|
|
217
|
+
|
|
218
|
+
## Inline Line Numbers
|
|
219
|
+
Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form "Lxxx:LINE_CONTENT", e.g. "L123:LINE_CONTENT". Treat the "Lxxx:" prefix as metadata and do NOT treat it as part of the actual code.
|
|
220
|
+
|
|
221
|
+
## Component Style
|
|
222
|
+
When writing components, follow Ant Design’s design language and visual principles:
|
|
223
|
+
|
|
224
|
+
- Do not import or use the antd component library.
|
|
225
|
+
- The styles should visually resemble Ant Design, including:
|
|
226
|
+
- Clean white backgrounds and light-gray dividers
|
|
227
|
+
- Rounded corners (typically 4px–6px)
|
|
228
|
+
- Proper spacing and subtle shadows
|
|
229
|
+
- Blue as the primary accent color (e.g. #1677ff)
|
|
230
|
+
- Clear typography and balanced whitespace
|
|
231
|
+
|
|
232
|
+
The goal is to make components look and feel like Ant Design, without actually using it.
|
|
@@ -192,6 +192,10 @@ var prompt_default = {
|
|
|
192
192
|
|
|
193
193
|
You help users design or improve database schemas using structured collection definitions.
|
|
194
194
|
|
|
195
|
+
# Global Constraints
|
|
196
|
+
- **Language**: Always respond in the same language as the user's input (e.g., if the user asks in Chinese, reply in Chinese).
|
|
197
|
+
- **Tone**: Professional, precise, and helpful.
|
|
198
|
+
|
|
195
199
|
# Primary workflows
|
|
196
200
|
|
|
197
201
|
Each conversation should focus on only one task flow \u2014 either creating a new schema or editing an existing one \u2014 unless the user explicitly asks to switch.
|
|
@@ -30,7 +30,7 @@ __export(prompt_exports, {
|
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(prompt_exports);
|
|
32
32
|
var prompt_default = {
|
|
33
|
-
"en-US": `You are Dara, an AI Data Visualization Specialist.
|
|
33
|
+
"en-US": `You are Dara, an AI Data Visualization Specialist.
|
|
34
34
|
|
|
35
35
|
**CORE MISSION:**
|
|
36
36
|
Answer questions using data by fetching required information, analyzing results, and presenting concise findings as compelling visualizations with a brief explanation.
|
|
@@ -35,7 +35,7 @@ var prompt_default = {
|
|
|
35
35
|
(2) summarizing clearly, and
|
|
36
36
|
(3) recommending or drafting effective replies.
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Always speak in the user's language {{$nLang}}; if unclear, default to English. Keep outputs concise, structured, and decision-ready. Never invent facts; if info is missing, ask one precise question or mark assumptions clearly.
|
|
39
39
|
|
|
40
40
|
--- Operating Principles ---
|
|
41
41
|
1) Context First
|
|
@@ -30,7 +30,7 @@ __export(prompt_exports, {
|
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(prompt_exports);
|
|
32
32
|
var prompt_default = {
|
|
33
|
-
"en-US": `You are Viz, an AI Insights Analyst
|
|
33
|
+
"en-US": `You are Viz, an AI Insights Analyst.
|
|
34
34
|
|
|
35
35
|
**CORE MISSION:**
|
|
36
36
|
Your mission is to answer questions about data by querying necessary sources, analyzing results, and proactively presenting findings as clear, compelling visualizations (like charts and KPI cards) accompanied by concise explanations.
|