Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/36834-setup-packages-entry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@objectstack/platform-objects': patch
'@objectstack/cloud-connection': patch
'@object-ui/app-shell': patch
'@object-ui/i18n': patch
---

feat(console): Setup gets one Packages entry, the package list's administration face; the Installed Apps entry retires

Clause-②: no
Metadata-protocol: none

The maintainer's ruling on objectstack#36834 amends ruling 甲 of #25098: Setup lists what is installed, with the administration actions only, and the marketplace-only "Installed Apps" entry merges into it.

- **Setup → Apps → Packages (`nav_packages`).** `@objectstack/platform-objects` contributes one entry to Setup's `group_apps`, gated on `manage_platform_settings` like Setup's other administration entries. It opens the console's `developer:packages` page with `params: { face: 'admin' }`, so the URL carries `?face=admin`. Its label is translated in every locale the Setup bundle carries.
- **The page's administration face.** With `?face=admin`, the Packages page lists every package of every source, with modules folded under their app. It shows the Name, Version, Status, Source and Update columns, plus a Source filter (All, Code, Marketplace, Authored) that writes `?source=`. Its only header action is New Package, and a package created there opens in Studio, on the address the Studio landing's package card opens. The detail sheet offers View info, Disable / Enable and Delete (keeping the choice to keep the data), plus "Open in Studio" on an authored package. Import, Edit, Publish, Revert, Export, Duplicate, Adopt loose items and the pending changes' Publish and Discard are not offered there. An unknown or repeated `face` value is refused by name. With no `face`, the page is unchanged: Studio's "All packages" link and each package card's Manage keep every action.
- **Installed Apps retires.** `MARKETPLACE_INSTALLED_UI_BUNDLE` (`@objectstack/cloud-connection`) no longer carries `nav_marketplace_installed`. The bundle stays exported under its id, with an empty `navigationContributions`, so a host that imports and registers it keeps working. The entry's labels are removed from the Setup translation bundle, and its id joins the dead-key tombstone. A bookmarked `/apps/setup/component/developer/packages?source=marketplace`, which the marketplace page's "Installed" button also opens, still shows the list filtered to marketplace installs, on the administration face.
20 changes: 12 additions & 8 deletions packages/cli/test/connect-agent-both-halves-wire.pin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,9 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
expect(groupChildren(setupAllowed.body?.item, 'group_overview'))
.toEqual(['nav_system_overview', 'nav_connect_agent']);
// The Setup tree the platform admin is served BY THIS COMPOSITION: 9
// authored groups less `group_approvals`, `group_integrations` and
// `group_apps`, which nothing in it contributes into and the filter
// collapses, plus the 27 entries `SETUP_NAV_CONTRIBUTIONS` carries,
// plus the MCP one.
// authored groups less `group_approvals` and `group_integrations`,
// which nothing in it contributes into and the filter collapses, plus
// the 29 entries `SETUP_NAV_CONTRIBUTIONS` carries, plus the MCP one.
// (25 until #25098 moved the unfiltered Packages entry to Studio; 24
// until #30204 removed the Feature Flags entry with its namespace; 32
// until #30895 moved the MCP entry out of `group_integrations`, the
Expand All @@ -278,13 +277,18 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
// Units of Measure entry, `nav_units_of_measure`, joined Configuration
// (#35488); 32 until the working-calendar pair, `nav_work_calendars`
// and `nav_work_calendar_exceptions`, joined it, ADR-0157; 34 until
// the public forms entry, `nav_public_forms`, joined it, #36444.)
// the public forms entry, `nav_public_forms`, joined it, #36444; 35
// until objectstack#36834 gave Setup its Packages entry,
// `nav_packages`, in `group_apps`, so that group is served again:
// +2, `group_apps` and `nav_packages`.)
// `nav_settings_branding` is not among them, and not because of a
// tenancy wall (this harness boots none): since #24766 it is
// contributed by `@objectstack/service-settings` together with the
// `branding` namespace, offered only where no organization wall stands,
// and this harness composes platform-objects and the MCP bundle alone.
expect(allowedIds).toHaveLength(35);
expect(allowedIds).toHaveLength(37);
expect(allowedIds).toContain('nav_packages');
expect(groupChildren(setupAllowed.body?.item, 'group_apps')).toEqual(['nav_packages']);
expect(allowedIds).toContain('nav_public_forms');
expect(allowedIds).toContain('nav_work_calendars');
expect(allowedIds).toContain('nav_work_calendar_exceptions');
Expand Down Expand Up @@ -314,8 +318,8 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
expect(withAccountHalf.statusCode).toBe(200);
expect(withoutAccountHalf.statusCode).toBe(200);
expect(navIds(withAccountHalf.body?.item)).toEqual(navIds(withoutAccountHalf.body?.item));
// 35: the composition the count in the test above states.
expect(navIds(withAccountHalf.body?.item)).toHaveLength(35);
// 37: the composition the count in the test above states.
expect(navIds(withAccountHalf.body?.item)).toHaveLength(37);

