site-template cleanup 2/3
This commit is contained in:
parent
9e72aca04c
commit
e6c461ae6a
@ -1,7 +1,7 @@
|
||||
|
||||
export default new Map([
|
||||
["src/content/infopages/contact.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Finfopages%2Fcontact.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/infopages/community.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Finfopages%2Fcommunity.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/infopages/contact.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Finfopages%2Fcontact.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/infopages/resources.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Finfopages%2Fresources.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/infopages/software.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Finfopages%2Fsoftware.mdx&astroContentModuleFlag=true")]]);
|
||||
|
||||
54
package-lock.json
generated
54
package-lock.json
generated
@ -16,6 +16,8 @@
|
||||
"@astrolib/seo": "^1.0.0-beta.8",
|
||||
"@jsdevtools/rehype-toc": "^3.0.2",
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@polymech/astro-base": "file:../astro-components/packages/polymech",
|
||||
"@polymech/astro-components": "file:../astro-components/packages/astro-components",
|
||||
"@polymech/cache": "file:../polymech-mono/packages/cache",
|
||||
"@polymech/cad": "file:../polymech-mono/packages/cad",
|
||||
"@polymech/commons": "file:../polymech-mono/packages/commons",
|
||||
@ -83,17 +85,55 @@
|
||||
"sass-embedded": "^1.83.4"
|
||||
}
|
||||
},
|
||||
"../astro-components/packages/astro-components": {
|
||||
"name": "@polymech/astro-components",
|
||||
"version": "0.9.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@astro-community/astro-embed-baseline-status": "^0.1.0",
|
||||
"@astro-community/astro-embed-bluesky": "^0.1.0",
|
||||
"@astro-community/astro-embed-integration": "^0.8.0",
|
||||
"@astro-community/astro-embed-link-preview": "^0.2.2",
|
||||
"@astro-community/astro-embed-twitter": "^0.5.6",
|
||||
"@astro-community/astro-embed-vimeo": "^0.3.10",
|
||||
"@astro-community/astro-embed-youtube": "^0.5.5",
|
||||
"@polymech/astro-base": "file:../polymech"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^2.0.0 || ^3.0.0-beta || ^4.0.0-beta || ^5.0.0-beta"
|
||||
}
|
||||
},
|
||||
"../astro-components/packages/astro-embed": {
|
||||
"version": "0.9.0",
|
||||
"extraneous": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@astro-community/astro-embed-baseline-status": "^0.1.0",
|
||||
"@astro-community/astro-embed-bluesky": "^0.1.0",
|
||||
"@astro-community/astro-embed-integration": "^0.8.0",
|
||||
"@astro-community/astro-embed-link-preview": "^0.2.2",
|
||||
"@astro-community/astro-embed-twitter": "^0.5.6",
|
||||
"@astro-community/astro-embed-vimeo": "^0.3.10",
|
||||
"@astro-community/astro-embed-youtube": "^0.5.5",
|
||||
"@polymech/astro-base": "file:../polymech"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^2.0.0 || ^3.0.0-beta || ^4.0.0-beta || ^5.0.0-beta"
|
||||
}
|
||||
},
|
||||
"../astro-components/packages/imagetools": {
|
||||
"version": "0.9.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@astropub/codecs": "0.4.4",
|
||||
"@polymech/fs": "file:../../../polymech-mono/packages/fs",
|
||||
"file-type": "17.1.1",
|
||||
"find-cache-dir": "3.3.2",
|
||||
"find-up": "^6.3.0",
|
||||
"object-hash": "3.0.0",
|
||||
"p-map": "^7.0.3",
|
||||
"potrace": "2.1.8"
|
||||
"potrace": "2.1.8",
|
||||
"ts-retry": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitest": "^0.12.4"
|
||||
@ -108,6 +148,10 @@
|
||||
"astro": ">=0.26 || >=1.0.0-beta"
|
||||
}
|
||||
},
|
||||
"../astro-components/packages/polymech": {
|
||||
"name": "@polymech/astro-base",
|
||||
"version": "0.5.6"
|
||||
},
|
||||
"../polymech-mono/packages/cache": {
|
||||
"name": "@polymech/cache",
|
||||
"version": "0.4.8",
|
||||
@ -2351,6 +2395,14 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@polymech/astro-base": {
|
||||
"resolved": "../astro-components/packages/polymech",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@polymech/astro-components": {
|
||||
"resolved": "../astro-components/packages/astro-components",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@polymech/cache": {
|
||||
"resolved": "../polymech-mono/packages/cache",
|
||||
"link": true
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
"@astrolib/seo": "^1.0.0-beta.8",
|
||||
"@jsdevtools/rehype-toc": "^3.0.2",
|
||||
"@playwright/test": "^1.50.1",
|
||||
"@polymech/astro-components": "file:../astro-components/packages/astro-components",
|
||||
"@polymech/cache": "file:../polymech-mono/packages/cache",
|
||||
"@polymech/cad": "file:../polymech-mono/packages/cad",
|
||||
"@polymech/commons": "file:../polymech-mono/packages/commons",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,14 +0,0 @@
|
||||
[
|
||||
{
|
||||
"level": "debug",
|
||||
"message": "I'll help you create a TypeScript client for FileBrowser that works with Astro, using Axios and implementing file caching. Let me create the necessary files and structure.\n\nFirst, I'll create a TypeScript client that handles FileBrowser API interactions. We'll organize this in a clean structure and implement the main functionality.",
|
||||
"timestamp": "2025-02-05T22:41:34.311Z",
|
||||
"service": "collector:onContent"
|
||||
},
|
||||
{
|
||||
"level": "debug",
|
||||
"message": "\n\nI've created a TypeScript client for FileBrowser that can be used with Astro. The client implementation includes file caching and uses Axios for HTTP requests. Here's an explanation of the files created:\n\n1. `src/lib/filebrowser/types.ts`: Contains TypeScript interfaces for the FileBrowser API\n2. `src/lib/filebrowser/cache.ts`: Implements the file caching system\n3. `src/lib/filebrowser/client.ts`: Main client implementation\n4. `src/lib/filebrowser/index.ts`: Exports all components\n\nThe client implementation includes the following features:\n\n1. Full TypeScript support with proper types\n2. File caching with configurable duration\n3. Authentication handling with automatic token management\n4. All major FileBrowser operations:\n - Login\n - List directory contents\n - Upload files\n - Delete files\n - Rename files\n - Create directories\n - Download files\n5. Automatic cache invalidation on write operations\n6. Error handling and logging\n7. Axios-based HTTP client with interceptors\n\nTo use the client in your Astro project, you can import it like this:\n\n```typescript\nimport { FileBrowserClient } from '../lib/filebrowser';\n\nconst client = new FileBrowserClient({\n baseUrl: 'https://your-filebrowser-instance.com',\n username: 'your-username',\n password: 'your-password',\n cacheDuration: 5 * 60 * 1000 // 5 minutes cache\n});\n\n// Example usage in an Astro component\nconst listing = await client.listDirectory('/');\nconst uploadResult = await client.uploadFile(file, '/destination/path');\n```\n\nThe client includes the following methods:\n\n1. `login(username: string, password: string)`: Authenticate with FileBrowser\n2. `listDirectory(path: string)`: List contents of a directory\n3. `uploadFile(file: File, destination: string)`: Upload a file\n4. `deleteFile(path: string)`: Delete a file or directory\n5. `renameFile(oldPath: string, newPath: string)`: Rename or move a file\n6. `createDirectory(path: string)`: Create a new directory\n7. `downloadFile(path: string)`: Download a file as a Blob\n\nThe caching system automatically caches directory listings and invalidates the cache when modifications are made. The cache duration is configurable through the client configuration.\n\nHere's an example of how to use the client in an Astro component:\n\n```typescript\n---\nimport { FileBrowserClient } from '../lib/filebrowser';\n\nconst client = new FileBrowserClient({\n baseUrl: import.meta.env.FILEBROWSER_URL,\n username: import.meta.env.FILEBROWSER_USERNAME,\n password: import.meta.env.FILEBROWSER_PASSWORD\n});\n\nconst files = await client.listDirectory('/');\n---\n\n<div>\n <h1>Files</h1>\n <ul>\n {files.items.map(file => (\n <li>\n {file.is_dir ? '📁' : '📄'} {file.name}\n </li>\n ))}\n </ul>\n</div>\n```\n\nTo handle file uploads in an Astro component:\n\n```typescript\n---\n// Your component front matter\n---\n\n<form id=\"upload-form\">\n <input type=\"file\" id=\"file-input\" />\n <button type=\"submit\">Upload</button>\n</form>\n\n<script>\n import { FileBrowserClient } from '../lib/filebrowser';\n\n const client = new FileBrowserClient({\n baseUrl: import.meta.env.FILEBROWSER_URL\n });\n\n document.getElementById('upload-form').addEventListener('submit', async (e) => {\n e.preventDefault();\n const fileInput = document.getElementById('file-input') as HTMLInputElement;\n const file = fileInput.files?.[0];\n \n if (file) {\n try {\n await client.uploadFile(file, '/uploads/' + file.name);\n alert('File uploaded successfully!');\n } catch (error) {\n console.error('Upload failed:', error);\n alert('Upload failed!');\n }\n }\n });\n</script>\n```\n\nThe client is designed to be fully type-safe and includes proper error handling. It will automatically handle authentication and token management, and the caching system will help reduce API calls for frequently accessed directories.\n\nYou can customize the cache duration when instantiating the client, or use the default 5-minute cache duration. The cache is automatically invalidated when files are modified, uploaded, or deleted.",
|
||||
"timestamp": "2025-02-05T22:42:01.019Z",
|
||||
"service": "collector:onContent"
|
||||
}
|
||||
]
|
||||
File diff suppressed because one or more lines are too long
@ -1,461 +0,0 @@
|
||||
{
|
||||
"model": "anthropic/claude-3.5-sonnet",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "complete client, for filebrowser (go), in typescript, for astro, using axios, and file caching"
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": "USER Preferences : undefined"
|
||||
}
|
||||
],
|
||||
"tools": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "list_files",
|
||||
"description": "List all files in a directory",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"directory": {
|
||||
"type": "string"
|
||||
},
|
||||
"pattern": {
|
||||
"type": "string",
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"directory"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read_files",
|
||||
"description": "Reads files in a directory with a given pattern",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"directory": {
|
||||
"type": "string"
|
||||
},
|
||||
"pattern": {
|
||||
"type": "string",
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"directory"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "remove_file",
|
||||
"description": "Remove a file at given path",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"path"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "rename_file",
|
||||
"description": "Rename or move a file or directory",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"src": {
|
||||
"type": "string"
|
||||
},
|
||||
"dst": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"path"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "modify_project_files",
|
||||
"description": "Create or modify existing project files in one shot, preferably used for creating project structure)",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
},
|
||||
"content": {
|
||||
"type": "string",
|
||||
"description": "base64 encoded string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"path",
|
||||
"content"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"files"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "write_file",
|
||||
"description": "Writes to a file, given a path and content (base64). No directory or file exists check needed!",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
},
|
||||
"content": {
|
||||
"type": "string",
|
||||
"description": "base64 encoded string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "file_exists",
|
||||
"description": "check if a file or folder exists",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "read_file",
|
||||
"description": "read a file, at given a path",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "init_repository",
|
||||
"description": "Initialize a new git repository",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "commit_files_git",
|
||||
"description": "Commit files using git",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"files"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "ask_question",
|
||||
"description": "Ask user a simple question and get response",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"question": {
|
||||
"type": "string",
|
||||
"description": "Question to ask the user"
|
||||
},
|
||||
"default": {
|
||||
"type": "string",
|
||||
"description": "Default answer",
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"question"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "choose_option",
|
||||
"description": "Ask user to choose from multiple options",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "Message to show the user"
|
||||
},
|
||||
"choices": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "List of choices"
|
||||
},
|
||||
"multiple": {
|
||||
"type": "boolean",
|
||||
"description": "Allow multiple selections",
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"message",
|
||||
"choices"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "execute_command",
|
||||
"description": "Execute a terminal command and capture output",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"command": {
|
||||
"type": "string",
|
||||
"description": "Command to execute"
|
||||
},
|
||||
"args": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "Command arguments",
|
||||
"optional": true
|
||||
},
|
||||
"cwd": {
|
||||
"type": "string",
|
||||
"description": "Working directory for command execution",
|
||||
"optional": true
|
||||
},
|
||||
"background": {
|
||||
"type": "boolean",
|
||||
"description": "Run command in background (non-blocking)",
|
||||
"optional": true,
|
||||
"default": false
|
||||
},
|
||||
"window": {
|
||||
"type": "boolean",
|
||||
"description": "Open command in new terminal window",
|
||||
"optional": true,
|
||||
"default": false
|
||||
},
|
||||
"detached": {
|
||||
"type": "boolean",
|
||||
"description": "Run process detached from parent",
|
||||
"optional": true,
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"command"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "google",
|
||||
"description": "Searches Google for the given query",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"query"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "serpapi",
|
||||
"description": "Searches Serpapi (finds locations (engine:google_local), places on the map (engine:google_maps) ) for the given query",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "string"
|
||||
},
|
||||
"engine": {
|
||||
"type": "string",
|
||||
"default": "google"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"query"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "browse_page",
|
||||
"description": "Browse a webpage and return its content as markdown, all links, images and pages main image",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "URL of the webpage to browse"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "send_email",
|
||||
"description": "Sends an email",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"recipient": {
|
||||
"type": [
|
||||
"string",
|
||||
"array"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "The email address of the recipient(s). Can be a single email or an array of emails. For \"me\", use the default email address"
|
||||
},
|
||||
"subject": {
|
||||
"type": "string",
|
||||
"description": "the subject",
|
||||
"optional": true
|
||||
},
|
||||
"body": {
|
||||
"type": "string",
|
||||
"description": "Markdown formatted body of the email",
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"url"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "capture_screen",
|
||||
"description": "Capture a screenshot and store it as file (jpg). Returns the path to the file",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"tool_choice": "auto",
|
||||
"parallel_tool_calls": false
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
5
src/pages/tests/components.astro
Normal file
5
src/pages/tests/components.astro
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
import { Checkout, foo } from "@polymech/astro-components"
|
||||
---
|
||||
{foo}
|
||||
<Checkout />
|
||||
Reference in New Issue
Block a user