@company-semantics/contracts 0.51.0 → 0.53.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.51.0",
3
+ "version": "0.53.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -182,6 +182,12 @@ export type {
182
182
  // Authorization context types (Phase 5)
183
183
  // @see ADR-CTRL-010 for design rationale
184
184
  OrgScopedContext,
185
+ // Workspace Info/Settings surface types (PRD-00133)
186
+ WorkspaceSurface,
187
+ WorkspaceInfoOverview,
188
+ WorkspaceSettingsOverview,
189
+ IntegrationRequestStatus,
190
+ IntegrationRequest,
185
191
  } from './org/index'
186
192
 
187
193
  export { ROLE_DISPLAY_MAP, WORKSPACE_CAPABILITIES, ROLE_CAPABILITY_MAP, VIEW_SCOPE_MAP, getViewScope } from './org/index'
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * Capability hierarchy (implicit):
24
24
  * - owner: all capabilities
25
- * - admin: invite_member, manage_members (limited)
25
+ * - admin: invite_member, manage_members (limited), manage_auth, demote_integration (own only)
26
26
  * - member: none (read-only)
27
27
  */
28
28
  export type WorkspaceCapability =
@@ -77,6 +77,7 @@ export const ROLE_CAPABILITY_MAP = {
77
77
  admin: [
78
78
  'org.invite_member',
79
79
  'org.manage_members', // Note: cannot remove/demote other admins
80
+ 'org.manage_auth',
80
81
  'org.demote_integration', // Can demote own integrations only
81
82
  ],
82
83
  member: [],
package/src/org/index.ts CHANGED
@@ -36,6 +36,12 @@ export type {
36
36
  UserOrgMembership,
37
37
  // Authorization context types (Phase 5 - ADR-CTRL-010)
38
38
  OrgScopedContext,
39
+ // Workspace Info/Settings surface types (PRD-00133)
40
+ WorkspaceSurface,
41
+ WorkspaceInfoOverview,
42
+ WorkspaceSettingsOverview,
43
+ IntegrationRequestStatus,
44
+ IntegrationRequest,
39
45
  } from './types';
40
46
 
41
47
  export { ROLE_DISPLAY_MAP } from './types';
package/src/org/types.ts CHANGED
@@ -377,3 +377,78 @@ export interface OrgScopedContext {
377
377
  */
378
378
  readonly _orgValidated: true;
379
379
  }
380
+
381
+ // =============================================================================
382
+ // Workspace Info/Settings Surface Types (PRD-00133)
383
+ // Capability naming invariant:
384
+ // Info surfaces use view-capabilities only (org.view_*)
385
+ // Settings surfaces use manage-capabilities only (org.manage_*)
386
+ // Consumers MUST NOT cross-wire: Info routes must never require org.manage_*
387
+ // capabilities, and Settings routes must never rely solely on org.view_*.
388
+ // =============================================================================
389
+
390
+ /**
391
+ * Discriminator for workspace surface routing.
392
+ * - 'info': Read-only surface, any member, org.view_* capabilities
393
+ * - 'settings': Admin surface, org.manage_* capabilities
394
+ */
395
+ export type WorkspaceSurface = 'info' | 'settings';
396
+
397
+ /**
398
+ * Read-only workspace overview for the Info surface.
399
+ * Visible to any workspace member with org.view_* capabilities.
400
+ *
401
+ * CAPABILITY INVARIANT: This type is served ONLY by Info routes
402
+ * which require org.view_* capabilities. Never use org.manage_*.
403
+ */
404
+ export interface WorkspaceInfoOverview {
405
+ /** Organization name. */
406
+ name: string;
407
+ /** Workspace owners (display-only). */
408
+ owners: Array<{ id: string; name: string }>;
409
+ /** Total member count. */
410
+ memberCount: number;
411
+ /** Human-readable management line (e.g., "Managed by Alice"). */
412
+ managedByLine: string;
413
+ }
414
+
415
+ /**
416
+ * Full workspace overview for the Settings surface.
417
+ * Extends Info with mutation-relevant fields.
418
+ * Visible only to admins with org.manage_* capabilities.
419
+ *
420
+ * CAPABILITY INVARIANT: This type is served ONLY by Settings routes
421
+ * which require org.manage_* capabilities. Never use org.view_* alone.
422
+ */
423
+ export interface WorkspaceSettingsOverview extends WorkspaceInfoOverview {
424
+ /** Organization slug (editable by admin). */
425
+ slug: string;
426
+ /** Metadata about who last edited settings and when. */
427
+ editMetadata: {
428
+ lastEditedBy: { id: string; name: string } | null;
429
+ lastEditedAt: string | null;
430
+ };
431
+ }
432
+
433
+ /**
434
+ * Status of an integration request from a member.
435
+ */
436
+ export type IntegrationRequestStatus = 'pending' | 'approved' | 'denied';
437
+
438
+ /**
439
+ * Advisory integration request created by a member.
440
+ * Members can request integration connections; admins see and action these.
441
+ * Creating a request does NOT guarantee approval.
442
+ */
443
+ export interface IntegrationRequest {
444
+ /** Unique request identifier. */
445
+ id: string;
446
+ /** Integration provider name (e.g., 'slack', 'github'). */
447
+ provider: string;
448
+ /** User who made the request. */
449
+ requestedBy: { id: string; name: string };
450
+ /** Current status of the request. */
451
+ status: IntegrationRequestStatus;
452
+ /** ISO8601 timestamp when the request was created. */
453
+ createdAt: string;
454
+ }
@@ -22,6 +22,7 @@ export const VIEW_SCOPE_MAP = {
22
22
  dashboard: 'org.view_dashboard',
23
23
  'organization-strategy': 'org.view_strategy',
24
24
  'system-snapshot': 'org.view_system',
25
+ 'company-admin': 'company.view_admin',
25
26
  // Public views (require only authentication)
26
27
  chat: null,
27
28
  settings: null,