[TRIAL] feat: add experimental Svelte support#801
[TRIAL] feat: add experimental Svelte support#801devin-ai-integration[bot] wants to merge 7 commits intomainfrom
Conversation
This is a trial implementation of Svelte support for the Agentuity SDK. Changes: - Add @agentuity/svelte package with client and context utilities - Update vite-builder.ts to detect and use Svelte plugin for Svelte projects - Update registry-generator.ts to add module augmentation for @agentuity/svelte - Add Svelte template with example agent and API route - Update templates.json to include Svelte template option Note: This is an experimental feature and should be reviewed carefully. Co-Authored-By: grodrigues@agentuity.com <huijirohankei@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/server": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-server-0.1.39-13702a6.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-frontend-0.1.39-13702a6.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-runtime-0.1.39-13702a6.tgz",
"@agentuity/svelte": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-svelte-0.1.39-13702a6.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-core-0.1.39-13702a6.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-opencode-0.1.39-13702a6.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-cli-0.1.39-13702a6.tgz",
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-evals-0.1.39-13702a6.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-react-0.1.39-13702a6.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-schema-0.1.39-13702a6.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-workbench-0.1.39-13702a6.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-auth-0.1.39-13702a6.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-server-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-frontend-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-runtime-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-svelte-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-core-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-opencode-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-cli-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-evals-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-react-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-schema-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-workbench-0.1.39-13702a6.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.39-13702a6/agentuity-auth-0.1.39-13702a6.tgz |
This ensures the @agentuity/svelte package is built during the TypeScript build step, which is required for CI verification. Co-Authored-By: grodrigues@agentuity.com <huijirohankei@gmail.com>
This ensures the @agentuity/svelte package is packed and available for template integration tests, fixing the 404 error when testing the Svelte template. Co-Authored-By: grodrigues@agentuity.com <huijirohankei@gmail.com>
Co-Authored-By: grodrigues@agentuity.com <huijirohankei@gmail.com>
templates/templates.json
Outdated
| "name": "Default Template", | ||
| "description": "Showcases core Agentuity features using OpenAI SDK", | ||
| "directory": "default" | ||
| }, |
There was a problem hiding this comment.
we only want to have one template in this repo so remove this and the template and move to examples folder
There was a problem hiding this comment.
Done! I've moved the Svelte template from templates/svelte/ to examples/svelte/ and removed it from templates.json. The @agentuity/svelte package remains in packages/svelte/ for projects that want to use Svelte.
Co-Authored-By: grodrigues@agentuity.com <huijirohankei@gmail.com>
Co-Authored-By: grodrigues@agentuity.com <huijirohankei@gmail.com>
- Add Svelte detection to vite-asset-server-config.ts for dev mode - Export detectSvelteProject function from vite-builder.ts - Remove hardcoded @agentuity/react from optimizeDeps.include - Add svelte-app testing application with hello agent and API route - Configure proper tsconfig paths for @agent/* and @api/* aliases Amp-Thread-ID: https://ampcode.com/threads/T-019c1f3b-01b9-7205-bee7-387da562cf98 Co-authored-by: Amp <amp@ampcode.com>
[TRIAL] feat: add experimental Svelte support
Summary
This PR adds experimental Svelte support to the Agentuity SDK. This is a trial implementation and should be reviewed carefully before considering for merge.
The changes include:
New
@agentuity/sveltepackage - Client library withcreateClient,createAPIClient, and context initialization functions (initAgentuity,setAuthHeader,setBaseUrl). Uses global state management similar to@agentuity/react.Build system changes - Modified
vite-builder.tsto detect Svelte projects (by checking for.sveltefiles or svelte in package.json) and dynamically load@sveltejs/vite-plugin-svelteinstead of the React plugin.Registry generator updates - Added module augmentation for
@agentuity/svelteinregistry-generator.tsso route types are available in Svelte projects.Svelte example - Example project at
examples/svelte/with a hello agent and Svelte 5 component demonstrating API client usage. (Note: This is an example, not a template - it won't appear inagentuity create.)Updates since last revision
templates/svelte/toexamples/svelte/per review feedbacktemplates/templates.json(only one template should exist in this repo)Review & Testing Checklist for Human
examples/svelte/to a new project, add dependencies, and verifyagentuity buildworksvite-builder.tsRecommended test plan:
agentuity createand verify it worksexamples/svelte/as referenceagentuity devon the Svelte project and verify the build succeedsNotes
$state,mountfrom 'svelte') - not compatible with Svelte 4examples/svelte/is a reference implementation, not a scaffoldable templateLink to Devin run: https://app.devin.ai/sessions/3d30dacf70bf47b5b085563f22a8c0f5
Requested by: @Huijiro