introduce actors cli support - #625
Merged
Merged
Conversation
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.14-pr.625.c566f53Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.14-pr.625.c566f53"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.14-pr.625.c566f53"
}
}
Preview published to npm registry — try new features instantly! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
Adds first-class support for realtime actors to the CLI. Actors are discovered from
base44/actors/<Name>/entry.ts(orentry.js), deployed folder-local — every file under the actor directory is uploaded verbatim — viaPUT /actors/:name, and removed withDELETE /actors/:name. They are wired into the unifiedbase44 deploypipeline, project config, and type generation, plus a newbase44 actorscommand group for targeted deploy/delete.Deploy stages now inspect per-item results: a failed function or actor raises the new
ResourceDeploymentErrorbefore later stages run, carrying completed work and per-item outcomes into both human and--jsonerror output. Actors are not supported in local dev, sobase44 devanswers actor requests with an explicit 500 instead of proxying them to production.Related Issue
None
Type of Change
Changes Made
New actor resource (
src/core/resources/actor/)schema.ts— Zod schemas for actor definitions, deploy payloads and API responses;ActorNameSchemaenforces JS-identifier names (max 128 chars) and rejects reserved words, since actor names become strict-mode class bindings.config.ts—readAllActors()discovers entry files under named subfolders, rejecting root-level entries, nested actors, invalid names and duplicates.api.ts—deploySingleActor()/deleteSingleActor()with Zod-validated responses andApiError.fromHttpError()context.deploy.ts— sequential deploy withonStart/onResultcallbacks, per-actor error capture (status code + request id) and result formatting.resource.ts— standardResource<ActorDefinition>implementation (readAll+push).CLI commands
base44 actors deploy [names...]andbase44 actors delete <names...>, registered inprogram.ts; both accept comma/space-separated, deduplicated name lists, surface server warnings, and emit per-actor results plus a summary under--json.base44 deploynow includes actors in the confirmation summary and deploys them after functions with per-actor progress output.Project & types
actorsDirconfig option (defaults toactors);ProjectData.actorsadded.ProjectConfigReaderskips actor discovery for imported plugins and rejects a name that exists as both a backend function and an actor.ActorNameRegistryand adds a top-levelimport '@base44/sdk';so registry-only augmentation preserves SDK exports.Errors & dev server
ResourceDeploymentError(RESOURCE_DEPLOYMENT_FAILED);deployAll()now fails fast on function/actor errors with detailed stage context.Docs
docs/resources.md,docs/commands.md,docs/plugins.md,docs/testing.md.Testing
npm test)New suites:
tests/cli/actors.spec.ts,tests/cli/actors_deploy_all.spec.ts,tests/cli/dev-actors.spec.ts,tests/core/actor-config.spec.ts,tests/core/actor-types.spec.ts, pluswith-actors/actor-validationfixtures and newbranch_scopecases. They cover payload boundaries (folder-local files, symlinked files and directories), name validation and dedup, partial failures and stage ordering in unified deploy, JSON error envelopes, and the dev-server block. Test-suite results were not verified while generating this description.Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
Actor sources ship verbatim — no bundling or function shared-file assembly — and the platform validates and publishes them. Failures are not rolled back: earlier successful deployments stay live and the error details list what completed. Plugin-contributed actors are intentionally ignored.
🤖 Generated by Claude | 2026-09-14 11:23 UTC | c566f53