Skip to content

Commit 49b1934

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/issue-27191-home-amount-pointer
2 parents 75c7a09 + 8cb8c7f commit 49b1934

40 files changed

Lines changed: 688 additions & 94 deletions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
feat(console): an admin can open a read-only package's app in Studio to look at it
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The app bar's Edit app pencil and the app switcher's 「Edit APP in Studio」 row were drawn only for an app whose package Studio lists as writable (objectui#12615), so a code or installed package's app (HotCRM, for one) offered no way into Studio at all. The same metadata authors now get a browse entry for such an app: an eye in the app bar, 「Open app in Studio」, and 「Open APP in Studio」 in the switcher, landing where the pencil would, in Studio's read-only posture. A writable package's app keeps the pencil and 「Edit APP in Studio」. The console's own apps, a package the list does not carry and a list not yet read still draw neither.
12+
13+
`useStudioEntryGate` answers the gate with a posture (`edit` or `view`) from the same server `writable` verdict; `useStudioDesignGate` is its `edit` half, so the sidebar's Design entry and a page's pencil are unchanged. Two keys are added in all ten locales: `topbar.openAppInStudio` and `layout.appSwitcher.openAppInStudio`.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
'@objectstack/plugin-audit': patch
4+
---
5+
6+
fix(platform-objects): the Setup sidebar names each settings page the way the settings hub does, and lists every page the hub lists; Notification Events and the audit action read in words
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
- **One name per settings page.** The Setup sidebar's Configuration entries now carry the hub card's title in every shipped locale. In English, "Email" becomes "Mail Delivery". In zh-CN, ja-JP and es-ES the mail, company, file storage and feature flags entries take the hub's wording (for example 邮件 becomes 邮件投递, 公司信息 becomes 公司).
12+
- **The same set of pages.** SMS Delivery (`nav_settings_sms`) and Data Lifecycle (`nav_settings_lifecycle`) gain sidebar entries; until now they were reachable only through "All Settings". Both require `manage_platform_settings`, as their settings namespaces do.
13+
- **Notification Events.** Severity options read Info / Warning / Critical, and Source Object is drawn as the object's label (the `object-ref` widget the sharing rules use) instead of its api name. The stored values are unchanged: severity keeps `info` / `warning` / `critical`, and the field still stores the object name.
14+
- **Audit action.** Each `sys_audit_log.action` option carries a label ("Config Change" for `config_change`, "Login Failed" for `login_failed`, …), so the English list, detail and System Overview's "Audit Events by Action" chart no longer show the codes. The stored values are unchanged.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/runtime': patch
3+
'@objectstack/cli': patch
4+
---
5+
6+
fix(cli): `os plugin publish` decodes the artifact's compiled manifest once, through `readCompiledPluginManifest` (#27914)
7+
8+
Clause-②: yes (widening: the `ok` arm of `@objectstack/runtime`'s exported `CompiledPluginManifestRead` gains `document`, the manifest entry as decoded before the `ManifestSchema` parse; every existing key keeps its value)
9+
Metadata-protocol: none
10+
11+
- **Before.** `os plugin publish` validated the compiled manifest through `readCompiledPluginManifest`, then decoded the same archive entry a second time to build the verbatim `plugin_manifest` upload, finding it by the CLI's own spelling of the filename. That lookup held only while the CLI's `MANIFEST_FILENAME` and the runtime's `COMPILED_PLUGIN_MANIFEST_FILE` spelled the same string.
12+
- **Now.** `readCompiledPluginManifest` answers the decoded `document` beside the parsed `manifest`, and publish uploads that document. The upload is unchanged: the artifact's own manifest, key for key, without the defaults the parse stamps (`scope`, `defaultDatasource`).

‎packages/cli/src/commands/plugin/publish.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,9 @@ export default class PluginPublish extends Command {
137137
// What is uploaded is the manifest the artifact carries, as it carries
138138
// it: the parse above stamps the schema's defaults (`scope`,
139139
// `defaultDatasource`), which would make the declared manifest differ
140-
// from the signed bytes' own. The entry is there and is a JSON object:
141-
// the read above answered `ok`.
142-
const declaredManifest = JSON.parse(
143-
Buffer.from(archiveFiles.find((f) => f.path === MANIFEST_FILENAME)!.data).toString('utf8'),
144-
) as Record<string, unknown>;
140+
// from the signed bytes' own. The read hands back the document it
141+
// decoded, so the entry is decoded once and looked up by one spelling.
142+
const declaredManifest = read.document;
145143
const id = String(flags['manifest-id'] ?? manifest.id).trim();
146144
const version = manifest.version;
147145
const displayName = String(flags['display-name'] ?? manifest.name ?? id).trim();

‎packages/cli/test/connect-agent-both-halves-wire.pin.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
254254
.toContain('nav_connect_agent');
255255
// The Setup tree the platform admin is served BY THIS COMPOSITION: 9
256256
// authored groups less `group_approvals`, which nothing contributes
257-
// into and the filter collapses, plus the 23 entries
257+
// into and the filter collapses, plus the 25 entries
258258
// `SETUP_NAV_CONTRIBUTIONS` carries, plus the MCP one.
259259
// `nav_settings_branding` is not among them, and not because of a
260260
// tenancy wall (this harness boots none): since #24766 it is
261261
// contributed by `@objectstack/service-settings` together with the
262262
// `branding` namespace, offered only where no organization wall stands,
263263
// and this harness composes platform-objects and the MCP bundle alone.
264-
expect(allowedIds).toHaveLength(32);
264+
expect(allowedIds).toHaveLength(34);
265265
expect(allowedIds).not.toContain('nav_settings_branding');
266266
// The two per-user stores are reached from the User record page, not
267267
// from Setup's menu (#23803).
@@ -284,8 +284,8 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
284284
expect(withAccountHalf.statusCode).toBe(200);
285285
expect(withoutAccountHalf.statusCode).toBe(200);
286286
expect(navIds(withAccountHalf.body?.item)).toEqual(navIds(withoutAccountHalf.body?.item));
287-
// 32: the composition the count in the test above states.
288-
expect(navIds(withAccountHalf.body?.item)).toHaveLength(32);
287+
// 34: the composition the count in the test above states.
288+
expect(navIds(withAccountHalf.body?.item)).toHaveLength(34);
289289

290290
// The mechanism behind the invariance, asserted rather than assumed:
291291
// the bundle aims exactly one contribution at `setup` and one at
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* `os plugin publish` uploads the compiled manifest from the one decode
5+
* `readCompiledPluginManifest` makes (#27914): the `plugin_manifest` payload
6+
* is the archive entry's own document, key for key, and the door does not
7+
* depend on the CLI's `MANIFEST_FILENAME` spelling the runtime's
8+
* `COMPILED_PLUGIN_MANIFEST_FILE`.
9+
*/
10+
11+
import { describe, it, expect, afterEach, vi } from 'vitest';
12+
import { mkdtemp, rm, writeFile } from 'node:fs/promises';
13+
import { tmpdir } from 'node:os';
14+
import { join } from 'node:path';
15+
16+
// The CLI's constant spelled differently from the runtime's, as a drift
17+
// between the two packages would leave it.
18+
vi.mock('../src/utils/osplugin.js', async (importOriginal) => ({
19+
...(await importOriginal<typeof import('../src/utils/osplugin.js')>()),
20+
MANIFEST_FILENAME: 'objectstack.plugin.drifted.json',
21+
}));
22+
23+
import { createTarGz, type ArchiveFile } from '../src/utils/osplugin.js';
24+
import PluginPublish from '../src/commands/plugin/publish.js';
25+
26+
// The runtime's spelling (`COMPILED_PLUGIN_MANIFEST_FILE`), which the artifact uses.
27+
const RUNTIME_MANIFEST_FILE = 'objectstack.plugin.json';
28+
29+
// No `integrity` map: the preflight's exemption list is spelled with the
30+
// CLI constant, and this file is about the manifest read only.
31+
const manifest = {
32+
version: '1.2.0', id: 'com.acme.demo', name: 'Demo', type: 'plugin',
33+
main: 'dist/index.mjs', packaging: 'bundled', runtime: 'sandbox',
34+
permissions: { services: ['object'] },
35+
};
36+
const manifestText = JSON.stringify(manifest, null, 4);
37+
38+
describe('os plugin publish: the uploaded manifest is the entry it decoded once', () => {
39+
let dir: string | undefined;
40+
const prevEnv = { url: process.env.OS_CLOUD_URL, key: process.env.OS_CLOUD_API_KEY };
41+
afterEach(async () => {
42+
vi.unstubAllGlobals();
43+
process.env.OS_CLOUD_URL = prevEnv.url;
44+
process.env.OS_CLOUD_API_KEY = prevEnv.key;
45+
if (dir) await rm(dir, { recursive: true, force: true });
46+
});
47+
48+
it("publishes when the CLI's filename constant and the runtime's differ, and uploads the entry's document key for key", async () => {
49+
const files: ArchiveFile[] = [
50+
{ path: 'dist/index.mjs', data: new Uint8Array(Buffer.from('export const x=1;\n')) },
51+
{ path: RUNTIME_MANIFEST_FILE, data: new Uint8Array(Buffer.from(manifestText)) },
52+
];
53+
dir = await mkdtemp(join(tmpdir(), 'plugin-publish-entry-'));
54+
const artifactPath = join(dir, 'com.acme.demo-1.2.0.osplugin');
55+
await writeFile(artifactPath, new Uint8Array(createTarGz(files)));
56+
process.env.OS_CLOUD_URL = 'http://cloud.test';
57+
process.env.OS_CLOUD_API_KEY = 'tok_123';
58+
const bodies: any[] = [];
59+
vi.stubGlobal('fetch', vi.fn(async (url: string, init: any) => {
60+
bodies.push(JSON.parse(init.body));
61+
const data = url.endsWith('/versions') ? { version: '1.2.0' } : { id: 'pkg_1', created: true };
62+
return { ok: true, status: 200, json: async () => ({ success: true, data }), statusText: 'OK' } as any;
63+
}));
64+
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
65+
try {
66+
await PluginPublish.run([artifactPath]);
67+
} finally {
68+
logSpy.mockRestore();
69+
}
70+
expect(bodies).toHaveLength(2);
71+
expect(JSON.stringify(bodies[1].plugin_manifest)).toBe(JSON.stringify(JSON.parse(manifestText)));
72+
});
73+
});

‎packages/cli/test/plugin-publish.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ describe('os plugin publish (end-to-end, mocked cloud)', () => {
135135
// Exactly the artifact's own manifest: `ManifestSchema` would stamp
136136
// `scope` and `defaultDatasource`, and neither is uploaded.
137137
expect(bodies[1].plugin_manifest).toEqual(manifest);
138+
// Key for key, in the archive entry's own order (#27914).
139+
const entry = readTarGz(blob).find((f) => f.path === MANIFEST_FILENAME)!;
140+
expect(JSON.stringify(bodies[1].plugin_manifest)).toBe(JSON.stringify(JSON.parse(Buffer.from(entry.data).toString('utf8'))));
138141
expect(bodies[1].plugin_manifest).not.toHaveProperty('scope');
139142
expect(bodies[1].plugin_manifest).not.toHaveProperty('defaultDatasource');
140143
});

‎packages/platform-objects/src/apps/setup-nav.contributions.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,19 @@ export const SETUP_NAV_CONTRIBUTIONS: NavigationContribution[] = [
137137
// with the `branding` namespace, which is offered only where no
138138
// organization wall stands (#24766) — so the entry lives and dies with it.
139139
{ id: 'nav_settings_auth', type: 'url', label: 'Authentication', url: '/apps/setup/system/settings/auth', icon: 'lock-keyhole', requiredPermissions: ['manage_platform_settings'] },
140-
{ id: 'nav_settings_mail', type: 'url', label: 'Email', url: '/apps/setup/system/settings/mail', icon: 'mail', requiredPermissions: ['manage_platform_settings'] },
140+
// Every entry below opening a settings page carries that page's hub
141+
// title, and every hub page has one (#27854): the sidebar and the
142+
// "All Settings" hub are two lists of one set of pages. Pinned against
143+
// the registered manifests and both translation bundles in
144+
// `@objectstack/service-settings` (`setup-nav-hub-parity.test.ts`).
145+
{ id: 'nav_settings_mail', type: 'url', label: 'Mail Delivery', url: '/apps/setup/system/settings/mail', icon: 'mail', requiredPermissions: ['manage_platform_settings'] },
146+
{ id: 'nav_settings_sms', type: 'url', label: 'SMS Delivery', url: '/apps/setup/system/settings/sms', icon: 'message-square', requiredPermissions: ['manage_platform_settings'] },
141147
{ id: 'nav_settings_storage', type: 'url', label: 'File Storage', url: '/apps/setup/system/settings/storage', icon: 'hard-drive', requiredPermissions: ['manage_platform_settings'] },
142148
{ id: 'nav_settings_ai', type: 'url', label: 'AI & Embedder', url: '/apps/setup/system/settings/ai', icon: 'sparkles', requiredPermissions: ['manage_platform_settings'] },
143149
{ id: 'nav_settings_knowledge', type: 'url', label: 'Knowledge', url: '/apps/setup/system/settings/knowledge', icon: 'book-open', requiredPermissions: ['manage_platform_settings'] },
150+
// `lifecycle` is `@objectstack/objectql`'s manifest (ADR-0057), offered
151+
// wherever a settings service is mounted, like the entries above.
152+
{ id: 'nav_settings_lifecycle', type: 'url', label: 'Data Lifecycle', url: '/apps/setup/system/settings/lifecycle', icon: 'timer', requiredPermissions: ['manage_platform_settings'] },
144153
{ id: 'nav_settings_feature_flags', type: 'url', label: 'Feature Flags', url: '/apps/setup/system/settings/feature_flags', icon: 'flag' },
145154
],
146155
},

‎packages/platform-objects/src/apps/translations/en.objects.generated.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,9 +2531,9 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
25312531
label: "Severity",
25322532
help: "Severity hint for rendering / filtering",
25332533
options: {
2534-
info: "info",
2535-
warning: "warning",
2536-
critical: "critical"
2534+
info: "Info",
2535+
warning: "Warning",
2536+
critical: "Critical"
25372537
}
25382538
},
25392539
suppressed_channels: {

‎packages/platform-objects/src/apps/translations/en.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,14 @@ export const en: TranslationData = {
126126
nav_settings_localization: { label: 'Localization' },
127127
nav_exchange_rates: { label: 'Exchange Rates' },
128128
nav_settings_company: { label: 'Company' },
129-
nav_settings_mail: { label: 'Email' },
129+
nav_settings_mail: { label: 'Mail Delivery' },
130+
nav_settings_sms: { label: 'SMS Delivery' },
130131
nav_settings_branding: { label: 'Branding' },
131132
nav_settings_auth: { label: 'Authentication' },
132133
nav_settings_storage: { label: 'File Storage' },
133134
nav_settings_ai: { label: 'AI & Embedder' },
134135
nav_settings_knowledge: { label: 'Knowledge' },
136+
nav_settings_lifecycle: { label: 'Data Lifecycle' },
135137
nav_settings_feature_flags: { label: 'Feature Flags' },
136138
// Notifications (contributed by @objectstack/service-messaging)
137139
nav_notification_preferences: { label: 'Notification Preferences' },

0 commit comments

Comments
 (0)