Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": ["next/core-web-vitals", "next/typescript"],
"rules": {
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }]
}
"extends": ["next/core-web-vitals", "next/typescript"],
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
]
}
}
30 changes: 5 additions & 25 deletions agent-docs/biome.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingCommas": "es5",
"semicolons": "always"
}
},
"files": {
"ignore": [".agentuity/**"]
}
"extends": "//",
"root": false,
"files": {
"includes": ["**", "!**/.agentuity/**", "!**/.next/**"]
}
}
2 changes: 1 addition & 1 deletion agent-docs/config.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const VECTOR_STORE_NAME = process.env.VECTOR_STORE_NAME || 'docs';
export const vectorSearchNumber = 10;
export const vectorSearchNumber = 10;
72 changes: 36 additions & 36 deletions agent-docs/index.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
import { runner } from '@agentuity/sdk';

declare global {
namespace NodeJS {
interface Process {
isBun: boolean;
}
}
namespace NodeJS {
interface Process {
isBun: boolean;
}
}
}

if (!process.env.AGENTUITY_API_KEY && !process.env.AGENTUITY_SDK_KEY) {
console.error(
'\x1b[31m[ERROR] AGENTUITY_API_KEY or AGENTUITY_SDK_KEY is not set. This should have been set automatically by the Agentuity CLI or picked up from the .env file.\x1b[0m'
);
console.error(
'\x1b[31m[ERROR] AGENTUITY_API_KEY or AGENTUITY_SDK_KEY is not set. This should have been set automatically by the Agentuity CLI or picked up from the .env file.\x1b[0m'
);

const cmd = process.env._ || '';
const cmd = process.env._ || '';

if (cmd.endsWith('node')) {
console.error(
'\x1b[31m[ERROR] Re-run the command with `node --env-file .env index.ts`\x1b[0m'
);
}
if (cmd.endsWith('node')) {
console.error(
'\x1b[31m[ERROR] Re-run the command with `node --env-file .env index.ts`\x1b[0m'
);
}

process.exit(1);
process.exit(1);
}

if (!process.env.AGENTUITY_URL) {
console.warn(
'\x1b[31m[WARN] You are running this agent outside of the Agentuity environment. Any automatic Agentuity features will be disabled.\x1b[0m'
);

if (process.isBun) {
console.warn(
'\x1b[31m[WARN] Recommend running `agentuity dev` to run your project locally instead of `bun run start`.\x1b[0m'
);
} else {
console.warn(
'\x1b[31m[WARN] Recommend running `agentuity dev` to run your project locally instead of `npm start`.\x1b[0m'
);
}
console.warn(
'\x1b[31m[WARN] You are running this agent outside of the Agentuity environment. Any automatic Agentuity features will be disabled.\x1b[0m'
);

if (process.isBun) {
console.warn(
'\x1b[31m[WARN] Recommend running `agentuity dev` to run your project locally instead of `bun run start`.\x1b[0m'
);
} else {
console.warn(
'\x1b[31m[WARN] Recommend running `agentuity dev` to run your project locally instead of `npm start`.\x1b[0m'
);
}
}

runner(true, import.meta.dirname).catch((err) => {
if (err instanceof Error) {
console.error(err.message);
console.error(err.stack);
} else {
console.error(err);
}

process.exit(1);
if (err instanceof Error) {
console.error(err.message);
console.error(err.stack);
} else {
console.error(err);
}

process.exit(1);
});
Loading