Skip to content

introduce actors cli support - #625

Merged
talge-a11y merged 1 commit into
mainfrom
actors_direct
Sep 15, 2026
Merged

talge-a11y merged 1 commit into
mainfrom
actors_direct

Conversation

@talge-a11y

@talge-a11y talge-a11y commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Note

Description

Adds first-class support for realtime actors to the CLI. Actors are discovered from base44/actors/<Name>/entry.ts (or entry.js), deployed folder-local — every file under the actor directory is uploaded verbatim — via PUT /actors/:name, and removed with DELETE /actors/:name. They are wired into the unified base44 deploy pipeline, project config, and type generation, plus a new base44 actors command group for targeted deploy/delete.

Deploy stages now inspect per-item results: a failed function or actor raises the new ResourceDeploymentError before later stages run, carrying completed work and per-item outcomes into both human and --json error output. Actors are not supported in local dev, so base44 dev answers actor requests with an explicit 500 instead of proxying them to production.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

New actor resource (src/core/resources/actor/)

  • schema.ts — Zod schemas for actor definitions, deploy payloads and API responses; ActorNameSchema enforces JS-identifier names (max 128 chars) and rejects reserved words, since actor names become strict-mode class bindings.
  • config.tsreadAllActors() discovers entry files under named subfolders, rejecting root-level entries, nested actors, invalid names and duplicates.
  • api.tsdeploySingleActor() / deleteSingleActor() with Zod-validated responses and ApiError.fromHttpError() context.
  • deploy.ts — sequential deploy with onStart/onResult callbacks, per-actor error capture (status code + request id) and result formatting.
  • resource.ts — standard Resource<ActorDefinition> implementation (readAll + push).

CLI commands

  • New base44 actors deploy [names...] and base44 actors delete <names...>, registered in program.ts; both accept comma/space-separated, deduplicated name lists, surface server warnings, and emit per-actor results plus a summary under --json.
  • base44 deploy now includes actors in the confirmation summary and deploys them after functions with per-actor progress output.

Project & types

  • actorsDir config option (defaults to actors); ProjectData.actors added.
  • ProjectConfigReader skips actor discovery for imported plugins and rejects a name that exists as both a backend function and an actor.
  • Type generator emits an ActorNameRegistry and adds a top-level import '@base44/sdk'; so registry-only augmentation preserves SDK exports.

Errors & dev server

  • New ResourceDeploymentError (RESOURCE_DEPLOYMENT_FAILED); deployAll() now fails fast on function/actor errors with detailed stage context.
  • Dev server returns a 500 "Actors are not available in local development" before the production proxy.

Docs

  • Updated docs/resources.md, docs/commands.md, docs/plugins.md, docs/testing.md.

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (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, plus with-actors / actor-validation fixtures and new branch_scope cases. 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

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional 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

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.14-pr.625.c566f53

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.1.14-pr.625.c566f53"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.14-pr.625.c566f53"
  }
}

Preview published to npm registry — try new features instantly!

@ImriKochWix ImriKochWix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@talge-a11y
talge-a11y merged commit 0a98640 into main Sep 15, 2026
15 checks passed
@talge-a11y
talge-a11y deleted the actors_direct branch September 15, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants