Add /:org/:workspace context for web and API#508
Draft
RhysSullivan wants to merge 2 commits intors/cloud-workspaces-06-web-orgfrom
Draft
Add /:org/:workspace context for web and API#508RhysSullivan wants to merge 2 commits intors/cloud-workspaces-06-web-orgfrom
RhysSullivan wants to merge 2 commits intors/cloud-workspaces-06-web-orgfrom
Conversation
Workspace context is the URL-addressed sibling to org/global. The URL determines which executor scope stack the server builds; reads operate against that stack. The same ProtectedCloudApi schema serves both `/api/:org/...` and `/api/:org/:workspace/...` mounts. API: - Mount ProtectedCloudApi twice (`/api/:org` and `/api/:org/:workspace`) via prefixed router views. - ExecutionStackMiddleware reads `:org` and optional `:workspace` from URL params, resolves the workspace via resolveWorkspaceContext, and routes through buildWorkspaceScopeStack vs buildGlobalScopeStack. Auth check is unchanged: org membership only — workspaces have no separate ACLs in v1. - Test harness: dual-mount mirrors production. seedTestWorkspace() inserts the workspace row lazily inside the request pipeline (no extra DbService.Live to leak sockets). asWorkspace(orgId, slug, …) pre-registers the slug so the URL-segment parser treats it as a workspace prefix; the row is created on first request. - New workspace-context.node.test.ts pins down: (1) workspace-scoped writes are visible from workspace context only, (2) workspace context inherits org/global sources via the scope stack. Web: - Routes: /:org/:workspace layout + index/connections/secrets/policies/ tools/sources.$namespace/sources.add.$pluginKey. Layout resolves the slug from workspacesAtom, redirects to /$org if unknown, re-points the executor base URL at the workspace-prefixed mount, and provides WorkspaceRouteContext to descendants. - Shell nav: when in workspace context, NavItem to/params target the /$org/$workspace/... routes; org-admin items (Settings, Billing) are hidden. SourceList builds workspace-scoped detail links too. - Context switcher: per active org, pinned `Global` entry + separator + workspaces. Trigger label is `<org> / Global` or `<org> / <workspaceName>`. New "Create workspace" item opens a dialog that POSTs and navigates to the new /$org/$slug. - workspacesAtom queries OrgHttpApi.workspaces.listWorkspaces; CloudApiClient now adds the WorkspacesApi group so the call types. - workspaceWriteKeys reactivity key invalidates the list on create.
…kspace Adds a URL-context-aware fetch wrapper in the react package so the ExecutorApiClient and CloudApiClient rewrite /api/<rest> -> /api/<org>/<rest> (or /api/<org>/<workspace>/<rest>) at fetch time based on window.location.pathname. AtomHttpApi.Service snapshots baseUrl at module load, so setBaseUrl in routes/$org.tsx couldn't repoint it; the wrapper makes the per-org URL effective without rebuilding the service. Auth/sentry/autumn endpoints stay unprefixed via UNPREFIXED_API_PATHS.
This was referenced May 4, 2026
Owner
Author
This was referenced May 4, 2026
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 0865ef9 | Commit Preview URL Branch Preview URL |
May 04 2026, 05:15 PM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/storage-core
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-google-discovery
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 0865ef9 | May 04 2026, 05:16 PM |
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.

Add /:org/:workspace context for web and API
Workspace context is the URL-addressed sibling to org/global. The
URL determines which executor scope stack the server builds; reads
operate against that stack. The same ProtectedCloudApi schema serves
both
/api/:org/...and/api/:org/:workspace/...mounts.API:
/api/:organd/api/:org/:workspace)via prefixed router views.
:organd optional:workspacefrom URL params, resolves the workspace via resolveWorkspaceContext,
and routes through buildWorkspaceScopeStack vs buildGlobalScopeStack.
Auth check is unchanged: org membership only — workspaces have no
separate ACLs in v1.
inserts the workspace row lazily inside the request pipeline (no
extra DbService.Live to leak sockets). asWorkspace(orgId, slug, …)
pre-registers the slug so the URL-segment parser treats it as a
workspace prefix; the row is created on first request.
writes are visible from workspace context only, (2) workspace
context inherits org/global sources via the scope stack.
Web:
tools/sources.$namespace/sources.add.$pluginKey. Layout resolves
the slug from workspacesAtom, redirects to /$org if unknown,
re-points the executor base URL at the workspace-prefixed mount,
and provides WorkspaceRouteContext to descendants.
/$org/$workspace/... routes; org-admin items (Settings, Billing)
are hidden. SourceList builds workspace-scoped detail links too.
Globalentry +separator + workspaces. Trigger label is
<org> / Globalor<org> / <workspaceName>. New "Create workspace" item opens adialog that POSTs and navigates to the new /$org/$slug.
CloudApiClient now adds the WorkspacesApi group so the call types.
Strip /api in start.ts means router prefixes are /:org and /:org/:workspace
Adds a URL-context-aware fetch wrapper in the react package so the
ExecutorApiClient and CloudApiClient rewrite /api/ -> /api//
(or /api///) at fetch time based on
window.location.pathname. AtomHttpApi.Service snapshots baseUrl at module
load, so setBaseUrl in routes/$org.tsx couldn't repoint it; the wrapper
makes the per-org URL effective without rebuilding the service.
Auth/sentry/autumn endpoints stay unprefixed via UNPREFIXED_API_PATHS.