// The mechanism behind the invariance, asserted rather than assumed:
// the bundle aims exactly one contribution at `setup` and one at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2023,8 +2023,9 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
// misreading an orphaned marketplace install as user code.
this.captureBootUserCodeIds(ctx);

// Plugin-owned Setup nav (cloud ADR-0009): "Installed Apps"
// ships WITH the local-install capability.
// Plugin-owned Setup UI (cloud ADR-0009). The bundle carries no
// nav entry since objectstack#36834 (Setup's own Packages entry
// lists what is installed); it is still registered under its id.
try {
const manifest = ctx.getService<{ register(m: any): void }>('manifest');
manifest?.register?.(MARKETPLACE_INSTALLED_UI_BUNDLE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.

/**
* #23933 — the install-local plugin's "Installed Apps" entry opens Setup →
* Packages filtered to Source = marketplace (ruling B on #23892, record
* 6216295104), and the plugin no longer ships a page of its own.
* objectstack#36834 — the install-local plugin's "Installed Apps" entry
* (`nav_marketplace_installed`) is retired: Setup's own "Packages" entry
* (`nav_packages`, `@objectstack/platform-objects`) lists every installed
* package on the list's administration face, and the page's Source filter
* narrows it to marketplace installs (the maintainer's ruling 「合并,只留软件包」).
*
* ## What this file pins
*
Expand All @@ -13,30 +15,21 @@
* `navigationContributions` into the app they name — the merge
* `GET /api/v1/meta/app/setup` serves:
*
* - plugin present: Setup's `group_apps` carries `nav_marketplace_installed`,
* a `component` entry on `developer:packages` (the component Setup's own
* "Packages" entry opens) with `params: { source: 'marketplace' }`, label
* and icon unchanged; and no `marketplace_installed` page is served;
* - plugin absent: the same composition carries no such entry — the entry
* lives and dies with the capability (cloud ADR-0009).
* - plugin present: the plugin still registers `MARKETPLACE_INSTALLED_UI_BUNDLE`
* under its id, and Setup's `group_apps` carries no `nav_marketplace_installed`
* and no entry onto `developer:packages` from this package; no
* `marketplace_installed` page is served either (retired with #23933);
* - plugin absent: the same composition carries neither;
* - the bundle: still exported and importable, its id unchanged, with an
* empty `navigationContributions` and no `pages` — hosted tenants import and
* register it, so the export is the compatibility surface, not the entry.
*
* The page listing is read with a positive control: the Cloud Connection UI
* bundle registered beside it serves its `cloud_connection_settings` page
* through the same read, so "no `marketplace_installed`" is a reading of a
* listing that does carry plugin pages, not of an empty one.
*
* ## The filter spelling is objectui's, copied — not derived here
*
* `source` and `marketplace` are the spelling objectui#12675 published, read at
* the commit objectstack's `.objectui-sha` pins (`5e15928b4631`, which carries
* that card's merge `9d857c998c` as an ancestor): `packageSource.ts` declares
* `PACKAGES_SOURCE_PARAM = 'source'` and `PACKAGE_SOURCES = ['code',
* 'marketplace', 'authored']`, and its Packages page refuses any other value by
* name. The console's sidebar sends a `component` entry's `params` as the
* query string (`NavigationRenderer`'s `resolveHref`), so this entry opens
* `/apps/APP/component/developer/packages?source=marketplace`. A different
* spelling here would open a refusal, not a filtered list — this pin is what
* holds the two repositories' halves to one word.
* Every absence is read with a positive control: Browse Marketplace
* (`MARKETPLACE_BROWSE_UI_BUNDLE`, registered beside it) lands in the same
* `group_apps` through the same read, and the Cloud Connection UI bundle serves
* its `cloud_connection_settings` page through the same page listing, so "no
* entry" is a reading of a group that does carry plugin entries, not of an empty
* one.
*/

import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
Expand All @@ -55,15 +48,9 @@ import { installerAuthService, withInstallerGrants } from './install-local-princ

type Bag = Record<string, any>;

/** The entry as objectui#12675 published it for a Setup nav item. */
const FILTERED_PACKAGES_ENTRY = {
id: 'nav_marketplace_installed',
type: 'component',
label: 'Installed Apps',
componentRef: 'developer:packages',
params: { source: 'marketplace' },
icon: 'package-check',
};
/** The retired entry's id, and the component every package-list entry opens. */
const RETIRED_ID = 'nav_marketplace_installed';
const PACKAGES_REF = 'developer:packages';

/**
* A Setup shell with the group anchor the entry lands in, and the one the Cloud
Expand Down Expand Up @@ -137,6 +124,8 @@ async function compose(withPlugin: boolean) {
manifest.register(structuredClone(CLOUD_CONNECTION_UI_BUNDLE));
manifest.register(structuredClone(MARKETPLACE_BROWSE_UI_BUNDLE));
const protocol = kernel.getService<any>('protocol');
/** The manifest ids the plugin itself registered through the `manifest` service. */
const registered: string[] = [];

if (withPlugin) {
const routes = new Map<string, unknown>();
Expand All @@ -147,7 +136,12 @@ async function compose(withPlugin: boolean) {
};
const hooks = new Map<string, () => Promise<void>>();
const services: Record<string, unknown> = {
manifest,
manifest: {
register(m: { id?: string }) {
registered.push(String(m?.id));
manifest.register(m);
},
},
protocol,
metadata: kernel.getService('metadata'),
auth: installerAuthService(),
Expand All @@ -170,7 +164,7 @@ async function compose(withPlugin: boolean) {
await plugin.start(ctx as never);
await hooks.get('kernel:ready')?.();
}
return { protocol };
return { protocol, registered };
}

/** Setup's `group_apps` entries, as the metadata protocol serves the merged app. */
Expand All @@ -189,22 +183,19 @@ async function servedPageNames(protocol: any): Promise<string[]> {
return items.map((it) => it?.name).filter((n): n is string => typeof n === 'string');
}

describe('#23933 — "Installed Apps" opens Setup → Packages filtered to Source = marketplace', () => {
it('plugin present: the served entry is the filtered Packages component, label and icon unchanged', async () => {
const { protocol } = await compose(true);
const entries = (await setupAppsGroup(protocol)).filter((i) => i?.id === 'nav_marketplace_installed');
expect(entries).toHaveLength(1);
const entry = entries[0]!;
expect({
id: entry.id,
type: entry.type,
label: entry.label,
componentRef: entry.componentRef,
params: entry.params,
icon: entry.icon,
}).toEqual(FILTERED_PACKAGES_ENTRY);
// The page target is gone from the entry, not carried beside the new one.
expect(entry.pageName).toBeUndefined();
describe('#36834 — "Installed Apps" is retired; Setup → Packages lists what is installed', () => {
it('plugin present: the bundle is still registered, and Setup carries no Installed Apps entry', async () => {
const { protocol, registered } = await compose(true);
expect(registered).toContain(MARKETPLACE_INSTALLED_UI_BUNDLE.id);

const items = await setupAppsGroup(protocol);
const ids = items.map((i) => i?.id);
// Control: the read reaches the group's plugin-contributed entries.
expect(ids).toContain('nav_marketplace_browse');
expect(ids).not.toContain(RETIRED_ID);
// No marketplace-filtered (or any) package-list entry from this package:
// Setup's one door to the list is platform-objects' `nav_packages`.
expect(items.filter((i) => i?.componentRef === PACKAGES_REF)).toEqual([]);
});

it('plugin present: no `marketplace_installed` page is served (control: the Cloud Connection page is)', async () => {
Expand All @@ -215,18 +206,20 @@ describe('#23933 — "Installed Apps" opens Setup → Packages filtered to Sourc
});

it('plugin absent: the same composition carries no Installed Apps entry', async () => {
const { protocol } = await compose(false);
const { protocol, registered } = await compose(false);
expect(registered).toEqual([]);
const ids = (await setupAppsGroup(protocol)).map((i) => i?.id);
expect(ids).not.toContain('nav_marketplace_installed');
expect(ids).not.toContain(RETIRED_ID);
// Control: the read reaches the group's plugin-contributed entries.
// (Browse Marketplace, not Cloud Connection: that entry sits in
// `group_integrations` since ruling 甲 on #25097.)
expect(ids).toContain('nav_marketplace_browse');
});

it('the bundle ships the entry and no page', () => {
it('the bundle stays exported under its id, with no nav entry and no page', () => {
expect(MARKETPLACE_INSTALLED_UI_BUNDLE.id).toBe('com.objectstack.cloud-connection.marketplace-installed-ui');
expect(Object.keys(MARKETPLACE_INSTALLED_UI_BUNDLE)).not.toContain('pages');
const items = MARKETPLACE_INSTALLED_UI_BUNDLE.navigationContributions.flatMap((c) => c.items);
expect(items).toEqual([FILTERED_PACKAGES_ENTRY]);
// An array, so a host that walks it keeps working; empty, so it lands nothing.
expect(MARKETPLACE_INSTALLED_UI_BUNDLE.navigationContributions).toEqual([]);
});
});
Loading
Loading