Repository navigation
feat(templates): share, install, sync and uninstall templates with per-item locks - #1669
Merged
Merged
Conversation
viethung0o0
force-pushed
the
feat/templates-share-install-sync
branch
from
November 8, 2026 17:42
c00f701 to
6ae93c5
Compare
…r-item locks
Templates cover every category, each item with an Include and a View/Edit choice. Referenced tags, custom fields, bot fields, sequences and Places near me categories are installed automatically; a same-name field of another type is created under a suffixed name and {{field}} tokens are rewritten to it.
Reinstalling updates the existing copy in place. With auto-update on, saving a template with real changes syncs every enrolled installation; locally edited copies are backed up first and can be restored. Locked items cannot be edited or deleted in the target workspace; the guard runs in the services under one sorted advisory-lock protocol shared by local edits, syncs, restores and uninstall.
Uninstall, by the installer or by the publisher when the installer allowed it, removes only unmodified copies the installation created. Install, sync and uninstall run as leased, idempotent worker jobs with a sweep that redispatches stuck rows. Share links can expire and be rotated; templates list active installs and have an Installs tab with a per-workspace view.
A tenant owner (a reseller in /manage, the platform admin in /admin) can pick a default template: every workspace created under the tenant afterwards gets it installed in its own creation transaction, dispatched after commit on every creation path. The key is kept only as a hash, set and clear are recorded in an append-only history, and installs a default created are marked Automatic. When the tenant owner published the default, its installs grant the publisher the workspace name and uninstall, as for a manual install; a default published by anyone else stays anonymous.
Templates of the platform (the root tenant) can be installed into workspaces of white-label tenants; a white-label tenant's own templates never leave it. A copy that crosses tenants never gives its publisher access, on install, reinstall or later. The install page offers creating a new workspace and does not ask a cross-tenant installer for publisher access; creating a template asks for its name first, and a new template creates its install folder by default.
Public API (templates token scope) for every operation, mirrored in the CLI and MCP; the UI calls the same service methods. Includes the template-integration skill, the regression testing guide with an end-to-end API check, and all 21 locales.
viethung0o0
force-pushed
the
feat/templates-share-install-sync
branch
from
November 8, 2026 19:01
6ae93c5 to
20cd0bf
Compare
viethung0o0
marked this pull request as ready for review
November 8, 2026 23:38
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…r-item locks (#1669)
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.
Summary
{{field}}tokens are rewritten to it, never left pointing at the source workspacesetCustomFieldthat names its field ships it as an id, so the field installs with the templatetemplatestoken scope) for every operation, mirrored in the CLI and MCP; the UI calls the same service methodstemplate-integrationskill, so new resources and reference fields register with TemplatesBehaviour changes
activestate; a draft-only flow is copied as an inactive draftMigration
20261102070000…20261102070700), dated after main's latest so drizzle-kit's head stays correct.run-migrations.mjsrecords them for a database that applied any earlier set of template migration names, without re-running SQL20261102070500dedupesTemplateInstalledResourceand builds its unique index concurrently. Run the read-only preflight queries in that migration's header against production before deploying20261102070700builds theAIFilequeued-run index concurrently. A failed build leaves an invalid index that the re-run drops firstValidation
pnpm lint(schema drift included) and type checks for database, business, worker, builder and CLI