@objectstack/platform-objects 7.1.0 → 7.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ export { SysAccount, SysApiKey, SysDepartment, SysDepartmentMember, SysDeviceCod
2
2
  export { SysPermissionSet, SysRecordShare, SysRole, SysRolePermissionSet, SysShareLink, SysSharingRule, SysUserPermissionSet, defaultPermissionSets } from './security/index.mjs';
3
3
  export { SysActivity, SysApprovalAction, SysApprovalProcess, SysApprovalRequest, SysAttachment, SysAuditLog, SysComment, SysEmail, SysEmailTemplate, SysJob, SysJobQueue, SysJobRun, SysNotification, SysPresence, SysReportSchedule, SysSavedReport } from './audit/index.mjs';
4
4
  export { SysWebhook } from './integration/index.mjs';
5
- export { SysMetadata, SysMetadataHistoryObject, SysMetadata as SysMetadataObject } from './metadata/index.mjs';
5
+ export { SysMetadata, SysMetadataAuditObject, SysMetadataHistoryObject, SysMetadata as SysMetadataObject } from './metadata/index.mjs';
6
6
  export { SysSecret, SysSetting, SysSettingAudit } from './system/index.mjs';
7
7
  export { ACCOUNT_APP, SETUP_APP, STUDIO_APP, SetupAppTranslations, SystemOverviewDashboard, en, esES, jaJP, zhCN } from './apps/index.mjs';
8
8
  export { SysOrganizationDetailPage, SysUserDetailPage } from './pages/index.mjs';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { SysAccount, SysApiKey, SysDepartment, SysDepartmentMember, SysDeviceCod
2
2
  export { SysPermissionSet, SysRecordShare, SysRole, SysRolePermissionSet, SysShareLink, SysSharingRule, SysUserPermissionSet, defaultPermissionSets } from './security/index.js';
3
3
  export { SysActivity, SysApprovalAction, SysApprovalProcess, SysApprovalRequest, SysAttachment, SysAuditLog, SysComment, SysEmail, SysEmailTemplate, SysJob, SysJobQueue, SysJobRun, SysNotification, SysPresence, SysReportSchedule, SysSavedReport } from './audit/index.js';
4
4
  export { SysWebhook } from './integration/index.js';
5
- export { SysMetadata, SysMetadataHistoryObject, SysMetadata as SysMetadataObject } from './metadata/index.js';
5
+ export { SysMetadata, SysMetadataAuditObject, SysMetadataHistoryObject, SysMetadata as SysMetadataObject } from './metadata/index.js';
6
6
  export { SysSecret, SysSetting, SysSettingAudit } from './system/index.js';
7
7
  export { ACCOUNT_APP, SETUP_APP, STUDIO_APP, SetupAppTranslations, SystemOverviewDashboard, en, esES, jaJP, zhCN } from './apps/index.js';
8
8
  export { SysOrganizationDetailPage, SysUserDetailPage } from './pages/index.js';
package/dist/index.js CHANGED
@@ -12,6 +12,12 @@ var SysUser = data.ObjectSchema.create({
12
12
  icon: "user",
13
13
  isSystem: true,
14
14
  managedBy: "better-auth",
15
+ // ADR-0010 §3.7 — identity table is managed by better-auth; schema must not drift.
16
+ protection: {
17
+ lock: "full",
18
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
19
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
20
+ },
15
21
  description: "User accounts for authentication",
16
22
  displayNameField: "name",
17
23
  titleFormat: "{name}",
@@ -424,6 +430,14 @@ var SysSession = data.ObjectSchema.create({
424
430
  icon: "key",
425
431
  isSystem: true,
426
432
  managedBy: "better-auth",
433
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
434
+ // but may add overlay row-level config. Use `no-overlay` if you need to
435
+ // forbid sys_metadata overlays entirely.
436
+ protection: {
437
+ lock: "full",
438
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
439
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
440
+ },
427
441
  description: "Active user sessions",
428
442
  displayNameField: "user_id",
429
443
  titleFormat: "Session \u2014 {user_id}",
@@ -579,6 +593,14 @@ var SysAccount = data.ObjectSchema.create({
579
593
  icon: "link",
580
594
  isSystem: true,
581
595
  managedBy: "better-auth",
596
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
597
+ // but may add overlay row-level config. Use `no-overlay` if you need to
598
+ // forbid sys_metadata overlays entirely.
599
+ protection: {
600
+ lock: "full",
601
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
602
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
603
+ },
582
604
  description: "OAuth and authentication provider accounts",
583
605
  titleFormat: "{provider_id} - {account_id}",
584
606
  compactLayout: ["provider_id", "user_id", "account_id"],
@@ -603,7 +625,7 @@ var SysAccount = data.ObjectSchema.create({
603
625
  mode: "create",
604
626
  locations: ["list_toolbar"],
605
627
  type: "url",
606
- target: "/api/v1/auth/sign-in/social?provider=${param.provider}&callbackURL=${ctx.origin}/apps/account/sys_account",
628
+ target: "/api/v1/auth/sign-in/social?provider=${param.provider}&callbackURL=${ctx.origin}/_console/apps/account/sys_account",
607
629
  params: [
608
630
  {
609
631
  name: "provider",
@@ -752,6 +774,14 @@ var SysVerification = data.ObjectSchema.create({
752
774
  icon: "shield-check",
753
775
  isSystem: true,
754
776
  managedBy: "better-auth",
777
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
778
+ // but may add overlay row-level config. Use `no-overlay` if you need to
779
+ // forbid sys_metadata overlays entirely.
780
+ protection: {
781
+ lock: "full",
782
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
783
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
784
+ },
755
785
  description: "Email and phone verification tokens",
756
786
  titleFormat: "Verification for {identifier}",
757
787
  compactLayout: ["identifier", "expires_at", "created_at"],
@@ -807,6 +837,14 @@ var SysOrganization = data.ObjectSchema.create({
807
837
  icon: "building-2",
808
838
  isSystem: true,
809
839
  managedBy: "better-auth",
840
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
841
+ // but may add overlay row-level config. Use `no-overlay` if you need to
842
+ // forbid sys_metadata overlays entirely.
843
+ protection: {
844
+ lock: "full",
845
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
846
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
847
+ },
810
848
  description: "Organizations for multi-tenant grouping",
811
849
  displayNameField: "name",
812
850
  titleFormat: "{name}",
@@ -1009,6 +1047,14 @@ var SysMember = data.ObjectSchema.create({
1009
1047
  icon: "user-check",
1010
1048
  isSystem: true,
1011
1049
  managedBy: "better-auth",
1050
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1051
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1052
+ // forbid sys_metadata overlays entirely.
1053
+ protection: {
1054
+ lock: "full",
1055
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1056
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1057
+ },
1012
1058
  description: "Organization membership records",
1013
1059
  titleFormat: "{user_id} in {organization_id}",
1014
1060
  compactLayout: ["user_id", "organization_id", "role"],
@@ -1158,6 +1204,14 @@ var SysInvitation = data.ObjectSchema.create({
1158
1204
  icon: "mail",
1159
1205
  isSystem: true,
1160
1206
  managedBy: "better-auth",
1207
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1208
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1209
+ // forbid sys_metadata overlays entirely.
1210
+ protection: {
1211
+ lock: "full",
1212
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1213
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1214
+ },
1161
1215
  description: "Organization invitations for user onboarding",
1162
1216
  titleFormat: "Invitation to {organization_id}",
1163
1217
  compactLayout: ["email", "organization_id", "status"],
@@ -1358,6 +1412,14 @@ var SysTeam = data.ObjectSchema.create({
1358
1412
  icon: "users",
1359
1413
  isSystem: true,
1360
1414
  managedBy: "better-auth",
1415
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1416
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1417
+ // forbid sys_metadata overlays entirely.
1418
+ protection: {
1419
+ lock: "full",
1420
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1421
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1422
+ },
1361
1423
  description: "Teams within organizations for fine-grained grouping",
1362
1424
  displayNameField: "name",
1363
1425
  titleFormat: "{name}",
@@ -1495,6 +1557,14 @@ var SysTeamMember = data.ObjectSchema.create({
1495
1557
  icon: "user-plus",
1496
1558
  isSystem: true,
1497
1559
  managedBy: "better-auth",
1560
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1561
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1562
+ // forbid sys_metadata overlays entirely.
1563
+ protection: {
1564
+ lock: "full",
1565
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1566
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1567
+ },
1498
1568
  description: "Team membership records linking users to teams",
1499
1569
  titleFormat: "{user_id} in {team_id}",
1500
1570
  compactLayout: ["user_id", "team_id", "created_at"],
@@ -1822,6 +1892,14 @@ var SysApiKey = data.ObjectSchema.create({
1822
1892
  icon: "key-round",
1823
1893
  isSystem: true,
1824
1894
  managedBy: "better-auth",
1895
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1896
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1897
+ // forbid sys_metadata overlays entirely.
1898
+ protection: {
1899
+ lock: "full",
1900
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1901
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1902
+ },
1825
1903
  description: "API keys for programmatic access",
1826
1904
  displayNameField: "name",
1827
1905
  titleFormat: "{name}",
@@ -2004,6 +2082,14 @@ var SysTwoFactor = data.ObjectSchema.create({
2004
2082
  icon: "smartphone",
2005
2083
  isSystem: true,
2006
2084
  managedBy: "better-auth",
2085
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2086
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2087
+ // forbid sys_metadata overlays entirely.
2088
+ protection: {
2089
+ lock: "full",
2090
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2091
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2092
+ },
2007
2093
  description: "Two-factor authentication credentials",
2008
2094
  titleFormat: "Two-factor for {user_id}",
2009
2095
  compactLayout: ["user_id", "created_at"],
@@ -2150,6 +2236,14 @@ var SysDeviceCode = data.ObjectSchema.create({
2150
2236
  icon: "key-round",
2151
2237
  isSystem: true,
2152
2238
  managedBy: "better-auth",
2239
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2240
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2241
+ // forbid sys_metadata overlays entirely.
2242
+ protection: {
2243
+ lock: "full",
2244
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2245
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2246
+ },
2153
2247
  description: "OAuth 2.0 Device Authorization Grant (RFC 8628) pending requests",
2154
2248
  titleFormat: "{user_code}",
2155
2249
  compactLayout: ["user_code", "status", "client_id", "expires_at"],
@@ -2329,6 +2423,14 @@ var SysOauthApplication = data.ObjectSchema.create({
2329
2423
  icon: "key-round",
2330
2424
  isSystem: true,
2331
2425
  managedBy: "better-auth",
2426
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2427
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2428
+ // forbid sys_metadata overlays entirely.
2429
+ protection: {
2430
+ lock: "full",
2431
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2432
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2433
+ },
2332
2434
  description: "Registered OAuth/OIDC client applications",
2333
2435
  displayNameField: "name",
2334
2436
  titleFormat: "{name}",
@@ -2723,6 +2825,14 @@ var SysOauthAccessToken = data.ObjectSchema.create({
2723
2825
  icon: "ticket",
2724
2826
  isSystem: true,
2725
2827
  managedBy: "better-auth",
2828
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2829
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2830
+ // forbid sys_metadata overlays entirely.
2831
+ protection: {
2832
+ lock: "full",
2833
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2834
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2835
+ },
2726
2836
  description: "Opaque OAuth access tokens issued to client applications",
2727
2837
  compactLayout: ["client_id", "user_id", "expires_at"],
2728
2838
  fields: {
@@ -2801,6 +2911,14 @@ var SysOauthRefreshToken = data.ObjectSchema.create({
2801
2911
  icon: "refresh-cw",
2802
2912
  isSystem: true,
2803
2913
  managedBy: "better-auth",
2914
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2915
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2916
+ // forbid sys_metadata overlays entirely.
2917
+ protection: {
2918
+ lock: "full",
2919
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2920
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2921
+ },
2804
2922
  description: "Opaque OAuth refresh tokens (linked to a session)",
2805
2923
  compactLayout: ["client_id", "user_id", "expires_at"],
2806
2924
  fields: {
@@ -2883,6 +3001,14 @@ var SysOauthConsent = data.ObjectSchema.create({
2883
3001
  icon: "shield-check",
2884
3002
  isSystem: true,
2885
3003
  managedBy: "better-auth",
3004
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
3005
+ // but may add overlay row-level config. Use `no-overlay` if you need to
3006
+ // forbid sys_metadata overlays entirely.
3007
+ protection: {
3008
+ lock: "full",
3009
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
3010
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3011
+ },
2886
3012
  description: "User consent records for OAuth client applications",
2887
3013
  compactLayout: ["client_id", "user_id", "scopes"],
2888
3014
  fields: {
@@ -2943,6 +3069,14 @@ var SysJwks = data.ObjectSchema.create({
2943
3069
  icon: "key",
2944
3070
  isSystem: true,
2945
3071
  managedBy: "better-auth",
3072
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
3073
+ // but may add overlay row-level config. Use `no-overlay` if you need to
3074
+ // forbid sys_metadata overlays entirely.
3075
+ protection: {
3076
+ lock: "full",
3077
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
3078
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3079
+ },
2946
3080
  description: "Asymmetric key pairs used to sign and verify issued JWTs",
2947
3081
  compactLayout: ["id", "created_at", "expires_at"],
2948
3082
  fields: {
@@ -2990,6 +3124,13 @@ var SysRole = data.ObjectSchema.create({
2990
3124
  icon: "shield",
2991
3125
  isSystem: true,
2992
3126
  managedBy: "config",
3127
+ // ADR-0010 §3.7 — RBAC primitive; tenants may add custom rows
3128
+ // (created via UI / API) but the schema itself is locked.
3129
+ protection: {
3130
+ lock: "no-overlay",
3131
+ reason: "RBAC schema is platform-defined \u2014 see ADR-0010.",
3132
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3133
+ },
2993
3134
  description: "Role definitions for RBAC access control",
2994
3135
  displayNameField: "label",
2995
3136
  titleFormat: "{label}",
@@ -3193,6 +3334,13 @@ var SysPermissionSet = data.ObjectSchema.create({
3193
3334
  icon: "lock",
3194
3335
  isSystem: true,
3195
3336
  managedBy: "config",
3337
+ // ADR-0010 §3.7 — RBAC primitive; tenants may add custom rows
3338
+ // (created via UI / API) but the schema itself is locked.
3339
+ protection: {
3340
+ lock: "no-overlay",
3341
+ reason: "RBAC schema is platform-defined \u2014 see ADR-0010.",
3342
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3343
+ },
3196
3344
  description: "Named permission groupings for fine-grained access control",
3197
3345
  displayNameField: "label",
3198
3346
  titleFormat: "{label}",
@@ -6924,6 +7072,135 @@ var SysMetadataHistoryObject = data.ObjectSchema.create({
6924
7072
  trash: false
6925
7073
  }
6926
7074
  });
7075
+ var SysMetadataAuditObject = data.ObjectSchema.create({
7076
+ name: "sys_metadata_audit",
7077
+ label: "Metadata Audit",
7078
+ pluralLabel: "Metadata Audit",
7079
+ icon: "shield-check",
7080
+ isSystem: true,
7081
+ managedBy: "append-only",
7082
+ description: "Append-only audit trail of metadata write decisions (ADR-0010).",
7083
+ fields: {
7084
+ /** Primary Key (UUID) */
7085
+ id: data.Field.text({
7086
+ label: "ID",
7087
+ required: true,
7088
+ readonly: true
7089
+ }),
7090
+ /** When the decision was made (ISO-8601 UTC). */
7091
+ occurred_at: data.Field.datetime({
7092
+ label: "Occurred At",
7093
+ required: true,
7094
+ readonly: true
7095
+ }),
7096
+ /** Acting principal (user id, system id, or 'system'). */
7097
+ actor: data.Field.text({
7098
+ label: "Actor",
7099
+ required: true,
7100
+ readonly: true,
7101
+ maxLength: 255,
7102
+ description: 'Acting principal \u2014 user id, system id, or "system".'
7103
+ }),
7104
+ /** Code path that produced the decision (e.g. `protocol.saveMetaItem`). */
7105
+ source: data.Field.text({
7106
+ label: "Source",
7107
+ required: false,
7108
+ readonly: true,
7109
+ maxLength: 128
7110
+ }),
7111
+ /** Metadata type (singular, e.g. `app`, `object`, `view`). */
7112
+ type: data.Field.text({
7113
+ label: "Metadata Type",
7114
+ required: true,
7115
+ readonly: true,
7116
+ searchable: true,
7117
+ maxLength: 100
7118
+ }),
7119
+ /** Item machine name. */
7120
+ name: data.Field.text({
7121
+ label: "Name",
7122
+ required: true,
7123
+ readonly: true,
7124
+ searchable: true,
7125
+ maxLength: 255
7126
+ }),
7127
+ /** Organization for multi-tenant filtering. NULL for env-wide writes. */
7128
+ organization_id: data.Field.lookup("sys_organization", {
7129
+ label: "Organization",
7130
+ required: false,
7131
+ readonly: true
7132
+ }),
7133
+ /** Operation kind. */
7134
+ operation: data.Field.select(["save", "publish", "rollback", "delete", "reset"], {
7135
+ label: "Operation",
7136
+ required: true,
7137
+ readonly: true
7138
+ }),
7139
+ /** Decision outcome — allowed, denied (refused), or forced (bypassed via override). */
7140
+ outcome: data.Field.select(["allowed", "denied", "forced"], {
7141
+ label: "Outcome",
7142
+ required: true,
7143
+ readonly: true
7144
+ }),
7145
+ /**
7146
+ * Machine-readable code for the decision:
7147
+ * - on `allowed`: `'ok'`
7148
+ * - on `denied`: `'not_overridable'` | `'not_creatable'` |
7149
+ * `'item_locked'` | `'invalid_metadata'` | `'destructive_change'` |
7150
+ * `'metadata_conflict'`
7151
+ * - on `forced`: `'lock_override'` (Phase 3)
7152
+ */
7153
+ code: data.Field.text({
7154
+ label: "Code",
7155
+ required: true,
7156
+ readonly: true,
7157
+ maxLength: 64
7158
+ }),
7159
+ /**
7160
+ * Lock state observed at the time of the decision (`none` if the
7161
+ * item carried no `_lock`). Captured even on `allowed` rows so
7162
+ * later compliance queries can see "what was the lock state when
7163
+ * this write succeeded".
7164
+ */
7165
+ lock_state: data.Field.select(["none", "no-overlay", "no-delete", "full"], {
7166
+ label: "Lock State",
7167
+ required: false,
7168
+ readonly: true
7169
+ }),
7170
+ /** True when the write succeeded by bypassing a lock (Phase 3). */
7171
+ lock_overridden: data.Field.boolean({
7172
+ label: "Lock Overridden",
7173
+ required: false,
7174
+ readonly: true
7175
+ }),
7176
+ /** Optional request correlation id for tracing. */
7177
+ request_id: data.Field.text({
7178
+ label: "Request ID",
7179
+ required: false,
7180
+ readonly: true,
7181
+ maxLength: 128
7182
+ }),
7183
+ /** Optional free-form context (e.g. brief diff summary). */
7184
+ note: data.Field.textarea({
7185
+ label: "Note",
7186
+ required: false,
7187
+ readonly: true
7188
+ })
7189
+ },
7190
+ indexes: [
7191
+ { fields: ["organization_id", "occurred_at"] },
7192
+ { fields: ["type", "name", "occurred_at"] },
7193
+ { fields: ["actor", "occurred_at"] },
7194
+ { fields: ["outcome"] }
7195
+ ],
7196
+ enable: {
7197
+ trackHistory: false,
7198
+ searchable: false,
7199
+ apiEnabled: true,
7200
+ apiMethods: ["get", "list"],
7201
+ trash: false
7202
+ }
7203
+ });
6927
7204
  var SysSetting = data.ObjectSchema.create({
6928
7205
  name: "sys_setting",
6929
7206
  label: "Setting",
@@ -7317,6 +7594,13 @@ var SETUP_APP = {
7317
7594
  icon: "settings",
7318
7595
  active: true,
7319
7596
  isDefault: false,
7597
+ // ADR-0010 §3.7 — author-facing protection block. Loader translates
7598
+ // this into the `_lock` envelope at registration time.
7599
+ protection: {
7600
+ lock: "full",
7601
+ reason: "Core admin UI shipped by @objectstack/platform-objects \u2014 see ADR-0010.",
7602
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
7603
+ },
7320
7604
  branding: {
7321
7605
  primaryColor: "#475569"
7322
7606
  // Slate-600 — neutral admin palette
@@ -7548,6 +7832,31 @@ var STUDIO_APP = {
7548
7832
  // Indigo-500 — distinct from Setup's slate
7549
7833
  },
7550
7834
  requiredPermissions: ["studio.access"],
7835
+ contextSelectors: [
7836
+ {
7837
+ // Package scope — pinned to the sidebar header. Selecting a package
7838
+ // injects `{active_package}` into every `metadata:resource` nav
7839
+ // item below, so the whole workbench filters to that package in
7840
+ // one click. Options come from the installed-packages REST surface,
7841
+ // narrowed to project-scoped packages: this dropdown exists so
7842
+ // third-party developers can scope to *their* custom package, so we
7843
+ // deliberately hide the platform's own system/cloud kernel packages
7844
+ // (auth, security, audit, queue, …) which are not user-authored.
7845
+ id: "active_package",
7846
+ label: "Package",
7847
+ icon: "package",
7848
+ optionsSource: {
7849
+ endpoint: "/api/v1/packages",
7850
+ valueKey: "manifest.id",
7851
+ labelKey: "manifest.name",
7852
+ filter: [{ key: "manifest.scope", op: "nin", value: ["system", "cloud"] }]
7853
+ },
7854
+ includeAll: true,
7855
+ allValue: "",
7856
+ persist: "query",
7857
+ placement: "sidebar_header"
7858
+ }
7859
+ ],
7551
7860
  navigation: [
7552
7861
  {
7553
7862
  id: "group_overview",
@@ -7578,7 +7887,7 @@ var STUDIO_APP = {
7578
7887
  type: "component",
7579
7888
  label: "Objects",
7580
7889
  componentRef: "metadata:resource",
7581
- params: { type: "object" },
7890
+ params: { type: "object", package: "{active_package}" },
7582
7891
  icon: "box"
7583
7892
  },
7584
7893
  {
@@ -7586,7 +7895,7 @@ var STUDIO_APP = {
7586
7895
  type: "component",
7587
7896
  label: "Validations",
7588
7897
  componentRef: "metadata:resource",
7589
- params: { type: "validation" },
7898
+ params: { type: "validation", package: "{active_package}" },
7590
7899
  icon: "check-square"
7591
7900
  }
7592
7901
  ]
@@ -7603,7 +7912,7 @@ var STUDIO_APP = {
7603
7912
  type: "component",
7604
7913
  label: "Apps",
7605
7914
  componentRef: "metadata:resource",
7606
- params: { type: "app" },
7915
+ params: { type: "app", package: "{active_package}" },
7607
7916
  icon: "app-window"
7608
7917
  },
7609
7918
  {
@@ -7611,7 +7920,7 @@ var STUDIO_APP = {
7611
7920
  type: "component",
7612
7921
  label: "Views",
7613
7922
  componentRef: "metadata:resource",
7614
- params: { type: "view" },
7923
+ params: { type: "view", package: "{active_package}" },
7615
7924
  icon: "table"
7616
7925
  },
7617
7926
  {
@@ -7619,7 +7928,7 @@ var STUDIO_APP = {
7619
7928
  type: "component",
7620
7929
  label: "Pages",
7621
7930
  componentRef: "metadata:resource",
7622
- params: { type: "page" },
7931
+ params: { type: "page", package: "{active_package}" },
7623
7932
  icon: "file-text"
7624
7933
  },
7625
7934
  {
@@ -7627,7 +7936,7 @@ var STUDIO_APP = {
7627
7936
  type: "component",
7628
7937
  label: "Dashboards",
7629
7938
  componentRef: "metadata:resource",
7630
- params: { type: "dashboard" },
7939
+ params: { type: "dashboard", package: "{active_package}" },
7631
7940
  icon: "layout-dashboard"
7632
7941
  },
7633
7942
  {
@@ -7635,7 +7944,7 @@ var STUDIO_APP = {
7635
7944
  type: "component",
7636
7945
  label: "Reports",
7637
7946
  componentRef: "metadata:resource",
7638
- params: { type: "report" },
7947
+ params: { type: "report", package: "{active_package}" },
7639
7948
  icon: "bar-chart-3"
7640
7949
  }
7641
7950
  ]
@@ -7652,7 +7961,7 @@ var STUDIO_APP = {
7652
7961
  type: "component",
7653
7962
  label: "Actions",
7654
7963
  componentRef: "metadata:resource",
7655
- params: { type: "action" },
7964
+ params: { type: "action", package: "{active_package}" },
7656
7965
  icon: "mouse-pointer-click"
7657
7966
  },
7658
7967
  {
@@ -7660,7 +7969,7 @@ var STUDIO_APP = {
7660
7969
  type: "component",
7661
7970
  label: "Hooks",
7662
7971
  componentRef: "metadata:resource",
7663
- params: { type: "hook" },
7972
+ params: { type: "hook", package: "{active_package}" },
7664
7973
  icon: "webhook"
7665
7974
  }
7666
7975
  ]
@@ -7677,7 +7986,7 @@ var STUDIO_APP = {
7677
7986
  type: "component",
7678
7987
  label: "Flows",
7679
7988
  componentRef: "metadata:resource",
7680
- params: { type: "flow" },
7989
+ params: { type: "flow", package: "{active_package}" },
7681
7990
  icon: "git-branch"
7682
7991
  },
7683
7992
  {
@@ -7685,7 +7994,7 @@ var STUDIO_APP = {
7685
7994
  type: "component",
7686
7995
  label: "Workflow Rules",
7687
7996
  componentRef: "metadata:resource",
7688
- params: { type: "workflow" },
7997
+ params: { type: "workflow", package: "{active_package}" },
7689
7998
  icon: "zap"
7690
7999
  },
7691
8000
  {
@@ -7693,7 +8002,7 @@ var STUDIO_APP = {
7693
8002
  type: "component",
7694
8003
  label: "Approval Processes",
7695
8004
  componentRef: "metadata:resource",
7696
- params: { type: "approval" },
8005
+ params: { type: "approval", package: "{active_package}" },
7697
8006
  icon: "check-circle"
7698
8007
  }
7699
8008
  ]
@@ -7712,7 +8021,7 @@ var STUDIO_APP = {
7712
8021
  type: "component",
7713
8022
  label: "Agents",
7714
8023
  componentRef: "metadata:resource",
7715
- params: { type: "agent" },
8024
+ params: { type: "agent", package: "{active_package}" },
7716
8025
  icon: "bot"
7717
8026
  },
7718
8027
  {
@@ -7720,7 +8029,7 @@ var STUDIO_APP = {
7720
8029
  type: "component",
7721
8030
  label: "Tools",
7722
8031
  componentRef: "metadata:resource",
7723
- params: { type: "tool" },
8032
+ params: { type: "tool", package: "{active_package}" },
7724
8033
  icon: "wrench"
7725
8034
  },
7726
8035
  {
@@ -7728,7 +8037,7 @@ var STUDIO_APP = {
7728
8037
  type: "component",
7729
8038
  label: "Skills",
7730
8039
  componentRef: "metadata:resource",
7731
- params: { type: "skill" },
8040
+ params: { type: "skill", package: "{active_package}" },
7732
8041
  icon: "brain"
7733
8042
  }
7734
8043
  ]
@@ -7781,7 +8090,7 @@ var STUDIO_APP = {
7781
8090
  type: "component",
7782
8091
  label: "Email Templates",
7783
8092
  componentRef: "metadata:resource",
7784
- params: { type: "email_template" },
8093
+ params: { type: "email_template", package: "{active_package}" },
7785
8094
  icon: "mail"
7786
8095
  }
7787
8096
  ]
@@ -26029,6 +26338,7 @@ exports.SysJobRun = SysJobRun;
26029
26338
  exports.SysJwks = SysJwks;
26030
26339
  exports.SysMember = SysMember;
26031
26340
  exports.SysMetadata = SysMetadataObject;
26341
+ exports.SysMetadataAuditObject = SysMetadataAuditObject;
26032
26342
  exports.SysMetadataHistoryObject = SysMetadataHistoryObject;
26033
26343
  exports.SysMetadataObject = SysMetadataObject;
26034
26344
  exports.SysNotification = SysNotification;